美文网首页ceph
CEPH 打开Grafana+prometheus实时监控

CEPH 打开Grafana+prometheus实时监控

作者: ming416 | 来源:发表于2019-03-19 10:50 被阅读0次

在测试环境搞了一个nautilus 14.1.1版本,本想打开新的dashboardv2
奈何在module里面没有发现dashboard。还是等官方出新版本文档。


image.png

但是也不能一直用ceph -s 来查看,故用老规则grafana+prometheus来临时监控下。至少可以看个页面

准备环境
1:安装grafana

 wget   https://dl.grafana.com/oss/release/grafana-6.0.1-1.x86_64.rpm
 yum localinstall grafana-6.0.1-1.x86_64.rpm
 systemctl start grafana-server

2: 安装prometheus

wget https://github.com/prometheus/prometheus/releases/download/v2.8.0/prometheus-2.8.0.linux-amd64.tar.gz
tar xvzf prometheus-2.8.0.linux-amd64.tar.gz
ln -s  prometheus-2.8.0.linux-amd64 /usr/local/prometheus

vi  /usr/lib/systemd/system/prometheus.service

[unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target

[Service]
Restart=on-failure
WorkingDirectory=/usr/local/prometheus/
ExecStart=/usr/local/prometheus/prometheus
-config.file=/usr/local/prometheus/prometheus.yml

[Install]
WantedBy=multi-user.target

vi /usr/local/prometheus/prometheus.yml

        - job_name: 'prometheus'                          
          static_configs:                          
          - targets: ['localhost:9090']        
        - job_name: 'ceph'                         
          static_configs:                          
            - targets: ['localhost:9283']       
        - job_name: 'node-exporter'                
          static_configs:                          
            - targets: ['localhost:9100']      

  systemctl start promethues

3: 安装node-exporter

   wget https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz
  tar xvzf node_exporter-0.17.0.linux-amd64.tar.gz
  ln -s  node_exporter-0.17.0.linux-amd64 /usr/local/node_exporter

   vi  /usr/lib/systemd/system/node_exporter.service
  
           [unit]
           Description=Node Exporter Server
           Documentation=https://prometheus.io/docs/guides/node-exporter/
           After=network.target
           
           [Service]
           Restart=on-failure
           WorkingDirectory=/usr/local/node_exporter/
           ExecStart=/usr/local/node_exporter/node_exporter
           
           [Install]
           WantedBy=multi-user.target         


     systemctl start node_exporter

3: 开启ceph-prometheus

         ceph mgr module enable prometheus

4:安装 influxdb

 1、InfluxDB安装
  将InfluxDB加入yum源
  cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
  [influxdb]
  name = InfluxDB Repository - RHEL \$releasever
  baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
  enabled = 1
  gpgcheck = 1
  gpgkey = https://repos.influxdata.com/influxdb.key
  EOF
  安装
  #安装
  sudo yum install -y influxdb
  2、启动InfluxDB并设置为开机启动
  
  #启动
  sudo systemctl start influxdb
  
  #配置开机启动
  sudo systemctl enable influxdb
  3、防火墙配置
  #开放端口
  firewall-cmd --add-port=8086/tcp --permanent
  
  #重载防火墙配置
  firewall-cmd --reload
  4、InfluxDB shell命令测试
  启动cli命令
  #通过influx命令进入cli命令行
  influx
  Connected to http://localhost:8086 version 1.4.2
  InfluxDB shell version: 1.4.2
  >
  查看用户
  SHOW USERS

5: grafana 添加 prometheus

image.png

6:添加grafana dashboard

image.png

相关文章

网友评论

    本文标题:CEPH 打开Grafana+prometheus实时监控

    本文链接:https://www.haomeiwen.com/subject/lzgwmqtx.html