在 Ubuntu上安装 Ganglia

版权声明:文章来源:良玉的博客 http://www.uouo123.com/ 转载请注明 https://blog.csdn.net/xiangliangyu2008/article/details/82711014

在 Ubuntu上安装 Ganglia

1、首先,需要确保在 Ubuntu14.04 上安装了 LAMP 服务

Ganglia 由两个所谓主要守护进程 gmond(Ganglia 监测守护进程)和 gmetad(Ganglia 元守护进程),一个基于 PHP 的 Web 前端和其他一些小的实用程序。

2、在 Ubuntu14.04 上安装 Ganglia 。

打开终端,运行以下命令:

sudo apt-get install ganglia-monitor rrdtool gmetad ganglia-webfrontend

在安装过程中,你应该会看到类似下面的安装后与apache2服务器重启选择,直接 Yes,然后按Enter键。

3、配置 Ganglia

已经完成了基本的安装,现在我们按照下面必要的步骤来配置

4、Ganglia 主节点配置

现在,你需要复制 Ganglia webfrontend Apache 配置,使用下面的命令来正确的位置

sudo cp /etc/ganglia-webfrontend/apache.conf /etc/apache2/sites-enabled/ganglia.conf

现在,您需要使用以下命令来编辑 Ganglia 元守护程序的配置文件:

sudo vi /etc/ganglia/gmetad.conf

更改如下:

data_source "my cluster" localhost

修改为:

data_source "my cluster" 50 192.168.56.10:8649

下面列出机器服务的数据源,IP:端口或服务器名称:端口。如果未指定端口号8649(默认gmond端口)。
需要使用下面的命令编辑主节点的配置文件:

sudo vi /etc/ganglia/gmond.conf

做下面的变化:

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

修改为:

cluster {
name = "my 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
}

修改为:

/* 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 = 192.168.56.10
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
}

修改为:

/* 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
}

保存并关闭文件。

需要重启服务:

sudo /etc/init.d/ganglia-monitor start
sudo /etc/init.d/gmetad start
sudo /etc/init.d/apache2 restart

现在你可以使用以下命令访问gnglia webinterface:

http://serverip/ganglia/

猜你喜欢

转载自blog.csdn.net/xiangliangyu2008/article/details/82711014