Вы находитесь на странице: 1из 6

Monitorino

Installation Document

1. Introduction...................................................................................................................... 3
2. Installation Manual...........................................................................................................3
2.1 Prerequisites........................................................................................................... 3
2.2 Server Configuration..............................................................................................3
Update the OS...................................................................................................... 3
Install Graphite.....................................................................................................3
Configure a Database for Django.........................................................................3
Configure the Graphite Web Application.............................................................3
Sync the Database................................................................................................ 4
Configure Carbon.................................................................................................4
Install and Configure Apache...............................................................................4
2.3 Installation Procedure.............................................................................................4
Install and configure program dependencies........................................................4
Install and Configure Collectd............................................................................. 5
3. Additional Information.................................................................................................... 5
3.1 Clearing data history.............................................................................................. 5
3.2 References.............................................................................................................. 6

1. Introduction
Monitorino is used alongside Graphite and Collectd to track JVM metrics. All running
JVM processes are automatically searched and analyzed. Stats tracked are heap size,
thread statuses, and context switches.

2. Installation Manual
2.1 Prerequisites
Operating System: Linux ubuntu 14.04

2.2 Server Configuration


Only the server is required to follow all these steps. Client can skip right through
Installation Procedure.
Update the OS

sudo apt-get update


sudo apt-get upgrade

Install Graphite

sudo apt-get install graphite-web graphite-carbon

Configure a Database for Django

sudo apt-get install postgresql libpq-dev python-psycopg2


sudo -u postgres psql
CREATE USER graphite WITH PASSWORD 'password';
Change the username and/or password to your liking.
CREATE DATABASE graphite WITH OWNER graphite;
You can change the database name. The owner is the user previously created.
\q

Configure the Graphite Web Application

sudo nano /etc/graphite/local_settings.py

SECRET_KEY = '[your salty string for the seed]'


This will be used to seed the secret key, change to something long.

TIME_ZONE = '[timezone]'
Change to your timezone, example: TIME_ZONE = Asia/Jakarta

USE_REMOTE_USER_AUTHENTICATION = True

Look for DATABASES and change the NAME, ENGINE, USER,


PASSWORD, and HOST keys. When you are done, it should look
something like this:

The areas in red are values you need to change. Make sure that you modify
the password to the one you selected for the graphite user in Postgres.
Sync the Database

sudo graphite-manage syncdb


Answer yes when asked to create superuser. Create a new user so that you can
sign into the interface. You can call this whatever you want. This will allow you to
save your graphs and modify the interface

Configure Carbon

sudo nano /etc/default/graphite-carbon


CARBON_CACHE_ENABLED=true

sudo nano /etc/carbon/carbon.conf


ENABLE_LOGROTATION = True

sudo cp /usr/share/doc/graphite-carbon/examples/storage-aggregation.conf.example
/etc/carbon/storage-aggregation.conf
sudo service carbon-cache start

Install and Configure Apache

sudo apt-get install apache2 libapache2-mod-wsgi


sudo a2dissite 000-default
sudo cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available
sudo a2ensite apache2-graphite
sudo service apache2 reload

2.3 Installation Procedure


Install and configure program dependencies

Install openJDK

sudo apt-get install openjdk-7-jdk


Add user to visudo

sudo visudo
Add a line after root ALL=(ALL:ALL) ALL
Containing:

username
ALL=(ALL) ALL
Username is your username, for example
andy
ALL=(ALL) ALL

Allow file to be executed


chmod +x monitorino.py

Install and Configure Collectd

sudo apt-get install collectd collectd-utils


sudo nano /etc/collectd/collectd.conf
Uncomment LoadPlugin logfile

Find and change the logfile plugin to something like this

Direct the path to desired log location (logging is optional).


Uncomment LoadPlugin exec
Uncomment LoadPlugin write_graphite
Find and change the exec plugin to something like this

Exec should be followed by your username and then the path to monitorino
executable.
Find and change the write_graphite plugin to something like this

Node name can be changed to anything you like. Change host to the IP address of
target server (or localhost on the server itself). Make sure to add the dot . on the
prefix.
Other plugins are recommended to be disabled (commented) to minimize
warnings and errors, and so the CollectD only collect the stats we wanted.
Restart the collectD service
sudo service collectd restart

3. Additional Information
3.1 Clearing data history
Saved statistics in Graphite are saved in /var/lib/graphite/whisper. Should you need to

clear all data, go there and delete the folders you want.

3.2 References
CollectD Installation
https://www.digitalocean.com/community/tutorials/how-to-configure-collectd-to-gather-s
ystem-metrics-for-graphite-on-ubuntu-14-04

Exec formatting
https://collectd.org/wiki/index.php/Plain_text_protocol

Graphite
http://graphite.readthedocs.org/en/latest/

Graphite Installation
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-graphite-on-an

Overview Monitoring JVM using Graphite, Collectd


https://www.digitalocean.com/community/tutorials/an-introduction-to-tracking-statisticswith-graphite-statsd-and-collectd-ubuntu-14-04-server

Вам также может понравиться