安装go环境
yum install golang -y
yum install librados2-devel librbd1-devel -y
修改环境变量
export GOROOT=/usr/lib/golang
export GOBIN=$GOROOT/bin
export GOPATH=/home/golang
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
安装prometheus
wget https://github.com/prometheus/prometheus/releases/download/v2.6.0/prometheus-2.6.0.linux-amd64.tar.gz
tar -zxvf prometheus-2.0.0.linux-amd64.tar.gz
cd prometheus-2.0.0.linux-amd64
# 修改 prometheus.yml 增加 job
- job_name: 'ocata-ceph'
static_configs:
- targets: ['192.168.1.210:9128']
安装ceph_exporter
go get -u github.com/digitalocean/ceph_exporter
cd /usr/lib/golang/bin/
# 启动,然后去9128端口去验证是否安装成功
nohup ./ceph_exporter &
# 开机启动
echo "/usr/local/golang/bin/ceph_exporter" >> /etc/rc.local
# 在Prometheus界面,选择 Status->Targets 显示ceph exporter已经可用
安装配置grafana
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.3-1.x86_64.rpm
yum install grafana-4.6.3-1.x86_64.rpm
systemctl start grafana-server
ceph_exporter/vendor/github.com/ceph/go-ceph/rados/conn.go:5:29: fatal error: rados/librados.h: No such file or directory