Friday 1 March 2019

Monitoring with Ganglia

Prerequisites
Installing LAMP server

Before starting, you will need to install LAMP on the server. You can install it by running the following command:

user@host:$ sudo apt-get install -y apache2
user@host:$ service apache2 status
OR
Go to http://localhost or http://server-ipA page saying your Apache server is running properly should show up.

user@host:$ sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip
user@host:$ php -v
OR
Go to http://localhost/info.php or http://server-ip/info.php. If php is running in your server, you will receive the following message in your web browser.

Installing Ganglia Server

user@host:$ sudo apt-get install ganglia-monitor rrdtool gmetad ganglia-webfrontend

During installation, you will be asked to restart Apache. Select yes. Depending on your system, you may be asked twice. Select yes again.


Configure Ganglia Master Node
Now you need to copy the ganglia webfrontend apache configuration to correct location using the following command

user@host:$ sudo cp /etc/ganglia-webfrontend/apache.conf /etc/apache2/sites-enabled/ganglia.conf

Now you need to edit the ganglia meta daemon configuration file using the following command

user@host:$ sudo gedit /etc/ganglia/gmetad.conf

change the following
data_source "my cluster" localhost
to
data_source "mach cluster" localhost

Need to edit the master node configuration file using the following command

user@host:$ sudo gedit /etc/ganglia/gmond.conf

change the following

/* If a cluster attribute is specified, then all gmond hosts are wrapped inside 
 * of a <CLUSTER> tag.  If you do not specify a cluster tag, then all <HOSTS> will 
 * NOT be wrapped inside of a <CLUSTER> tag. */ 
cluster { 
  name = "unspecified" 
  owner = "unspecified" 
  latlong = "unspecified" 
  url = "unspecified" 

to

/* If a cluster attribute is specified, then all gmond hosts are wrapped inside 
 * of a <CLUSTER> tag.  If you do not specify a cluster tag, then all <HOSTS> will 
 * NOT be wrapped inside of a <CLUSTER> tag. */ 
cluster { 
  name = "mach cluster" 
  owner = "unspecified" 
  latlong = "unspecified" 
  url = "unspecified" 

/* Feel free to specify as many udp_send_channels as you like.  Gmond 
   used to only support having a single channel */ 
udp_send_channel { 
  mcast_join = 239.2.11.71 
  port = 8649 
  ttl = 1 

to

/* Feel free to specify as many udp_send_channels as you like.  Gmond 
   used to only support having a single channel */ 
udp_send_channel { 
  # mcast_join = 239.2.11.71 
  host = localhost
  port = 8649 
  ttl = 1 

/* You can specify as many udp_recv_channels as you like as well. */ 
udp_recv_channel { 
  mcast_join = 239.2.11.71 
  port = 8649 
  bind = 239.2.11.71 

to

/* You can specify as many udp_recv_channels as you like as well. */ 
udp_recv_channel { 
  # mcast_join = 239.2.11.71 
  port = 8649 
  # bind = 239.2.11.71 

Save and exit the file

Restart Ganglia-monitor, Gmetad and Apache.

user@host:$ sudo systemctl start ganglia-monitor
user@host:$ sudo systemctl start gmetad
user@host:$ sudo systemctl restart apache2

Web Interface

Ganglia should now be set up and accessible at http://localhost/ganglia.






No comments:

Post a Comment