Prometheus_server安装
cd /opt wget https://git.jiangjiyue.com/jiangjiyue/file/raw/branch/master/prometheus/prometheus-2.5.0.linux-amd64.tar.gz
tar zxvf prometheus-2.5.0.linux-amd64.tar.gz
mv prometheus-2.5.0.linux-amd64 /usr/local/prometheus
cd /usr/local/prometheusx
./prometheus --config.file="/usr/local/prometheus/prometheus.yml" &
ss -naltp |grep 9090
地址:ip+9090
Prometheus_server+agent+mysql安装
linux客户端
下载并解压
cd /opt
wget https://git.jiangjiyue.com/jiangjiyue/file/raw/branch/master/prometheus/node_exporter-0.16.0.linux-amd64.tar.gz
tar zxvf node_exporter-0.16.0.linux-amd64.tar.gz
mv node_exporter-0.16.0.linux-amd64/ /usr/local/node_exporter
#启动
nohup /usr/local/node_exporter/node_exporter &
#检查端口
ss -naltp |grep 9100
server端添加信息
vim /usr/local/prometheus/prometheus.yml

  • job_name: ‘客户端hostname’
    static_configs:
    • targets: [‘客户端ip:9100’]
      添加后到server-Web界面查看是否成功
      Status—>Targets
      Prometheus_server+agent+mysql安装
      mysql客户端
      下载并解压
      cd /opt
      wget https://git.jiangjiyue.com/jiangjiyue/file/raw/branch/master/prometheus/mysqld_exporter-0.11.0.linux-amd64.tar.gz
      tar zxvf mysqld_exporter-0.11.0.linux-amd64.tar.gz
      mv mysqld_exporter-0.11.0.linux-amd64 /usr/local/mysqld_exporter
      数据库添加账号
      grant select,replication client,process ON . to ‘admin’@‘localhost’ identified by ‘password’;
      flush privileges;
      在组件中配置mysql信息
      vim /usr/local/mysqld_exporter/.my.cnf
      [client]
      user=admin
      password=password
      #启动
      nohup /usr/local/mysqld_exporter/mysqld_exporter --config.my-cnf=/usr/local/mysqld_exporter/.my.cnf
      #检查端口
      ss -naltp |grep 9104
      server端添加信息
      vim /usr/local/prometheus/prometheus.yml
  • job_name: ‘客户端hostname’
    static_configs:
    • targets: [‘客户端ip:9104’]

相关文章: