Artifactory running on the enterprise system platform may have millions of products in the flow every day, with the continuous expansion of the RESEARCH and development team, users slowly increase, the amount of concurrency also increased correspondingly, in order to ensure high availability at the same time, we monitor the artifactory system and application services will be particularly important. So how to achieve system and application monitoring?
This article describes how to monitor the Artifactory base system and application JVM through Prometheus and Grafana. 1. Deploy the Prometheus Server. Download the installation package and decompress it (version 2.11.1 is used as an example). CD /opt/monitor/ Prometheus unzip Prometheus. Zip./ tar ZXF Prometheus -2.11.1.linux-amd64.tar.gz mv Prometheus – 2.11.1. Linux – amd64 Prometheus – 2.11.1
added as a system service vim/usr/lib/systemd/system/Prometheus – server. The service Description = [Unit] Prometheus – server After = network. The target [Service] Type = simple User = root ExecStart = / opt/monitor/Prometheus/Prometheus – 2.11.1 / Prometheus — config. The file = / opt/monitor/Prometheus Prometheus – 2.11.1 / Prometheus. Yml Restart = on – failure [Install] WantedBy=multi-user.target
Start and add systemctl start Prometheus -server systemctl enable Prometheus -server
visit http://ip:9090
Deploying the installation package on the Prometheus Node and decompress the installation package (for example, version 0.18.1) CD /opt/monitor/ Prometheus unzip Prometheus. Zip./ tar ZXF Node_exporter – 0.18.1. Linux – amd64. Tar. Gz mv node_exporter – 0.18.1. Linux – amd64 node_exporter – 0.18.1
added as a system service vim/usr/lib/systemd/system/Prometheus – node. Service [Unit] Description = Prometheus – node After = network. The target
[Service] Type = simple User = root ExecStart = / opt/monitor/Prometheus node_exporter 0.18.1 / node_exporter Restart = on – failure
[Install] WantedBy=multi-user.target
Start and add systemctl start Prometheus -node systemctl enable Prometheus -node
Three, Grafana deployment download the installation package and install for 6.2.5.1 (for example) wget dl.grafana.com/oss/release… Yum localinstall grafana 6.2.5-1. X86_64. RPM – y
start systemctl start/stop/restart/enable grafana – server
Accessing http://IP:3000 The default user name and password are admin and admin
Configuring Prometheus After Prometheus Node is installed on each Artifactory Node, modify /opt/monitor/ Promethes-2.11.1 / promethe. yml. Add:
- job_name: ‘artifactory’
static_configs: – targets: [‘IP1:9100′,’IP2:9100’]
Restart Prometheus -server systemctl restart Prometheus -server
View monitoring status and data query examples
The grafana example is available at grafana.com/dashboards/…
The monitoring status is shown in the following figure
Jmx_Prometheus_JavaAgent-0.12.0. jarRepo1.maven.org/maven2/io/p…Jar package path: / opt/monitor/prometueus jmx_prometheus_javaagent – 0.12.0. Jar add vim configuration file/opt/monitor/Prometheus/jmx_config yaml
lowercaseOutputLabelNames: true lowercaseOutputName: true rules:
- pattern: “.*”
modify Artifactory tomcat configuration file vim ARTIFACTORYHOME/tomcat/bin/catalina. Sh, add: JAVAOPTS = “ARTIFACTORY_HOME/tomcat/bin/catalina. Sh, add: JAVA_OPTS =” ARTIFACTORYHOME/tomcat/bin/catalina. Sh, add: JAVAOPTS=”JAVA_OPTS – javaagent: / opt/monitor/Prometheus jmx_prometheus_javaagent – 0.12.0. Jar = 30013: / opt/monitor/Prometheus/jmx_config yaml. “”
Restart Artifactory systemctl restart Artifactory
modify Prometheus configuration changes/opt/monitor/Prometheus Prometheus – 2.11.1 / Prometheus. Yml, add:
- job_name: ‘Artifactory-jmx’
static_configs: – targets: [‘IP1:30013′,’IP2:30013’]
Restart Prometheus Server
You can use the following template to display monitoring information on Grafana: grafana.com/dashboards/…
Modify the template Settings based on actual conditions. For example, click Dashbord Settings and change the value of $job to artifactory-jmx
Artifactory-JMX Monitoring display