Este conteúdo não está disponível no idioma selecionado.
Chapter 3. Installing PCP Packages
This procedure describes how to install the PCP packages.
Prerequisites
Ensure you have a minimum of 20 GB space available in the
/var/log/pcp
directory.The default PCP data retention policy is to retain only that data collected during the past 14 days. Data storage per day is estimated to use usually between 100 MB and 500 MB of disk space, but may use up to several gigabytes.
- Ensure that the base system on which Satellite Server is running is Red Hat Enterprise Linux 7.6. or later. The minimum supported version for the PCP packages is PCP version 4.1.
Procedure
Install the PCP packages:
yum install pcp \ pcp-pmda-apache \ pcp-pmda-postgresql \ pcp-system-tools
# yum install pcp \ pcp-pmda-apache \ pcp-pmda-postgresql \ pcp-system-tools
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the Performance Metrics Collector daemon, and the Performance Metrics Logger daemon:
systemctl enable pmcd pmlogger systemctl start pmcd pmlogger
# systemctl enable pmcd pmlogger # systemctl start pmcd pmlogger
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1. Configuring PCP Data Collection Copiar o linkLink copiado para a área de transferência!
This procedure describes how to configure PCP to collect metrics about processes, Satellite, Apache HTTP Server, and PostgreSQL.
Procedure
Configure PCP to collect data about important Satellite processes.
By default, PCP collects basic system metrics. This step enables detailed metrics about the following Satellite processes:
- Java
- PostgreSQL
- MongoDB
- Dynflow
- Passenger
- Pulp
Qpid
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configure PCP to log the process metrics being collected.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the process monitoring PMDA.
cd /var/lib/pcp/pmdas/proc ./Install
# cd /var/lib/pcp/pmdas/proc # ./Install
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure PCP to collect metrics from Apache HTTP Server.
Enable the Apache HTTP Server extended status module.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Apache HTTP Server PMDA.
cd /var/lib/pcp/pmdas/apache ./Install
# cd /var/lib/pcp/pmdas/apache # ./Install
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Prevent the Satellite installer overwriting the extended status module’s configuration file.
Add the following line to the
/etc/foreman-installer/custom-hiera.yaml
configuration file.apache::purge_configs: false
apache::purge_configs: false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configure PCP to collect metrics from PostgreSQL.
Change to the
/var/lib/pcp/pmdas/postgresql
directory.cd /var/lib/pcp/pmdas/postgresql
# cd /var/lib/pcp/pmdas/postgresql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the installer.
./Install
# ./Install
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the PCP database interface to permit access to the PostgreSQL database.
Edit the
/etc/pcpdbi.conf
configuration file, inserting the following lines:$database = "dbi:Pg:dbname=foreman;host=localhost"; $username = "foreman"; $password = "6qXfN9m5nii5iEcbz8nuiJBNsyjjdRHA"; $os_user = "foreman";
$database = "dbi:Pg:dbname=foreman;host=localhost"; $username = "foreman"; $password = "6qXfN9m5nii5iEcbz8nuiJBNsyjjdRHA";
1 $os_user = "foreman";
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The value for $password is stored in
/etc/foreman/database.yml
configuration file.
Change the SELinux
pcp_pmcd_t
domain permission to permit PCP access to the PostgreSQL database.semanage permissive -a pcp_pmcd_t
# semanage permissive -a pcp_pmcd_t
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the PostgreSQL PMDA is able to connect to PostgreSQL.
Examine the
/var/log/pcp/pmcd/postgresql.log
file to confirm the connection is established. Without a successful database connection, the PostgreSQL PMDA will remain active, but not be able to provide any metrics.[Tue Aug 14 09:21:06] pmdapostgresql(25056) Info: PostgreSQL connection established
[Tue Aug 14 09:21:06] pmdapostgresql(25056) Info: PostgreSQL connection established
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you find errors in
/var/log/pcp/pmcd/postgresql.log
, restart the pmcd service.systemctl restart pmcd
# systemctl restart pmcd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Enable telemetry functionality in Satellite.
To enable collection of metrics from Satellite, you must send metrics via the
statsd
protocol into thepcp-mmvstatsd
daemon. The metrics are aggregated and available via the PCP MMV API.Install the Foreman Telemetry and
pcp-mmvstatsd
packages.yum install foreman-telemetry pcp-mmvstatsd
# yum install foreman-telemetry pcp-mmvstatsd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the
pcp-mmvstatsd
service.systemctl enable pcp-mmvstatsd systemctl start pcp-mmvstatsd
# systemctl enable pcp-mmvstatsd # systemctl start pcp-mmvstatsd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Satellite telemetry functionality.
Add the following lines to
/etc/foreman/settings.yaml
configuration file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Schedule daily storage of metrics in archive files:
cat >/etc/cron.daily/refresh_mmv <<EOF #!/bin/bash echo "log mandatory on 1 minute mmv" | /usr/bin/pmlc -P EOF chmod +x /etc/cron.daily/refresh_mmv
# cat >/etc/cron.daily/refresh_mmv <<EOF #!/bin/bash echo "log mandatory on 1 minute mmv" | /usr/bin/pmlc -P EOF # chmod +x /etc/cron.daily/refresh_mmv
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the Apache HTTP Server and PCP to begin data collection:
systemctl restart httpd pmcd pmlogger
# systemctl restart httpd pmcd pmlogger
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Enabling Access to Metrics via the Web UI Copiar o linkLink copiado para a área de transferência!
This procedure describes how to access metrics collected by PCP, via the web UI.
Procedure
Enable the Red Hat Enterprise Linux
optional
repository:subscription-manager repos --enable rhel-7-server-optional-rpms
# subscription-manager repos --enable rhel-7-server-optional-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the PCP web API and applications:
yum install pcp-webapi pcp-webapp-grafana pcp-webapp-vector
# yum install pcp-webapi pcp-webapp-grafana pcp-webapp-vector
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the PCP web service:
systemctl start pmwebd systemctl enable pmwebd
# systemctl start pmwebd # systemctl enable pmwebd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Open firewall port to allow access to the PCP web service:
firewall-cmd --add-port=44323/tcp firewall-cmd --permanent --add-port=44323/tcp
# firewall-cmd --add-port=44323/tcp # firewall-cmd --permanent --add-port=44323/tcp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3. Verifying PCP Configuration Copiar o linkLink copiado para a área de transferência!
To verify PCP is configured correctly, and services are active, run the following command:
pcp
# pcp
This outputs a summary of the active PCP configuration.
Example output from the pcp
command:
In this example, both the Performance Metrics Collector Daemon (pmcd), and the Performance Metrics Web Daemon (pmwebd) services are running. It also confirms the PMDAs which are collecting metrics. Finally, it lists the currently actively archive file, in which pmlogger
is storing metrics.