Prometheus Module — Ceph Documentationnode
Prometheus 模塊啓用:linux
[root@node1 ~]# ceph mgr module enable prometheus [root@node1 ~]# ceph mgr services { "dashboard": "https://node1:8443/", "prometheus": "http://node1:9283/" } [root@node1 ~]# netstat -tnlp | grep 9283 tcp6 0 0 :::9283 :::* LISTEN 1507703/ceph-mgr
默認狀況下,模塊將在主機上的全部 IPv4 和 IPv6 地址的端口上接受 HTTP 請求。git
ceph config set mgr mgr/prometheus/server_addr 0.0.0.0 ceph config set mgr mgr/prometheus/server_port 9283
掌握Prometheus 監控思科交換機技能,這篇文章就夠了!-餘生還長,何須慌張-51CTO博客github
(一) Prometheus 監控思科交換機---各中間件安裝部署shell
ceph 各節點部署 node_exporter 程序包作監控json
下載curl
wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz
解壓安裝:tcp
tar -xf node_exporter-0.17.0.linux-amd64.tar.gz -C /usr/local/ cd /usr/local/ ln -sv node_exporter-0.17.0.linux-amd64/ node_exporter
Unit文件:/usr/lib/systemd/system/node_exporter.serviceide
[Unit] After=network.target [Service] EnvironmentFile=-/etc/sysconfig/node_exporter User=ceph ExecStart=/usr/local/node_exporter/node_exporter \ $NODE_EXPORTER_OPTS Restart=on-failure StartLimitInterval=1 RestartSec=3 [Install] WantedBy=multi-user.target
啓動node_exporter:url
systemctl daemon-reload systemctl start node_exporter.service
默認監聽9100端口:
curl localhost:9100/metrics
Prometheus.yml 添加以下內容
- job_name: 'ceph-node' static_configs: - targets: ["192.168.6.160:9100","192.168.6.161:9100","192.168.6.162:9100"] labels: cluster: ceph-cluster - job_name: 'ceph-cluster' honor_labels: true static_configs: - targets: ['192.168.6.160:9283'] labels: cluster: ceph-cluster
重啓 prometheus
systemctl restart prometheus
默認 mgr dashboard 就已經安裝 grafana 的 json文件,導入至 grafana 內便可
[root@node1 ~]# rpm -ql ceph-grafana-dashboards /etc/grafana/dashboards/ceph-dashboard /etc/grafana/dashboards/ceph-dashboard/ceph-cluster.json /etc/grafana/dashboards/ceph-dashboard/cephfs-overview.json /etc/grafana/dashboards/ceph-dashboard/host-details.json /etc/grafana/dashboards/ceph-dashboard/hosts-overview.json /etc/grafana/dashboards/ceph-dashboard/osd-device-details.json /etc/grafana/dashboards/ceph-dashboard/osds-overview.json /etc/grafana/dashboards/ceph-dashboard/pool-detail.json /etc/grafana/dashboards/ceph-dashboard/pool-overview.json /etc/grafana/dashboards/ceph-dashboard/radosgw-detail.json /etc/grafana/dashboards/ceph-dashboard/radosgw-overview.json /etc/grafana/dashboards/ceph-dashboard/rbd-details.json /etc/grafana/dashboards/ceph-dashboard/rbd-overview.json /usr/share/doc/ceph-grafana-dashboards-14.2.16 /usr/share/doc/ceph-grafana-dashboards-14.2.16/README /usr/share/doc/ceph-grafana-dashboards-14.2.16/README.md # grafana 官方 Dashboard 展現示例 https://grafana.com/grafana/dashboards/2842