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

Oracle Groundbreakers Tour 2020 LATAM

Again, But this time virtual, I remember the tour before three years, one of the most fantastic trip, met new people and friends, this time it will be virtual due to Coronavirus, great topics, and Geeks

Register now and don’t miss it there is always time to learn something new.

DateTime ( Jordan Time will be GMT-5)Topic
August 17th 202016:00-16:45DevOps for Oracle Databases

Link Here

Enjoy

Cheers

How to be Azure Solutions Architect Expert

Many of you knows that i have been working on different cloud vendor, oracle cloud infrastructure , Amazon AWS, and MS Azure, and I had chance to work on many of them with hands-on experience and implement projects on all of them.

Now i am working on 2nd book that will include different topics about the 3 of them, DevOps, and comparison between all the three cloud vendor and more.

During the Lockdown, i was working to sharp my skills and test them in the cloud, therefore i decided to go for azure first and trust me when i say “it’s on of the hardest exam i ever did”.

The exam itself it’s totally different from what i used to, real case scenario that you should be aware of azure features, all of them, and configure them.

To be “Azure Solutions Architect Expert”, there are some of the conditions you should go thru, first you need to apply for two exams, AZ-301 & AZ-300

  • AZ-301 Microsoft Azure Architect Design
  • AZ-300 Microsoft Azure Architect Technologies

Both are Part of the requirements for: Microsoft Certified: Azure Solutions Architect Expert, the first exam which AZ-301, disccused the following secure, scalable, and reliable solutions. Candidates should have advanced experience and knowledge across various aspects of IT operations, including networking, virtualization, identity, security, business continuity, disaster recovery, data management, budgeting, and governance. This role requires managing how decisions in each area affects an overall solution. Candidates must be proficient in Azure administration, Azure development, and DevOps, and have expert-level skills in at least one of those domains.

Learning Objectives

  • Determine workload requirements
  • Design for identity and security
  • Design a data platform solution
  • Design a business continuity strategy
  • Design for deployment, migration, and integration
  • Design an infrastructure strategy

For the AZ-300

Learning Objectives

  • Deploy and configure Azure infrastructure
  • Implement workloads and security on Azure
  • Create and deploy apps on Azure
  • Implement Azure authentication and secure data
  • Develop for the cloud

After you completed the both exams successfully you will receive your badge for the three exams, durtation for the exams around 3 hours and trust me you will need it.

Enjoy

Osama

Apply for Oracle exam extension

As we already know oracle has been providing free exam and materials for siz track like the following till 15 May 2020: –

and because of the high demand since there are not available slot anymore, Oracle now providing extension BUT you have to apply for this

Follow this Video :-

How to ask for extension

Enjoy

Osama

How to study for Oracle Cloud Infrastructure Developer 2020 Associate

Many of you knows that Oracle annouced before one month, the six track from Oracle university included the exams for free, so far i completed four of them and looking for the other two.

in this post i will discuss how to preapre for exam 1z0-1084-20, in my opioion, this exam it’s more DevOps exam, so if you know the knowledge with Docker and Kubernetes and worked on them, working with OCI (Oracle Cloud Infrastrcuture) before, go ahead and apply for this exam.

The funny thing when you pass one exam and post about it on the social media directly i start recieving multiple messages from different people i don’t know, asking “could you please provide us with the dumps ?” first of all, how did you assume i am using dump, i failed mulitple times in different Oracle exam, second, i am aganist the dumps for various reasons, the exam is prove that you are ready to go thru this track and work on it, imagine you put this on your resume and someone asked you question about it, it will not be professional for you.

However, i would like to discuss 1z0-1084-20 specially this one, because i didn’t feel it’s only related to Oracle, you should have knowledge with different criteria,

  • Docker
  • Kubernetes
  • Microservices
  • software architect patterns
  • Testing patterns
  • For sure OCI

When you are study for this exam, you should follow Lucas Jellema Blog here and you can follow him on twitter also.

This blog saved me alot of time and explained everything you need to know in details.

Exam TitleOracle Cloud Infrastructure Developer
2020 Associate
FormatMultiple Choice
Duration105 Minutes
Number of
Questions:
60
Passing Score:70%
Exam Details

Exam Preparation

you need to focus on the following topics if you want to pass this exam :-

  • Develop application using OCI Developer tools, such as, APIs, SDKs and CLI
  • Develop a serverless application
  • Develop high performing applications & API
  • Manage & store the application code runtimes
  • Oracle Function
  • OCI container engine for kubernetes.
  • OCIR – Oracle Cloud Infrastructure Registry.

Wish you all the best

Osama

Install Apache Ambari on Ubuntu 18.04 to Manage Hadoop

What is Ambari ?

Ambari is an open-source administration tool deployed on top of Hadoop clusters, and it is responsible for keeping track of the running applications and their status. Apache Ambari can be referred to as a web-based management tool that manages, monitors, and provisions the health of Hadoop clusters.

With Ambari, Hadoop operators get the following core benefits:

  • Simplified Installation, Configuration and Management.
  • Centralized Security Setup.
  • Full Visibility into Cluster Health.
  • Highly Extensible and Customizable.

For more information about Ambari, review the documentation here.

The Below picture shows how the ambari architecture: –

The Ambari Installation is pretty simple, the below section will discuss the installation steps

  • Installation of Apache Ambari is very easy. SSH to your server and become root, add Ambari repository file to /etc/apt/sources.list.d :
wget -O /etc/apt/sources.list.d/ambari.list http://public-repo-1.hortonworks.com/ambari/ubuntu16/2.x/updates/2.7.3.0/ambari.list
  • Then we have to add the ambari.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
  • Run the update
apt-get update
  • Confirm that Ambari packages downloaded successfully by checking the package name list.
apt-cache showpkg ambari-server
apt-cache showpkg ambari-agent
apt-cache showpkg ambari-metrics-assembly

The above checking should give you the following result :-

  • Now we will install the Ambari server which will also install the above said default PostgreSQL Ambari database :
apt-get install ambari-server
  • Next part is running the command to set up the Ambari Server :
ambari-server setup

The above command will start configure Ambari to connect the database, the default database is PostgreSQL, then install JDK, and the Ambrai daemon, then the account, you could choose advance setting for database in case you want to change the database type, ambari gives you different options such as Oracle, MySQL, Microsoft and DB2, the default database username and password is

Username : Ambari
Password : bigdata

And the The Dashboard Link (https://hostname:8080/) :-

admin
admin

You can start the Ambari server by running the following command :-

To start the Ambari server: service ambari-server start
To stop the Ambari server: service ambari-server stop
restart the Ambari server: service ambari-server restart
To check the Ambari server processes: ps -ef | grep Ambari.

Cheers

Thanks

Osama Mustafa

Install Boto3 Module for python

In this post i will discuss how to install Boto3 module on Python, I am using Python 3.6, What is Boto3 ?!

Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2. You can find the latest, most up to date, documentation at our doc site, including a list of services that are supported.

The Module is very big and covering all AWS features, you can intergrate the code and start dealing with S3 for exampel from Download/Upload, Create Bucket , Delete and more; the documentation is here

To install Boto3, you should follow the below steps

Option #1

yum install python3-pip

Once you run the above command, Pip will be installed on local machine which is a package manager for Python packages, or modules if you like.

pip3 install boto3 --user

Option #2

I prefer this method more than Option #1 because it’s run by python itself

python3 -m pip install --user boto3

Now you installed Boto3 on your machine, you can start using it by

import boto3

Enjoy the coding with Python

Osama

Java Business Service/Siebel

Java Business Service (JBS) is a service framework that allows custom business services to be implemented in Java and run from a Siebel application.

If you have experience with java, you would likely to create Business service in java which you will find it easy.

Scenario: We wanted a business service to convert Gorgerin Time to Hijri Time, We did it in java then created a JBS then implement it in Siebel.

 

Steps :

  • Java Configuration in CFG.
  • Adding The required jar and jdk.
  • Creating the code and Exporting the jar file.
  • Creating Business service in Tools.

 

The following document discuss these steps in detais, you can access it here.

Cheers 🍻

Osama