-
Notifications
You must be signed in to change notification settings - Fork 0
/
Prometheus
65 lines (44 loc) · 2.31 KB
/
Prometheus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Prometheus
白盒监控
黑盒监控
Exporter 出口
#1下载prometheus,https://prometheus.io/download/,获得prometheus-2.25.2.linux-amd64.tar.gz
#2 在虚拟机上解压后,进入prometheus目录,配置使用默认
# 启动
## 直接启动:./prometheus --config.file=prometheus.yml
## 后台启动:/data/prometheus/prometheus; nohup ./prometheus --config.file=prometheus.yml > prometheus.log 2>&1 &
#
#将启动命令设置到/etc/rc.d/rc.local中,开机自启动
echo 'cd /sysadmin/manager/prometheus/node_exporter ; nohup ./node_exporter > /dev/null 2>&1 & ' >> /etc/rc.d/rc.local
[ sysadmin:~/data/prometheus/prometheus ]# netstat -antulp | head -3;netstat -antulp | grep pro
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp6 0 0 :::9090 :::* LISTEN 75922/./prometheus
tcp6 0 0 192.168.3.50:9090 192.168.3.6:63636 ESTABLISHED 75922/./prometheus
tcp6 0 0 192.168.3.50:9090 192.168.3.6:63639 ESTABLISHED 75922/./prometheus
tcp6 0 0 ::1:37224 ::1:9090 ESTABLISHED 75922/./prometheus
tcp6 0 0 192.168.3.50:9090 192.168.3.6:63637 ESTABLISHED 75922/./prometheus
tcp6 0 0 ::1:9090 ::1:37224 ESTABLISHED 75922/./prometheus
#grafana 安装
wget -O /opt/tgzs/grafana-7.5.1-1.x86_64.rpm https://dl.grafana.com/oss/release/grafana-7.5.1-1.x86_64.rpm
sudo yum install grafana-7.5.1-1.x86_64.rpm
[root@prome-master01 ~]# vim /etc/grafana/grafana.ini
type = mysql
host = 127.0.0.1:3306
name = grafana
user = root
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
password = root
systemctl start grafana-server
systemctl enable grafana-server
systemctl status grafana-server
查看日志 有无报错
tail -f /var/log/grafana/grafana.log
默认 用户密码 :admin/admin
http://192.168.3.50:3000/?orgId=1
cd /root/data/prometheus/node_exporter;
systemctl daemon-reload
systemctl start node_exporter
systemctl status node_exporter
systemctl enable node_exporter