支持软件 go、Prometheus、grafana
安装go环境
[root@server9 ~]# tar -C /usr/local/ -xvf go1.8.3.linux-amd64.tar.gz
添加环境变量
[root@server9 ~]# vim /etc/profile
export PATH=$PATH:/usr/local/go/bin
[root@server9 ~]# source /etc/profile
查看版本
[root@server9 ~]# go version
go version go1.8.3 linux/amd64
安装Prometheus
[root@server9 ~]# tar -C /usr/local/ -xvf prometheus-2.13.0.linux-amd64.tar.gz
prometheus-2.13.0.linux-amd64/
prometheus-2.13.0.linux-amd64/NOTICE
prometheus-2.13.0.linux-amd64/promtool
prometheus-2.13.0.linux-amd64/consoles/
prometheus-2.13.0.linux-amd64/consoles/prometheus.html
prometheus-2.13.0.linux-amd64/consoles/node-overview.html
prometheus-2.13.0.linux-amd64/consoles/node-cpu.html
prometheus-2.13.0.linux-amd64/consoles/node.html
prometheus-2.13.0.linux-amd64/consoles/index.html.example
prometheus-2.13.0.linux-amd64/consoles/prometheus-overview.html
prometheus-2.13.0.linux-amd64/consoles/node-disk.html
prometheus-2.13.0.linux-amd64/LICENSE
prometheus-2.13.0.linux-amd64/console_libraries/
prometheus-2.13.0.linux-amd64/console_libraries/prom.lib
prometheus-2.13.0.linux-amd64/console_libraries/menu.lib
prometheus-2.13.0.linux-amd64/tsdb
prometheus-2.13.0.linux-amd64/prometheus.yml
prometheus-2.13.0.linux-amd64/prometheus
制作软链接
[root@server9 ~]# ln -sv /usr/local/prometheus-2.13.0.linux-amd64/ /usr/local/Prometheus
‘/usr/local/Prometheus’ -> ‘/usr/local/prometheus-2.13.0.linux-amd64/’
运行Prometheus
[root@server9 ~]# /usr/local/Prometheus/prometheus --config.file=/usr/local/Prometheus/prometheus.yml &
测试访问http://172.25.3.9:9090
Prometheus界面相对简单,因此使用 grafana,使界面酷炫
安装grafana
[root@server9 ~]# rpm -ivh --nodeps grafana-5.4.2-1.x86_64.rpm
warning: grafana-5.4.2-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:grafana-5.4.2-1 ################################# [100%]
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server.service
### You can start grafana-server by executing
sudo /bin/systemctl start grafana-server.service
POSTTRANS: Running script
启动grafana
[root@server9 ~]# sudo /bin/systemctl daemon-reload
[root@server9 ~]# sudo /bin/systemctl enable grafana-server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /usr/lib/systemd/system/grafana-server.service.
[root@server9 ~]# sudo /bin/systemctl start grafana-server.service
[root@server9 ~]# sudo /bin/systemctl start grafana-server.service
测试访问http://172.25.3.9:3000
添加Prometheus
霍,事故现场。。。。。。。