Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id874941300
Content column
id874941303
Content block
id874950841

On this page: 

Table of Contents
maxLevel3
minLevel3

Content block
id874941302

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: 

      Code Block
      languagetext
      [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: 

      Code Block
      languagetext
      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:

        Code Block
        languagetext
        	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

        Code Block
        languagetext
        <?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 

        Code Block
        languagetext
        sudo firewall-cmd --permanent --zone=$FWZONE --add-service=influxdb

        where $FWZONE is the firewall zone this rule applies to. 

        Code Block
        languagetext
        titleYou 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 

      Code Block
      languagetext
      sudo systemctl enable influxdb.service
    4. Start the influxDB via the command 

      Code Block
      languagetext
      sudo systemctl start influxdb
    5. Create the collection databases with a 35 day retention policy:

      Code Block
      languagetext
      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

    Code Block
    languagetext
    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

      Code Block
      languagetext
      <?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

      Code Block
      languagetext
      sudo firewall-cmd --permanent --zone=$FWZONE --add-service=grafana

      where $FWZONE is the firewall zone this rule applies to. 

      Code Block
      titleYou can check the active firewall rule by issuing this command
      sudo firewall-cmd --list-all
  3. Reload the firewall rules via the command

    Code Block
    languagetext
    sudo firewall-cmd --reload
  4. Enable the service on startup via the command

    Code Block
    languagetext
    sudo systemctl enable grafana-server
  5. Start the Grafana service via the command

    Code Block
    languagetext
    sudo systemctl start grafana-server

Install and configure Jmxtrans

To install Jmxtrans on the monitoring node: 

  1. Install with the command

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

    Code Block
    languagetext
    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 to name them twcloud-hostname.json where hostname is the hostname of the TWCloud node.

    Code Block
    languagetext
    {
       "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"
                         }
                      }
                   ]
                }
             ]
          }
       ]
    }
    
    
Note
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").
Content block
id874941299