cd /opt
ln -sf prometheus-2.43.0.linux-amd64/ prometheus
cd prometheus
./promtool check config prometheus.yml # 配置文件语法校验
cd /opt/prometheus
vim prometheus.yml # [部分]
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["192.168.88.80:9090"] # 注意修改localhost为 prometheus服务器IP
cd /opt/prometheus
./prometheus --config.file=prometheus.yml &
ps -ef|grep prome
prometheus启动选项:
--config.file # 指明prometheus的配置文件路径
--web.enable-lifecycle # 指明prometheus配置更改后可以进行热加载
--storage.tsdb.path # 指明监控数据存储路径
--storage.tsdb.retention # 指明数据保留时间
vim /etc/rc.d/rc.local
chmod +x rc.local
191、192操作:
ln -sf node_exporter-1.5.0.linux-amd64/ node_exporter
nohup /opt/node_exporter/node_exporter &
vi /etc/rc.d/rc.local
nohup /opt/node_exporter/node_exporter &
chmod +x /etc/rc.d/rc.local
访问:
192.168.88.80:9100/metrics
192.168.88.80操作:
tar -xf dameng_exporter_v1.1.6_linux_amd64.tar.gz -C /opt/dmexporter
cd /opt/
CREATE user export01 IDENTIFIED by Dameng123;
ALTER user export01 IDENTIFIED BY Dameng123;
alter user export01 DEFAULT TABLESPACE export_tbs DEFAULT INDEX TABLESPACE export_tbs;
grant public,resource,soi,svi,vti to export01;
vim /opt/dmexporter/dameng_exporter.config
dbUser=export01
dbPwd=Dameng123
chmod +x dameng_exporter_linux_amd64
ps -ef|grep exporter
vi /etc/rc.d/rc.local
nohup /opt/dmexporter/dameng_exporter_linux_amd64 >> /var/log/dm_exporter.log 2>&1 &
chmod +x /etc/rc.d/rc.local
vim /opt/prometheus/prometheus.yml
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["192.168.88.80:9090"] #注意,如果要监控主备集群,则这里的实例可以写多个
- job_name: "dameng_80"
static_configs:
- targets: ["192.168.88.80:9200"] #注意,如果要监控主备集群,则这里的实例可以写多个
labels:
cluster_name: 'dameng_single_instance'
nohup /opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --web.enable-lifecycle --storage.tsdb.path=/opt/prometheus/data --storage.tsdb.retention=60d >> /var/log/prometheus.log 2>&1 &
systemctl start grafana-server
systemctl enable grafana-server
http://192.168.88.80:3000/login #初始密码admin/admin,按提示修改密码
#导入prometheus数据源
#导入达梦监控面板的json文件
文章
阅读量
获赞