On this page:
Install the following components which constitute the monitoring node:
- InfluxDB - time-series database for collecting the metric data
- Grafana - dashboard visualization layer
- Jmxtrans - Collector to retrieve JMX metrics from remote hosts
Install and configure InfluxDB
- Install InfluxDB on the monitoring node:
Create /etc/yum.repos.d/influxdb.repo with the following:
[influxdb] name = InfluxDB Repository - RHEL $releasever baseurl = https://repos.influxdata.com/rhel/$releasever/$basearch/stable enabled = 1 gpgcheck = 1 gpgkey = https://repos.influxdata.com/influxdb.key
Install with the command:
sudo yum install influxdb
- Configuration file is located in /etc/influxdb/influxdb.conf
Locate the section entitled "[[graphite]]"
Set enabled = true
In the templates section, create the following:
templates = [ "*.org.apache.* host.measurement*" , "*.*.org.apache.* host.host.measurement*" , "*.*.*.org.apache.* host.host.host.measurement*" , "*.jvm.* host.measurement*", "*.*.jvm.* host.host.measurement*", "*.*.*.jvm.* host.host.host.measurement*", ]
- Open ports 2003 and 8086 on the Linux firewall
Create a file named /etc/firewalld/services/influxdb.xml with the following contents:
<?xml version="1.0" encoding="utf-8"?> <service version="1.0"> <short>influxdb</short> <description>InfluxDB</description> <port port="8086" protocol="tcp"/> <port port="2003" protocol="tcp"/> </service>
Activate the firewall rule via the command:
sudo firewall-cmd --permanent --zone=$FWZONE --add-service=influxdb
where $FWZONE is the firewall zone this rule applies to.
You can check this active firewall rule by issuing the command:sudo firewall-cmd --list-all
Enable the InfluxDB service for startup via the command:
sudo systemctl enable influxdb.service
Start the InfluxDB via the command:
sudo systemctl start influxdb
Create the collection databases with a 35-day retention policy:
sudo influx -execute "CREATE DATABASE graphite with duration 35d" sudo influx -execute "CREATE DATABASE telegraf with duration 35d" sudo influx -execute "CREATE DATABASE twcloud with duration 35d" sudo influx -execute "CREATE DATABASE webapp with duration 35d"
Install and configure Grafana
To install Grafana on the monitoring node:
Install with the command
sudo yum install -y https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.1-1.x86_64.rpm
- Open ports 3000 on the Linux firewall
Create a file named /etc/firewalld/services/grafana.xml with the following contents:
<?xml version="1.0" encoding="utf-8"?> <service version="1.0"> <short>grafana</short> <description>Grafana</description> <port port="3000" protocol="tcp"/> </service>
Activate the firewall rule via the command:
sudo firewall-cmd --permanent --zone=$FWZONE --add-service=grafana
where $FWZONE is the firewall zone this rule applies to.
You can check the active firewall rule by issuing this commandsudo firewall-cmd --list-all
Reload the firewall rules via the command:
sudo firewall-cmd --reload
Enable the service on startup via the command:
sudo systemctl enable grafana-server
Start the Grafana service via the command:
sudo systemctl start grafana-server
Install and configure Jmxtrans
To install Jmxtrans on the monitoring node:
Install with the command:
sudo yum -y install http://central.maven.org/maven2/org/jmxtrans/jmxtrans/270/jmxtrans-270.rpm
Delete the Jmxtrans System V service autostart:
chkconfig --del jmxtrans and remove the System V startup script rm -f /etc/init.d/jmxtrans
Create a configuration file in /var/lib/jmxtrans for each TWCloud node. We recommend naming them twcloud-hostname.json where hostname is the hostname of the TWCloud node.
{ "servers":[ { "port":"2468", "host":"IP_ADDRESS", "queries":[ { "obj":"java.lang:type=Memory", "attr":[ "HeapMemoryUsage", "NonHeapMemoryUsage" ], "resultAlias":"jvmMemory", "outputWriters":[ { "@class":"com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory", "url":"http://127.0.0.1:8086/", "username":"admin", "password":"admin", "database":"twcloud", "tags":{ "host":"HOST_NAME" } } ] }, { "obj":"java.lang:type=GarbageCollector,*", "attr":[ "CollectionCount", "CollectionTime" ], "resultAlias":"jvmGC", "outputWriters":[ { "@class":"com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory", "url":"http://127.0.0.1:8086/", "username":"admin", "password":"admin", "database":"twcloud", "tags":{ "host":"HOST_NAME" } } ] }, { "obj":"TWCloud:type=Metrics,item1=Client,*", "attr":[ "Count", "Value", "50thPercentile", "99thPercentile" ], "resultAlias":"twc", "outputWriters":[ { "@class":"com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory", "url":"http://127.0.0.1:8086/", "username":"admin", "password":"admin", "database":"twcloud", "tags":{ "host":"HOST_NAME" } } ] }, { "obj":"TWCloud:type=Metrics,item1=Persistence,*", "attr":[ "Count", "Value", "50thPercentile", "99thPercentile" ], "resultAlias":"twc", "outputWriters":[ { "@class":"com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory", "url":"http://127.0.0.1:8086/", "username":"admin", "password":"admin", "database":"twcloud", "tags":{ "host":"HOST_NAME" } } ] }, { "obj":"TWCloud:type=Metrics,item1=ThreadPools,*", "attr":[ "Count", "Value", "50thPercentile", "99thPercentile" ], "resultAlias":"twc", "outputWriters":[ { "@class":"com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory", "url":"http://127.0.0.1:8086/", "username":"admin", "password":"admin", "database":"twcloud", "tags":{ "host":"HOST_NAME" } } ] } ] } ] }