Installation and Deployment
This chapter provides a step-by-step guide to installing and deploying CPDS.
Installing CPDS
This section covers the steps to install CPDS components.
Install cpds-agent.
cpds-agent gathers raw data from nodes and can be installed independently on multiple nodes.
shellyum install cpds-agent
Install cpds-detector.
shellyum install cpds-detector
Install cpds-analyzer.
shellyum install cpds-analyzer
Install cpds-dashboard.
shellyum install cpds-dashboard
Install Cpds.
shellyum install Cpds
Deployment of CPDS
This section explains the configuration and deployment of CPDS.
Configuration Overview
cpds-agent Configuration
cpds-agent collects node network information by sending ICMP packets to a specified IP address. The net_diagnostic_dest
field must specify a reachable IP address, not the local node IP address. You are advised to set the master node IP address on worker nodes and any worker node IP address on the master.
vim /etc/cpds/agent/config.json
{
"expose_port":"20001", # Port to listen on
"log_cfg_file": "/etc/cpds/agent/log.conf",
"net_diagnostic_dest": "192.30.25.18" # Destination IP address for ICMP packets
}
Prometheus Configuration
CPDS uses Prometheus to collect raw data generated by cpds-agent. cpds-agent opens port 20001 by default. Edit the Prometheus configuration file to connect to cpds-agent for data collection.
vim /etc/prometheus/prometheus.yml
global:
scrape_interval: 2s
evaluation_interval: 3s
scrape_configs:
- job_name: "cpds"
static_configs:
- targets: ["cpds-agent1:port","cpds-agent2:port","..."] # IP addresses and ports of deployed cpds-agent instances
cpds-detector Configuration
vim /etc/cpds/detector/config.yml
generic:
bindAddress: "127.0.0.1" # Address to listen on
port: 19091 # Port to listen on
database:
host: "127.0.0.1" # Database IP address
port: 3306 # Database port
username: root # Database username
password: root # Database password
maxOpenConnections: 123 # Maximum number of connections
prometheus:
host: "127.0.0.1" # Detector IP address
port: 9090 # Prometheus port
log:
fileName: "/var/log/cpds/cpds-detector/cpds-detector.log"
level: "warn"
maxAge: 15
maxBackups: 100
maxSize: 100
localTime: true
compress: true
cpds-analyzer Configuration
vim /etc/cpds/analyzer/config.yml
generic:
bindAddress: "127.0.0.1" # Address to listen on
port: 19091 # Port to listen on
database:
host: "127.0.0.1" # Database IP address
port: 3306 # Database port
username: root # Database username
password: root # Database password
maxOpenConnections: 123 # Maximum number of connections
detector:
host: "127.0.0.1" # Detector IP address
port: 19092 # Detector port
log:
fileName: "/var/log/cpds/cpds-analyzer/cpds-analyzer.log"
level: "warn"
maxAge: 15
maxBackups: 100
maxSize: 100
localTime: true
cpds-dashboard Configuration
vim /etc/nginx/conf.d/cpds-ui.conf
server {
listen 10119;
location / {
root /etc/cpds/cpds-ui/;
index index.html index.htm;
}
location /api/ {
proxy_pass http://127.0.0.1:19091; # Backend analyzer IP address and port
}
location /websocket/ {
proxy_pass http://127.0.0.1:19091; # Backend analyzer IP address and port
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto http;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
Starting CPDS
This section outlines the steps to start CPDS.
Disabling the Firewall
systemctl stop firewalld
systemctl disable firewalld
Set the SELINUX status to disabled
in the /etc/selinux/config file.
SELINUX=disabled
Restart the system to apply the changes.
Initializing the Database
Start the database service.
shellsystemctl start mariadb.service systemctl enable mariadb.service
Initialize the database with root privileges.
shell/usr/bin/mysql_secure_installation
During the process, you will be prompted to enter the root user password for the database. If no password is set, press Enter and follow the prompts to configure the settings.
Configure database connection permissions.
shellmysql -u root -p
Enter the password set in the previous step when prompted.
shellGRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
Replace
username
with the database username andpassword
with the corresponding password.For example:
shellmysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5 Server version: 10.5.16-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; Query OK, 0 rows affected (0.014 sec)
Starting the Service
systemctl start Cpds.service
systemctl enable Cpds.service
Start cpds-agent on all nodes.
systemctl start cpds-agent
systemctl enable cpds-agent
Accessing the Frontend Management Platform
Once the services are running, open a browser and navigate to http://localhost:10119 to access the frontend management platform.