长期支持版本

    安装与部署

    本章介绍如何安装和部署CPDS。

    安装CPDS

    本节介绍CPDS的安装方法。

    安装cpds-agent。

    cpds-agent采集节点原始数据,可在多个节点上单独安装部署。

    yum install cpds-agent
    

    安装cpds-detector

    yum install cpds-detector
    

    安装cpds-analyzer

    yum install cpds-analyzer
    

    安装cpds-dashboard

    yum install cpds-dashboard
    

    安装Cpds

    yum install Cpds
    

    部署CPDS

    本节介绍CPDS的配置部署。

    配置介绍

    cpds-agent配置

    cpds-agent采集节点网络信息是采用向指定ip发送icmp包的方式,即"net_diagnostic_dest"需要指定可连接的ip地址,不可指定本节点ip。建议节点指定master的ip,master指定任意一节点ip。

    vim /etc/cpds/agent/config.json
    
    {
        "expose_port":"20001", # 需要监听的端口
        "log_cfg_file": "/etc/cpds/agent/log.conf",
        "net_diagnostic_dest": "192.30.25.18" # 发送icmp包的目的ip
    }
    

    prometheus配置

    CPDS 使用prometheus采集cpds-agent产生的原始数据。cpds-agent默认开放20001端口,需编辑prometheus配置文件,连接至cpds-agent以采集数据。

    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","..."] # 填入已部署cpds-agent的ip和端口号
    

    cpds-detector配置

    vim /etc/cpds/detector/config.yml
    
    generic:
      bindAddress: "127.0.0.1" # 需要监听的地址
      port: 19091 # 需要监听的端口
    
    database:
      host: "127.0.0.1" # 数据库 ip 地址
      port: 3306 # 数据库端口号
      username: root # 数据库用户名
      password: root # 数据库密码
      maxOpenConnections: 123 # 最大连接数
    
    prometheus:
      host: "127.0.0.1" #detector ip 地址
      port: 9090 #prometheus 端口号
    
    log:
      fileName: "/var/log/cpds/cpds-detector/cpds-detector.log"
      level: "warn"
      maxAge: 15
      maxBackups: 100
      maxSize: 100
      localTime: true
      compress: true
    

    cpds-analyzer配置

    vim /etc/cpds/analyzer/config.yml
    
    generic:
      bindAddress: "127.0.0.1" # 需要监听的地址
      port: 19091 # 需要监听的端口
    
    database:
      host: "127.0.0.1" # 数据库 ip 地址
      port: 3306 # 数据库端口号
      username: root # 数据库用户名
      password: root # 数据库密码
      maxOpenConnections: 123 # 最大连接数
    
    detector:
      host: "127.0.0.1" #detector ip 地址
      port: 19092 #detector 端口号
    
    log:
      fileName: "/var/log/cpds/cpds-analyzer/cpds-analyzer.log"
      level: "warn"
      maxAge: 15
      maxBackups: 100
      maxSize: 100
      localTime: true
    

    cpds-dashboard配置

    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; # 后端 analyzer 的 ip 和端口
      }
    
      location /websocket/ {
        proxy_pass http://127.0.0.1:19091; # 后端 analyzer 的 ip 和端口
        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";
      }
    }
    

    启动CPDS

    本节介绍CPDS的启动方法。

    关闭防火墙

    systemctl stop firewalld
    systemctl disable firewalld
    

    修改/etc/selinux/config文件中SELINUX状态为disabled。

    SELINUX=disabled
    

    再重启系统。

    初始化数据库

    1. 启动数据库
    systemctl start mariadb.service
    systemctl enable mariadb.service
    
    1. 在root权限下初始化数据库
    /usr/bin/mysql_secure_installation
    

    命令执行过程中需要输入数据库的root设置的密码,若没有密码则直接按“Enter”。然后根据提示及实际情况进行设置。

    1. 设置数据库连接权限
    mysql -u root -p
    

    命令执行后提示输入密码。密码为2中设置的密码。

    GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
    

    其中username为数据库用户名,password为该用户的密码。

    例如:

    mysql -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)
    

    启动服务

    systemctl start Cpds.service
    systemctl enable Cpds.service
    

    启动各节点上的cpds-agent。

    systemctl start cpds-agent
    systemctl enable cpds-agent
    

    访问前端管理平台

    上述服务启动成功后,打开浏览器,在浏览器导航栏中输入 http://localhost:10119访问前端管理平台。

    文档捉虫

    “有虫”文档片段

    问题描述

    提交类型 issue

    有点复杂...

    找人问问吧。

    PR

    小问题,全程线上修改...

    一键搞定!

    问题类型
    规范和低错类

    ● 错别字或拼写错误;标点符号使用错误;

    ● 链接错误、空单元格、格式错误;

    ● 英文中包含中文字符;

    ● 界面和描述不一致,但不影响操作;

    ● 表述不通顺,但不影响理解;

    ● 版本号不匹配:如软件包名称、界面版本号;

    易用性

    ● 关键步骤错误或缺失,无法指导用户完成任务;

    ● 缺少必要的前提条件、注意事项等;

    ● 图形、表格、文字等晦涩难懂;

    ● 逻辑不清晰,该分类、分项、分步骤的没有给出;

    正确性

    ● 技术原理、功能、规格等描述和软件不一致,存在错误;

    ● 原理图、架构图等存在错误;

    ● 命令、命令参数等错误;

    ● 代码片段错误;

    ● 命令无法完成对应功能;

    ● 界面错误,无法指导操作;

    风险提示

    ● 对重要数据或系统存在风险的操作,缺少安全提示;

    内容合规

    ● 违反法律法规,涉及政治、领土主权等敏感词;

    ● 内容侵权;

    您对文档的总体满意度

    非常不满意
    非常满意
    提交
    根据您的反馈,会自动生成issue模板。您只需点击按钮,创建issue即可。
    文档捉虫
    编组 3备份