BLOG

Ansible : Invalid/incorrect password: Permission denied, please try again

Trying to work with ansible and got the below error

The inventory having the following line :-

target1 ansible_host=192.168.204.129  ansible_ssh_pass=password

When trying to run a test like the below :-

osama@ansible-controller:~/ansible_test$ ansible target1 -m ping -i /home/osama/ansible_test/inventory.txt

The following error appeared :-

target1 | UNREACHABLE! => {

    "changed": false,

    "msg": "Invalid/incorrect password: Permission denied, please try again.",

    "unreachable": true

}

To solve this error you need to set the right username and password like the following, inside the inventory add the following :-

target1 ansible_host=192.168.204.129  ansible_ssh_user=osboxes aniansible_ssh_pass=password

Run the test again by :-

osama@ansible-controller:~/ansible_test$ ansible target1 -m ping -i /home/osama/ansible_test/inventory.txt  --ask-pass

The output will be

target1 | SUCCESS => {

    "ansible_facts": {

        "discovered_interpreter_python": "/usr/bin/python3"

    },

    "changed": false,

    "ping": "pong"

If you want pre-defined VMware or virtual box you can download from HERE

Enjoy

Osama

Docker Compose example

In this post i choose this topic – Docker compose, i will upload the files gradually till the project will be working and met my requriemnt 100%.

This project will be like the following

  • 2 application, i used php.
  • 1 nginx as load balancer
  • 1 database , i choose mysql version 8.

This project will be fully bulit on Docker compose, i tried to make simple as much as i can so the people will understand the concept.

The Project HERE.

Remember i will keep upload the files for this project will i will make sure it’s 100% meet my reqruiment but for now i uploaded the compose and enviroment variable.

Enjoy

Osama

RMOUG 2021

Happy New Year everyone and wish you all the best during this year.

I got accepted to speak at RMOUG Training Day 2021, the conference will be virtual so you can attend from your own home and learn something new.

I will speaking about the chaging Role of the DBA on Thurs Feb 11, 9:30 10:25 ( Eastern Standard Time) , you can register HERE.

And you can find RMOUG Agenda HERE.

See you soon

Osama

Docker & kubernetes example – Full project for free

Okay, I love to post free examples/projects on my github from while to while, i choose docker and kubernetes this time, the project idea it’s very nice and easy to implement.

What this project do ?

This can be a simple web app that reads a ‘hello world’ string from the MySQL database.Run a database app. Data volume should be persistent.Application from step 1 needs to discover the database from step 2 using Kubernetes native features.
Database credentials should NOT be hardcoded in application or helm chart code.The application should be accessible from the outside of Kubernetes.Create a helm chart which implements all these steps

  • Create an application that connects to a database, reads some data, and returns this data upon HTTP request, This can be a simple web app that reads a ‘hello world’ string from the MySQL database.
  • Run a database app. Data volume should be persistent.
  • Application from step 1 needs to discover the database from step 2 using Kubernetes native features, Database credentials should NOT be hardcoded in application or helm chart code.
  • The application should be accessible from the outside of Kubernetes.
  • Create a helm chart which implements all these steps

I Choose to use Java as programing language because the springboot framework it’s already defined and easy to use.

Please follow the readme file and everything will working fine without any issue, if you have any question comment below and i will answer

GitHub Link HERE

Enjoy the free learning

Osama

AUSOUG Virtual Connect 2020

I posted about this earlier , since AUSOUG had Virtual conference with different topics covering Cloud and databases.

my presentation was on Thursday about Oracle on azure. it was great pleasure to present again, the virtual connect had very big names in Oracle commuinty and had pleasure to present with them.

The Link for recorded session HERE

I recorded the session and it’s avaliable on my youtube channel HERE.

Enjoy learning

Osama

Alibaba Cloud MVP

Alibaba Cloud Most Valuable Professional (MVP) is an award for thought leaders. who are devoted to helping others fully understand and use Alibaba Cloud technologies.

Benefits

  • MVP Medal
  • Exclusive Services
  • Gain Exposure through Alibaba Cloud Official Channels
  • Two Tickets to the Computing Conference
  • Invitation to MVP Global Annual Summit
  • Visit to Alibaba Headquarters
  • MVP Lab
  • MVP Custom Gift Packs
  • Global Technical Study Tour
  • Alibaba Cloud High End Closed Conferences
  • High Level Resources
  • More benefits will be available soon.

MY PROFILE HERE

To be Officially the first and the only one so far that organized as Alibaba Cloud MVP in the middle east, it’s great pleasure.

I would like to thank alibaba for this opportunity and looking forward to serve the commuinty and make it better for all of us.

Alibaba Cloud Global AI Innovation Challenge with $116000 in prizes HERE.

Retail’s High-Tech Renaissance online Conference HERE

Public Courses on Cloud Native Technologies HERE

Regards

Osama

Next Event- Speaking Schedule/2020

I was honored this year to speak in different conferences around the world, and Due to Covid-19 most of the conference was Virtual, I miss my friends around the world, but saftey comes first, i hope everyone is safe.

I am writing this post to share with people the schedule of different conferences some of them already done but in case you missed something there is always next time, register in the virtual conferences and don’t miss the chance to learn something new.

My 2020 Schedule

Rule #1 in IT, never, and I do mean NEVER, stop learning.

Conference NameGroupDateLinkNote
Oracle Groundbreakers EMEA Virtual TourKSAOUG10-Oct-2020 1 2:30pmhttp://ogbemea.com/10-oct-2020/
SPOUG20SPOUGOctober 20, 2020 10:50 amhttp://spoug.es/spoug-20/
Oracle Groundbreakers APAC Virtual Tour 2020APAC Group19 October 2020, 10:00 amhttps://www.apacgbt.com/

This table will be updated depends on the schedule or any new conferences.

Regards

Osama

configure PMM for Percona MYSQL

Percona Monitoring and Management (PMM) is a best-of-breed open source database monitoring solution. It helps you reduce complexity, optimize performance, and improve the security of your business-critical database environments, no matter where they are located or deployed.

PMM is a free and open-source solution that you can run in your own environment for maximum security and reliability. It provides thorough time-based analysis for MySQL and MongoDB servers to ensure that your data works as efficiently as possible.

PMM, at a high-level, is made up of two basic components: the client and the server. The PMM Client is installed on the database servers themselves and is used to collect metrics. The client contains technology specific exporters (which collect and export data), and an “admin interface” (which makes the management of the PMM platform very simple). The PMM server is a “pre-integrated unit” (Docker, VM or AWS AMI) that contains four components that gather the metrics from the exporters on the PMM client(s). The PMM server contains Consul, Grafana, Prometheus and a Query Analytics Engine that Percona has developed. Here is a graphic from the architecture section of our documentation. In order to keep this post to a manageable length.

In this post i will setup the PMM on docker.

Pulling the PMM Server Docker Image

docker pull percona/pmm-server:2

Create a persistent data container.

docker create --volume /srv \
--name pmm-data percona/pmm-server:2 /bin/true

Run the image to start PMM Server.

docker run --detach --restart always \ --publish 80:80 --publish 443:443 \ --volumes-from pmm-data --name pmm-server \ percona/pmm-server:2

Once you completed the server configuration, you have to install the client on desired one, for example in our case we want to install it to monitor MySQL so we will go to install PMM Client on MySQL server.

To install the PMM client package, follow these steps.

Configure Percona repositories using the percona-release tool

wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb

Note

If you have previously enabled the experimental or testing Percona repository, don’t forget to disable them and enable the release component of the original repository as follows:

sudo percona-release disable all
sudo percona-release enable original release

Install the PMM client package:

sudo apt-get update
sudo apt-get install pmm2-client

Register your Node:

Before doing this, there are some MySQL requirements should be done from Database side.

Enable Logs in MySQL follow these step

SET GLOBAL slow_query_log_file = '/path/to/slow_query.log';

Determine what makes a query “slow”, by setting the limit (in seconds) after which a query is logged to the slow query log. The example below logs every query that exceeds 10 seconds in duration

mysql> SET GLOBAL long_query_time = 10;

Now enable the Slow Query log.

mysql> SET GLOBAL slow_query_log = 'ON';
mysql> FLUSH LOGS;

If you want to make these changes persistent, modify the my.cnf and add these lines to the [mysqld] part of the config.

[mysqld]
...
slow_query_log = /path/to/slow_query.log
long_query_time = 10
log_queries_not_using_indexes = ON

Verify

mysql> SHOW GLOBAL VARIABLES LIKE 'log_queries_not_using_indexes';

Once you are done you have to create username/password for PMM,this user should have necessary privileges for collecting data. If the pmm user already exists, you can grant the required privileges as follows:

CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'pass' WITH MAX_USER_CONNECTIONS 10;

GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'localhost';

Once you done, register your node.

pmm-admin config --server-insecure-tls --server-url=https://admin:admin@<IP Address>:443

You have to wait for couple of minutes till it will be sync.

You should see the following output:

Checking local pmm-agent status...
pmm-agent is running.
Registering pmm-agent on PMM Server...
Registered.
Configuration file /usr/local/percona/pmm-agent.yaml updated.
Reloading pmm-agent configuration...
Configuration reloaded.

Regards

Osama