grafana监控oceanbase-obagent部署

1.Install ob-deploy in obd server(obdserver can be a ocp server)

(1)download newest version of ob-deploy and obagent,upload them to /soft directory

oceanbase-community-stable-el-7-x86_64安装包下载_开源镜像站-阿里云

grafana监控oceanbase-obagent部署_第1张图片

(2) install obdeploy

rpm -ivh ob-deploy-1.6.2-10.el7.x86_64.rpm

2.Install obagent on all observers

su - admin

(1)prepare mirror

su - admin

obd mirror disable remote

cd /soft

obd mirror clone *.rpm

obd mirror list

(2)configure admin user ssh passwordless between obd server and observers,and ensure 8088 and 8089 of observers are not occupied

netstat -an|grep 8088

netstat -an|grep 8089

(3) prepare obagent-only.yaml

download obagent-only-example.yaml from github

obdeploy/obagent-only-example.yaml at master · oceanbase/obdeploy · GitHub

You need modify [servers]/[monitor_password]/[cluster_name]/[cluster_id] and [zone ips]

(4)install obagent

obd cluster deploy only-obagent -c obagent-only.yaml

grafana监控oceanbase-obagent部署_第2张图片

obd cluster list

grafana监控oceanbase-obagent部署_第3张图片

obd cluster start only-obagent

grafana监控oceanbase-obagent部署_第4张图片

obd cluster list

grafana监控oceanbase-obagent部署_第5张图片

(5)check if obagent started successfully

ssh {observerip}

ps -ef|grep obagent

grafana监控oceanbase-obagent部署_第6张图片

(6)check monitoring details

host related:

curl --user admin:root http://{observerip}:8088/metrics/node/host

ob related:

curl --user admin:root http://{observerip}:8088/metrics/ob/basic

(7)if you need reinstall obagent,following commmands below and reinstall(optional)

obd cluster stop only-obagent

obd cluster destroy only-obagent

3.Install and start prometheus(choose the obd server)

(1)download prometheus

Download | Prometheus

(2) install and configure prometheus

groupadd prometheus

useradd -g prometheus prometheus

cd /usr/local

tar -xvf /soft/prometheus-2.35.0.linux-amd64.tar.gz

mv prometheus-2.35.0.linux-amd64 prometheus

cd prometheus/

mv prometheus.yml prometheus.yml.bk

scp root@{observerip}:/home/admin/obagent/conf/prometheus_config/prometheus.yaml .

scp -r root@{observerip}:/home/admin/obagent/conf/prometheus_config/rules .

vi prometheus.yaml

modify localhost:9090 to {your ip}:9090

chown -R prometheus.prometheus /usr/local/prometheus

mkdir -p /home/prometheus/data

chown -R prometheus.prometheus /home/prometheus/data

vi /etc/systemd/system/prometheus.service

[Unit]

Description=prometheus

After=network.target

[Service]

Type=simple

User=prometheus

ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml --storage.tsdb.path=/home/prometheus/data

Restart=on-failure

[Install]

WantedBy=multi-user.target

(3)start prometheus

systemctl enable prometheus.service

systemctl start prometheus.service

(4)check prometheus

http://{your ip}:9090/

grafana监控oceanbase-obagent部署_第7张图片

grafana监控oceanbase-obagent部署_第8张图片

4.configure grafana

(1)download json of ob for grafana

Oceanbase Metrics | Grafana Labs

Host Metrics | Grafana Labs

Obproxy Metrics | Grafana Labs

(2) add new prometheus data source as prometheus and configure url as http://{your ip}:9090/

(3)import json files to grafana and choose data source - prometheus

你可能感兴趣的:(oceanbase,linux,grafana,oceanbase,obagent,prometheus)