Senin, 10 Juni 2024

PSQL-monitoring server/client

 

https://www.percona.com/software/pmm/quickstart

https://www.percona.com/downloads

==========================================================
root@ubuntu:~# apt install gnupg gnupg2 gnupg1 -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gnupg is already the newest version (2.2.27-3ubuntu2.1).
gnupg set to manually installed.
Suggested packages:
 libpcsclite1 parcimonie xloadimage | imagemagick | eog
The following NEW packages will be installed:
 gnupg1 gnupg1-l10n gnupg2
0 upgraded, 3 newly installed, 0 to remove and 111 not upgraded.
Need to get 1074 kB of archives.
After this operation, 5018 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 gnupg1 amd64 1.4.23-1.1build1 [559 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 gnupg1-l10n all 1.4.23-1.1build1 [510 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 gnupg2 all 2.2.27-3ubuntu2.1 [5548 B]
Fetched 1074 kB in 5s (199 kB/s)
Selecting previously unselected package gnupg1.
(Reading database ... 109335 files and directories currently installed.)
Preparing to unpack .../gnupg1_1.4.23-1.1build1_amd64.deb ...
Unpacking gnupg1 (1.4.23-1.1build1) ...
Selecting previously unselected package gnupg1-l10n.
Preparing to unpack .../gnupg1-l10n_1.4.23-1.1build1_all.deb ...
Unpacking gnupg1-l10n (1.4.23-1.1build1) ...
Selecting previously unselected package gnupg2.
Preparing to unpack .../gnupg2_2.2.27-3ubuntu2.1_all.deb ...
Unpacking gnupg2 (2.2.27-3ubuntu2.1) ...
Setting up gnupg2 (2.2.27-3ubuntu2.1) ...
Setting up gnupg1 (1.4.23-1.1build1) ...
Setting up gnupg1-l10n (1.4.23-1.1build1) ...
Processing triggers for install-info (6.8-4build1) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...                                                                                                                                                                                       
Scanning linux images...                                                                                                                                                                                    
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@ubuntu:~# sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
root@ubuntu:~# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
root@ubuntu:~# apt-get update -y
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://apt.postgresql.org/pub/repos/apt jammy-pgdg InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:5 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
W: http://apt.postgresql.org/pub/repos/apt/dists/jammy-pgdg/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
root@ubuntu:~# apt-get install postgresql-14 -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
 libcommon-sense-perl libjson-perl libjson-xs-perl libllvm15 libpq5 libsensors-config libsensors5 libtypes-serialiser-perl postgresql-client-14 postgresql-client-common postgresql-common ssl-cert
 sysstat
Suggested packages:
 lm-sensors postgresql-doc-14 isag
The following NEW packages will be installed:
 libcommon-sense-perl libjson-perl libjson-xs-perl libllvm15 libpq5 libsensors-config libsensors5 libtypes-serialiser-perl postgresql-14 postgresql-client-14 postgresql-client-common postgresql-common
 ssl-cert sysstat
0 upgraded, 14 newly installed, 0 to remove and 111 not upgraded.
Need to get 44.7 MB of archives.
After this operation, 180 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libjson-perl all 4.04000-1 [81.8 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 postgresql-client-common all 260.pgdg22.04+1 [94.6 kB]
Get:3 http://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 postgresql-common all 260.pgdg22.04+1 [240 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 ssl-cert all 1.1.2 [17.4 kB]
Get:5 http://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 libpq5 amd64 16.3-1.pgdg22.04+1 [217 kB]
Get:6 http://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 postgresql-client-14 amd64 14.12-1.pgdg22.04+1 [1621 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/main amd64 libcommon-sense-perl amd64 3.75-2build1 [21.1 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/main amd64 libtypes-serialiser-perl all 1.01-1 [11.6 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 libjson-xs-perl amd64 4.030-1build3 [87.2 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libllvm15 amd64 1:15.0.7-0ubuntu0.22.04.3 [25.4 MB]
Get:11 http://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 postgresql-14 amd64 14.12-1.pgdg22.04+1 [16.4 MB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 libsensors-config all 1:3.6.0-7ubuntu1 [5274 B]                                                                                                   
Get:13 http://archive.ubuntu.com/ubuntu jammy/main amd64 libsensors5 amd64 1:3.6.0-7ubuntu1 [26.3 kB]                                                                                                      
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 sysstat amd64 12.5.2-2ubuntu0.2 [487 kB]                                                                                                  
Fetched 44.7 MB in 39s (1160 kB/s)                                                                                                                                                                         
Preconfiguring packages ...
Selecting previously unselected package libjson-perl.
(Reading database ... 109407 files and directories currently installed.)
Preparing to unpack .../00-libjson-perl_4.04000-1_all.deb ...
Unpacking libjson-perl (4.04000-1) ...
Selecting previously unselected package postgresql-client-common.
Preparing to unpack .../01-postgresql-client-common_260.pgdg22.04+1_all.deb ...
Unpacking postgresql-client-common (260.pgdg22.04+1) ...
Selecting previously unselected package ssl-cert.
Preparing to unpack .../02-ssl-cert_1.1.2_all.deb ...
Unpacking ssl-cert (1.1.2) ...
Selecting previously unselected package postgresql-common.
Preparing to unpack .../03-postgresql-common_260.pgdg22.04+1_all.deb ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Unpacking postgresql-common (260.pgdg22.04+1) ...
Selecting previously unselected package libcommon-sense-perl:amd64.
Preparing to unpack .../04-libcommon-sense-perl_3.75-2build1_amd64.deb ...
Unpacking libcommon-sense-perl:amd64 (3.75-2build1) ...
Selecting previously unselected package libtypes-serialiser-perl.
Preparing to unpack .../05-libtypes-serialiser-perl_1.01-1_all.deb ...
Unpacking libtypes-serialiser-perl (1.01-1) ...
Selecting previously unselected package libjson-xs-perl.
Preparing to unpack .../06-libjson-xs-perl_4.030-1build3_amd64.deb ...
Unpacking libjson-xs-perl (4.030-1build3) ...
Selecting previously unselected package libllvm15:amd64.
Preparing to unpack .../07-libllvm15_1%3a15.0.7-0ubuntu0.22.04.3_amd64.deb ...
Unpacking libllvm15:amd64 (1:15.0.7-0ubuntu0.22.04.3) ...
Selecting previously unselected package libpq5:amd64.
Preparing to unpack .../08-libpq5_16.3-1.pgdg22.04+1_amd64.deb ...
Unpacking libpq5:amd64 (16.3-1.pgdg22.04+1) ...
Selecting previously unselected package libsensors-config.
Preparing to unpack .../09-libsensors-config_1%3a3.6.0-7ubuntu1_all.deb ...
Unpacking libsensors-config (1:3.6.0-7ubuntu1) ...
Selecting previously unselected package libsensors5:amd64.
Preparing to unpack .../10-libsensors5_1%3a3.6.0-7ubuntu1_amd64.deb ...
Unpacking libsensors5:amd64 (1:3.6.0-7ubuntu1) ...
Selecting previously unselected package postgresql-client-14.
Preparing to unpack .../11-postgresql-client-14_14.12-1.pgdg22.04+1_amd64.deb ...
Unpacking postgresql-client-14 (14.12-1.pgdg22.04+1) ...
Selecting previously unselected package postgresql-14.
Preparing to unpack .../12-postgresql-14_14.12-1.pgdg22.04+1_amd64.deb ...
Unpacking postgresql-14 (14.12-1.pgdg22.04+1) ...
Selecting previously unselected package sysstat.
Preparing to unpack .../13-sysstat_12.5.2-2ubuntu0.2_amd64.deb ...
Unpacking sysstat (12.5.2-2ubuntu0.2) ...
Setting up postgresql-client-common (260.pgdg22.04+1) ...
Setting up libsensors-config (1:3.6.0-7ubuntu1) ...
Setting up libpq5:amd64 (16.3-1.pgdg22.04+1) ...
Setting up libcommon-sense-perl:amd64 (3.75-2build1) ...
Setting up postgresql-client-14 (14.12-1.pgdg22.04+1) ...
update-alternatives: using /usr/share/postgresql/14/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up ssl-cert (1.1.2) ...
Setting up libsensors5:amd64 (1:3.6.0-7ubuntu1) ...
Setting up libtypes-serialiser-perl (1.01-1) ...
Setting up libllvm15:amd64 (1:15.0.7-0ubuntu0.22.04.3) ...
Setting up libjson-perl (4.04000-1) ...
Setting up sysstat (12.5.2-2ubuntu0.2) ...
Creating config file /etc/default/sysstat with new version
update-alternatives: using /usr/bin/sar.sysstat to provide /usr/bin/sar (sar) in auto mode
Created symlink /etc/systemd/system/sysstat.service.wants/sysstat-collect.timer → /lib/systemd/system/sysstat-collect.timer.
Created symlink /etc/systemd/system/sysstat.service.wants/sysstat-summary.timer → /lib/systemd/system/sysstat-summary.timer.
Created symlink /etc/systemd/system/multi-user.target.wants/sysstat.service → /lib/systemd/system/sysstat.service.
Setting up libjson-xs-perl (4.030-1build3) ...
Setting up postgresql-common (260.pgdg22.04+1) ...
Adding user postgres to group ssl-cert
Creating config file /etc/postgresql-common/createcluster.conf with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
'/etc/apt/trusted.gpg.d/apt.postgresql.org.gpg' -> '/usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg'
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /lib/systemd/system/postgresql.service.
Setting up postgresql-14 (14.12-1.pgdg22.04+1) ...
Creating new PostgreSQL cluster 14/main ...
/usr/lib/postgresql/14/bin/initdb -D /var/lib/postgresql/14/main --auth-local peer --auth-host scram-sha-256 --no-instructions
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/14/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
Scanning processes...                                                                                                                                                                                       
Scanning linux images...                                                                                                                                                                                    
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@ubuntu:~# systemctl status postgresql
postgresql.service - PostgreSQL RDBMS
    Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
    Active: active (exited) since Tue 2024-06-18 04:29:03 UTC; 44s ago
  Main PID: 33029 (code=exited, status=0/SUCCESS)
       CPU: 4ms
Jun 18 04:29:03 ubuntu systemd[1]: Starting PostgreSQL RDBMS...
Jun 18 04:29:03 ubuntu systemd[1]: Finished PostgreSQL RDBMS.
root@ubuntu:~# su - postgres
postgres@ubuntu:~$ psql
psql (14.12 (Ubuntu 14.12-1.pgdg22.04+1))
Type "help" for help.
postgres=# \l
                                 List of databases
  Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges    
-----------+----------+----------+-------------+-------------+-----------------------
postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |  
template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
          |          |          |             |             | postgres=CTc/postgres
template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
          |          |          |             |             | postgres=CTc/postgres
(3 rows)
postgres=# ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_statements';
ALTER SYSTEM
postgres=# CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
CREATE EXTENSION
postgres=# SELECT calls, query FROM pg_stat_statements LIMIT 1;
ERROR:  pg_stat_statements must be loaded via shared_preload_libraries
postgres=# \q
postgres@ubuntu:~$ exit
logout
root@ubuntu:~# systemctl restart postgresql     
root@ubuntu:~# su - postgres                
postgres@ubuntu:~$ psql
psql (14.12 (Ubuntu 14.12-1.pgdg22.04+1))
Type "help" for help.
postgres=# SELECT calls, query FROM pg_stat_statements LIMIT 1;
calls | query  
-------+-------
(0 rows)
postgres=# \q
postgres@ubuntu:~$ exit
logout
root@ubuntu:~# wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
--2024-06-18 04:33:05--  https://repo.percona.com/apt/percona-release_latest.jammy_all.deb
Resolving repo.percona.com (repo.percona.com)... 147.135.54.159, 2604:2dc0:200:69f::2
Connecting to repo.percona.com (repo.percona.com)|147.135.54.159|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11804 (12K) [application/x-debian-package]
Saving to: ‘percona-release_latest.jammy_all.deb’
percona-release_latest.jammy_all.deb               100%[===============================================================================================================>]  11.53K  --.-KB/s    in 0s       
2024-06-18 04:33:06 (131 MB/s) - ‘percona-release_latest.jammy_all.deb’ saved [11804/11804]
root@ubuntu:~# sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
Selecting previously unselected package percona-release.
(Reading database ... 111635 files and directories currently installed.)
Preparing to unpack percona-release_latest.jammy_all.deb ...
Unpacking percona-release (1.0-27.generic) ...
Setting up percona-release (1.0-27.generic) ...
* Enabling the Percona Original repository
<*> All done!
==> Please run "apt-get update" to apply changes
* Enabling the Percona Release repository
<*> All done!
==> Please run "apt-get update" to apply changes
The percona-release package now contains a percona-release script that can enable additional repositories for our newer products.
For example, to enable the Percona Server 8.0 repository use:
 percona-release setup ps80
Note: To avoid conflicts with older product versions, the percona-release setup command may disable our original repository for some products.
For more information, please visit:
 https://www.percona.com/doc/percona-repo-config/percona-release.html
root@ubuntu:~# apt-get update
Get:1 http://repo.percona.com/percona/apt jammy InRelease [15.7 kB]
Hit:2 http://apt.postgresql.org/pub/repos/apt jammy-pgdg InRelease          
Hit:3 http://archive.ubuntu.com/ubuntu jammy InRelease                      
Get:4 http://repo.percona.com/prel/apt jammy InRelease [18.7 kB]
Hit:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Get:6 http://repo.percona.com/percona/apt jammy/main Sources [4306 B]
Hit:7 http://archive.ubuntu.com/ubuntu jammy-backports InRelease     
Get:8 http://repo.percona.com/percona/apt jammy/main amd64 Packages [16.6 kB]
Hit:9 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Get:10 http://repo.percona.com/prel/apt jammy/main amd64 Packages [415 B]
Fetched 55.7 kB in 2s (24.1 kB/s)
Reading package lists... Done
root@ubuntu:~# apt-get install pmm2-client
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
 pmm2-client
0 upgraded, 1 newly installed, 0 to remove and 111 not upgraded.
Need to get 88.0 MB of archives.
After this operation, 202 MB of additional disk space will be used.
Get:1 http://repo.percona.com/percona/apt jammy/main amd64 pmm2-client amd64 2.42.0-6.jammy [88.0 MB]
Fetched 88.0 MB in 26s (3395 kB/s)                                                                                                                                                                         
Selecting previously unselected package pmm2-client.
(Reading database ... 111640 files and directories currently installed.)
Preparing to unpack .../pmm2-client_2.42.0-6.jammy_amd64.deb ...
Adding system user `pmm-agent' (UID 114) ...
Adding new group `pmm-agent' (GID 120) ...
Adding new user `pmm-agent' (UID 114) with group `pmm-agent' ...
Creating home directory `/usr/local/percona' ...
Unpacking pmm2-client (2.42.0-6.jammy) ...
Setting up pmm2-client (2.42.0-6.jammy) ...
Created symlink /etc/systemd/system/multi-user.target.wants/pmm-agent.service → /lib/systemd/system/pmm-agent.service.
Scanning processes...                                                                                                                                                                                       
Scanning linux images...                                                                                                                                                                                    
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@ubuntu:~# sudo pmm-admin config --server-insecure-tls --server-url=https://admin:P@ssw0rd@172.16.9.177 172.16.77.113 generic ygdb
Checking local pmm-agent status...
pmm-agent is running.
Registering pmm-agent on PMM Server...
Registered.
Configuration file /usr/local/percona/pmm2/config/pmm-agent.yaml updated.
Reloading pmm-agent configuration...
Configuration reloaded.
Checking local pmm-agent status...
pmm-agent is running.
root@ubuntu:~# su - postgres
postgres@ubuntu:~$ psql
psql (14.12 (Ubuntu 14.12-1.pgdg22.04+1))
Type "help" for help.
postgres=# CREATE USER harnedi WITH SUPERUSER ENCRYPTED PASSWORD 'P@ssw0rd';    
CREATE ROLE
postgres=# \q
postgres@ubuntu:~$ exit
logout
root@ubuntu:~# sudo pmm-admin add postgresql --username='harnedi' --password=P@ssw0rd --service-name=ybdb-service
PostgreSQL Service added.
Service ID  : /service_id/df7115d8-3b9f-44f4-847d-25c9cd9e723b
Service name: ybdb-service
Warning: Could not to detect the pg_stat_monitor extension on your system. Falling back to the pg_stat_statements.
root@ubuntu:~#


=========================================================

dbsa@dbsa-X406UA:~$ ssh root@172.16.10.250
root@ubuntu:~#  wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
--2024-06-13 02:11:46--  https://repo.percona.com/apt/percona-release_latest.focal_all.deb
Resolving repo.percona.com (repo.percona.com)... 147.135.54.159, 2604:2dc0:200:69f::2
Connecting to repo.percona.com (repo.percona.com)|147.135.54.159|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11804 (12K) [application/x-debian-package]
Saving to: ‘percona-release_latest.focal_all.deb’

percona-release_latest.focal_all.deb          100%[==============================================================================================>]  11,53K  --.-KB/s    in 0s       

2024-06-13 02:11:47 (64,5 MB/s) - ‘percona-release_latest.focal_all.deb’ saved [11804/11804]

root@ubuntu:~# sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb

root@ubuntu:~# apt-get update
root@ubuntu:~# pmm-admin config --server-insecure-tls --server-url=https://admin:P@ssw0rd@172.16.9.177:443 172.16.10.250 generic mynodename                              
Checking local pmm-agent status...
pmm-agent is running.
Registering pmm-agent on PMM Server...
Registered.
Configuration file /usr/local/percona/pmm2/config/pmm-agent.yaml updated.
Reloading pmm-agent configuration...
Configuration reloaded.
Checking local pmm-agent status...
pmm-agent is running.
root@ubuntu:~# pmm-admin status
Agent ID : /agent_id/4bb94120-11bf-496d-af4b-4a11d109b4a9
Node ID  : /node_id/4a219fe3-7b6f-4b70-befd-c2cb0f69b0da
Node name: mynodename

PMM Server:
       URL    : https://172.16.9.177:443/
       Version: 2.41.2

PMM Client:
       Connected        : true
       Time drift       : 12.602472ms
       Latency          : 567.297µs
       Connection uptime: 100
       pmm-admin version: 2.42.0
       pmm-agent version: 2.42.0
Agents:
       /agent_id/29894f20-9c63-4c49-a737-065adfc6b3e7 node_exporter Running 42000
       /agent_id/65d2ddef-f691-46ac-bd9c-0b9753de81a0 vmagent Running 42001

root@ubuntu:~#
su - postgres

CREATE USER pmm WITH SUPERUSER ENCRYPTED PASSWORD 'P@ssw0rd';

root@ubuntu:~#sudo pmm-admin add postgresql --username='pmm' --password=P@ssw0rd --service-name=psql-service



=========================================================


Applies to: All Docker compatible *nix based systems
Requirements: Docker

We have developed an easy installation script that will check and install, if necessary, any missing software. Run the command as a user with sudo privileges or as root.

curl -fsSL https://www.percona.com/get/pmm | /bin/bash

When the installation finishes, information on how to access the interface will display along with the default credentials.

Step 2: Install PMM Client

Choose either Ubuntu or Red Hat:

Ubuntu: Install PMM Client

Requirements: None

1. Download Percona Repo Package

wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb

2. Install Percona Repo Package

sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb

3. Update apt cache

sudo apt-get update

4. Install Percona Monitoring and Management Client

sudo apt-get install pmm2-client

 

Step 3: Connect Client to Server

Applies to: All (optional if only using AWS Monitoring)

Requirements: Client to server communication to secure port on pmm-server (443 assumed) — must be performed on every system to be monitored.

Register Percona Monitoring and Management client with server

sudo pmm-admin config --server-insecure-tls --server-url=https://admin:<password>@pmm.example.com

Step 4: Create a PMM user for monitoring

Applies to: All

Postgres

 

Create a Percona Monitoring and Management specific user for Monitoring (using the postgres CLI)

CREATE USER pmm WITH SUPERUSER ENCRYPTED PASSWORD '<password>';

 

Register the server for monitoring

sudo pmm-admin add postgresql --username='pmm' --password=<password>

 

Congratulations! You should now have a successful basic PMM installation. We encourage you to click through the PMM application to ensure your configured database(s) are appearing within the PMM interface and are collecting data as expected.

For more advanced installation and configuration options, please see the full download and documentation pages, or visit our Percona Monitoring and Management Forum for additional assistance.

Step 5: Connect PMM to your Percona Account

Note: This step is recommended and not mandatory.

Don’t have a Percona Account yet?

Percona Account is a single login provides you with seamless access across all of your Percona properties, as well as insights for your database environment, knowledge base, unified view of support tickets with Percona and ServiceNow, and guidance from Percona experts.

Tidak ada komentar:

Posting Komentar