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

  1. Install InfluxDB on the monitoring node:
    1. 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
    2. Install with the command: 

      sudo yum install influxdb
  2. Configuration file is located in /etc/influxdb/influxdb.conf
    1. Locate the section entitled "[[graphite]]"

      1. Set enabled = true

      2. 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*",
                        ] 
    2. Open ports 2003 and 8086 on the Linux firewall
      1. 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>
      2. 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
    3. Enable the InfluxDB service for startup via the command:

      sudo systemctl enable influxdb.service
    4. Start the InfluxDB via the command:

      sudo systemctl start influxdb
    5. 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: 

  1. 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
  2. Open ports 3000 on the Linux firewall
    1. 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>
    2. 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 command
      sudo firewall-cmd --list-all
  3. Reload the firewall rules via the command:

    sudo firewall-cmd --reload
  4. Enable the service on startup via the command:

    sudo systemctl enable grafana-server
  5. Start the Grafana service via the command:

    sudo systemctl start grafana-server

Install and configure Jmxtrans

To install Jmxtrans on the monitoring node: 

  1. Install with the command:

    sudo yum -y install  http://central.maven.org/maven2/org/jmxtrans/jmxtrans/270/jmxtrans-270.rpm
  2. Delete the Jmxtrans System V service autostart:

    chkconfig --del jmxtrans
    and remove the System V startup script
    rm -f /etc/init.d/jmxtrans
  3. 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"
                         }
                      }
                   ]
                }
             ]
          }
       ]
    }
    
    
Replace IP_ADDRESS with the IP Address of the TWCloud node. If on the local machine you may use 127.0.0.1. Replace HOST_NAME with the hostname of the TWCloud (as per the command "hostname").