学习是一个逐步发现自己无知的过程!

Prometheus Grafana监控Ceph集群

Prometheus+Grafana

1、安装grafana

1、配置yum源文件

  1. vim /etc/yum.repos.d/grafana.repo
  2. [grafana]
  3. name=grafana
  4. baseurl=https://packages.grafana.com/oss/rpm
  5. repo_gpgcheck=1
  6. enabled=1
  7. gpgcheck=1
  8. gpgkey=https://packages.grafana.com/gpg.key
  9. sslverify=1
  10. sslcacert=/etc/pki/tls/certs/ca-bundle.crt

2.通过yum命令安装grafana

  1. yum -y install grafana

3.启动grafana并设为开机自启

  1. systemctl start grafana-server.service
  2. systemctl enable grafana-server.service
Prometheus Grafana监控Ceph集群

Prometheus Grafana监控Ceph集群

2、安装promethus

1、下载安装包,下载地址

  1. https://prometheus.io/download/

2、解压压缩包

  1. tar fvxz prometheus-2.14.0.linux-amd64.tar.gz

3、将解压后的目录改名

  1. mv prometheus-2.14.0.linux-amd64 /opt/prometheus

4、查看promethus版本

  1. /opt/prometheus/prometheus --version

5、配置系统服务启动

  1. cat > /etc/systemd/system/prometheus.service <<EOF
  2. [Unit]
  3. Description=Prometheus Monitoring System
  4. Documentation=Prometheus Monitoring System
  5. [Service]
  6. ExecStart=/opt/prometheus/prometheus \
  7. --config.file /opt/prometheus/prometheus.yml \
  8. --web.listen-address=:9090
  9. [Install]
  10. WantedBy=multi-user.target
  11. EOF

6、加载系统服务

  1. systemctl daemon-reload

7、启动服务和添加开机自启动

  1. systemctl start prometheus
  2. systemctl enable prometheus

3、ceph mgr prometheus插件配置

  1. netstat -nltp | grep mgr 检查端口
  2. curl 127.0.0.1:9283/metrics 测试返回值

4、配置promethus

1、在 scrape_configs: 配置项下添加

  1. vim /opt/prometheus/prometheus.yml

2、重启promethus服务

  1. systemctl restart prometheus

3、检查prometheus服务器中是否添加成功

  1. http://x.x.x.x:9090 
Prometheus Grafana监控Ceph集群

Prometheus Grafana监控Ceph集群

5、配置grafana

1、浏览器登录 grafana 管理界面
2、添加data sources,点击configuration —> data sources

3、添加dashboard,点击HOME —> find dashboard on grafana.com

  1. #更多图表,上grafana上查找
Prometheus Grafana监控Ceph集群

Prometheus Grafana监控Ceph集群

Prometheus Grafana监控Ceph集群

Prometheus Grafana监控Ceph集群

4、搜索ceph的dashboard
5、点击HOME —> Import dashboard, 选择合适的dashboard,记录编号

Prometheus Grafana监控Ceph集群

Prometheus Grafana监控Ceph集群


Prometheus Grafana监控Ceph集群

Prometheus Grafana监控Ceph集群

赞(0)
未经允许不得转载:劉大帥 » Prometheus Grafana监控Ceph集群

你的评论可能会一针见血! 抢沙发

登录

找回密码

注册