标签:usr node uml release 使用 col 内容 gil ext
prometheus存储的是时序数据,即按相同时序(相同名称和标签),以时间维度存储连续的数据的集合。
一、架构图
二、部署
1 mkdir /opt/monitor;cd /opt/monitor 2 unzip prometheus.zip ./ 3 tar zxf prometheus-2.11.1.linux-amd64.tar.gz 4 mv prometheus-2.11.1.linux-amd64 prometheus-2.11.1
1 vim /usr/lib/systemd/system/prometheus-server.service 2 3 [Unit] 4 Description=prometheus-server 5 After=network.target 6 7 [Service] 8 Type=simple 9 User=root 10 ExecStart=/opt/monitor/prometheus/prometheus-2.11.1/prometheus --config.file=/opt/monitor/prometheus/prometheus-2.11.1/prometheus.yml 11 Restart=on-failure 12 13 [Install] 14 WantedBy=multi-user.target
1 systemctl start prometheus-server 2 systemctl enable prometheus-server
1 cd /opt/monitor/prometheus 2 unzip prometheus.zip ./ 3 tar zxf node_exporter-0.18.1.linux-amd64.tar.gz 4 mv node_exporter-0.18.1.linux-amd64 node_exporter-0.18.1
1 vim /usr/lib/systemd/system/prometheus-node.service 2 3 [Unit] 4 Description=prometheus-node 5 After=network.target 6 7 [Service] 8 Type=simple 9 User=root 10 ExecStart=/opt/monitor/prometheus/node_exporter-0.18.1/node_exporter 11 Restart=on-failure 12 13 [Install] 14 WantedBy=multi-user.target
1 systemctl start prometheus-node 2 systemctl enable prometheus-node
1 wget https://dl.grafana.com/oss/release/grafana-6.2.5-1.x86_64.rpm 2 yum localinstall grafana-6.2.5-1.x86_64.rpm -y
1 systemctl start/stop/restart/enable grafana-server
1 ------------------------------------- 2 温馨提示: 3 忘记管理员密码: 4 找到grafana.db文件,一般在/var/lib/grafana/grafana.db 5 find / -name "grafana.db" 6 7 打开数据库 8 sqlite3 /var/lib/grafana/grafana.db 9 10 重置admin用户的密码为默认admin 11 update user set password = ‘59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6‘, salt = ‘F3FAxVm33R‘ where login = ‘admin‘; 12 13 重启grafana 14 -------------------------------------
三、监控
1 - job_name: ‘artifactory‘ 2 static_configs: 3 - targets: [‘IP1:9100‘,‘IP2:9100‘]
1 systemctl restart prometheus-server
2. 配置Artifactorty JVM监控
1 vim /opt/monitor/prometheus/jmx_config.yaml 2 3 --- 4 lowercaseOutputLabelNames: true 5 lowercaseOutputName: true 6 7 rules: 8 - pattern: ".*"
1 vim $ARTIFACTORY_HOME/tomcat/bin/catalina.sh 2 添加: 3 JAVA_OPTS="$JAVA_OPTS -javaagent:/opt/monitor/prometheus/jmx_prometheus_javaagent-0.12.0.jar=30013:/opt/monitor/prometheus/jmx_config.yaml"
1 - job_name: ‘Artifactory-jmx‘ 2 static_configs: 3 - targets: [‘IP1:30013‘,‘IP2:30013‘]
9、Artifactory-JMX监控展示
10、自定义artifactory指标监控
完成!
1 ----------------------------------- 2 温馨提示: 3 如果导入模板后无数据,需要填写正确的prometheus metric 4 比如编辑Query: 5 os_available_processors{job="$job",instance="$instance"} 6 改为prometheus metric中命名的即可 7 java_lang_operatingsystem_availableprocessors{job="$job",instance="$instance"} 8 -----------------------------------
标签:usr node uml release 使用 col 内容 gil ext
原文地址:https://www.cnblogs.com/gyz0517/p/12240394.html