安装go环境

  1. yum install golang -y
  2. yum install librados2-devel librbd1-devel -y

修改环境变量

  1. export GOROOT=/usr/lib/golang
  2. export GOBIN=$GOROOT/bin
  3. export GOPATH=/home/golang
  4. export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

安装prometheus

  1. wget https://github.com/prometheus/prometheus/releases/download/v2.6.0/prometheus-2.6.0.linux-amd64.tar.gz
  2. tar -zxvf prometheus-2.0.0.linux-amd64.tar.gz
  3. cd prometheus-2.0.0.linux-amd64
  4. # 修改 prometheus.yml 增加 job
  5. - job_name: 'ocata-ceph'
  6. static_configs:
  7. - targets: ['192.168.1.210:9128']

安装ceph_exporter

  1. go get -u github.com/digitalocean/ceph_exporter
  2. cd /usr/lib/golang/bin/
  3. # 启动,然后去9128端口去验证是否安装成功
  4. nohup ./ceph_exporter &
  5. # 开机启动
  6. echo "/usr/local/golang/bin/ceph_exporter" >> /etc/rc.local
  7. # 在Prometheus界面,选择 Status->Targets 显示ceph exporter已经可用

安装配置grafana

  1. wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.3-1.x86_64.rpm
  2. yum install grafana-4.6.3-1.x86_64.rpm
  3. systemctl start grafana-server
  1. ceph_exporter/vendor/github.com/ceph/go-ceph/rados/conn.go:5:29: fatal error: rados/librados.h: No such file or directory