文章目录
Prometheus+Grafana
1、安装grafana
1、配置yum源文件
vim /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
2.通过yum命令安装grafana
yum -y install grafana
3.启动grafana并设为开机自启
systemctl start grafana-server.service
systemctl enable grafana-server.service
2、安装promethus
1、下载安装包,下载地址
https://prometheus.io/download/
2、解压压缩包
tar fvxz prometheus-2.14.0.linux-amd64.tar.gz
3、将解压后的目录改名
mv prometheus-2.14.0.linux-amd64 /opt/prometheus
4、查看promethus版本
/opt/prometheus/prometheus --version
5、配置系统服务启动
cat > /etc/systemd/system/prometheus.service <<EOF
[Unit]
Description=Prometheus Monitoring System
Documentation=Prometheus Monitoring System
[Service]
ExecStart=/opt/prometheus/prometheus \
--config.file /opt/prometheus/prometheus.yml \
--web.listen-address=:9090
[Install]
WantedBy=multi-user.target
EOF
6、加载系统服务
systemctl daemon-reload
7、启动服务和添加开机自启动
systemctl start prometheus
systemctl enable prometheus
3、ceph mgr prometheus插件配置
netstat -nltp | grep mgr 检查端口
curl 127.0.0.1:9283/metrics 测试返回值
4、配置promethus
1、在 scrape_configs: 配置项下添加
vim /opt/prometheus/prometheus.yml
2、重启promethus服务
systemctl restart prometheus
3、检查prometheus服务器中是否添加成功
http://x.x.x.x:9090
5、配置grafana
1、浏览器登录 grafana 管理界面
2、添加data sources
,点击configuration
—> data sources
3、添加dashboard
,点击HOME
—> find dashboard on grafana.com
#更多图表,上grafana上查找
4、搜索ceph的dashboard
5、点击HOME
—> Import dashboard
, 选择合适的dashboard,记录编号
最新评论
# 这只是一个创建远程登录并授权的语句、仅作为记录 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Fit2cloud!' WITH GRANT OPTION;
当MGR集群初始化结束后,需要开启MGR集群自启动(需要有一台节点是自动开启引导) loose-group_replication_start_on_boot = ON #设置节点是否在启动时自动启动 MGR 集群 loose-group_replication_bootstrap_group = ON #设置节点是否作为初始引导节点启动集群
密码:blog.sirliu.com
本内容密码:blog.sirliu.com 最新整理的文章在这里喔:https://blog.sirliu.com/2018/11/shell_lian_xi_ti.html