4、Flume監(jiān)控之Ganglia

本文操作是在CentOS7下操作的

Ganglia的安裝與部署

  1. 安裝httpd服務(wù)與php
    sudo yum -y install httpd php
  2. 安裝其他依賴
    sudo yum -y install rrdtool perl-rrdtool rrdtool-devel
    sudo yum -y install apr-devel
  3. 安裝ganglia
    sudo yum -y install epel-release
    sudo yum -y install ganglia-gmetad
    sudo yum -y install ganglia-web
    sudo yum install -y ganglia-gmond
  4. 修改配置文件ganglia.conf
    sudo vim /etc/httpd/conf.d/ganglia.conf
#
# Ganglia monitoring system php web frontend
#
Alias /ganglia /usr/share/ganglia
<Location /ganglia>
  Require all granted
  # Require local
  # Require ip 10.1.2.3
  # Require host example.org
</Location>
  1. 修改配置文件gmetad.conf
    sudo vim /etc/ganglia/gmetad.conf
    修改,其中hadoop-101是主機名,192.168.114.101是ip
    data_source "hadoop-101" 192.168.114.101
  2. 修改配置文件gmond.conf
    sudo vim /etc/ganglia/gmond.conf
    修改為,主機名和ip與上面配置一致
cluster {
  name = "hadoop-101"
  owner = "unspecified"
  latlong = "unspecified"
  url = "unspecified"
}
udp_send_channel {
  #bind_hostname = yes # Highly recommended, soon to be default.
                       # This option tells gmond to use a source address
                       # that resolves to the machine's hostname.  Without
                       # this, the metrics may appear to come from any
                       # interface and the DNS names associated with
                       # those IPs will be used to create the RRDs.
  # mcast_join = 239.2.11.71
  host = 192.168.114.101
  port = 8649
  ttl = 1
}
udp_recv_channel {
  # mcast_join = 239.2.11.71
  port = 8649
  bind = 192.168.114.101
  retry_bind = true
  # Size of the UDP buffer. If you are handling lots of metrics you really
  # should bump it up to e.g. 10MB or even higher.
  # buffer = 10485760
}
  1. 修改配置文件config
    sudo vim /etc/selinux/config
    修改為
    SELINUX=disabled
    注意,selinux本次生效關(guān)閉必須重啟,如果此時不想重啟,可以執(zhí)行下面命令臨時生效之
    sudo setenforce 0
  2. 啟動ganglia
    sudo service httpd start
    sudo service gmetad start
    sudo service gmond start
  3. 打開網(wǎng)頁瀏覽ganglia頁面
    192.168.114.101/ganglia
    注意,如果完成以上操作依然出現(xiàn)權(quán)限不足錯誤,請修改/var/lib/ganglia目錄的權(quán)限,執(zhí)行下面命令
    sudo chmod -R 777 /var/lib/ganglia

操作Flume測試監(jiān)控

  1. 修改/opt/module/flume/conf目錄下的flume-env.sh配置
    export JAVA_OPTS="-Dflume.monitoring.type=ganglia -Dflume.monitoring.hosts=192.168.9.102:8649 -Xm
    s100m -Xmx200m"
  2. 啟動flume任務(wù)
    bin/flume-ng agent --conf conf/ --name a1 --conf-file job/flume-telnet-logger.conf -Dflume.root.logger==INFO,console -Dflume.monitoring.type=ganglia -Dflume.monitoring.hosts=192.168.114.100:8649
  3. 查看監(jiān)控結(jié)果


    在哪查看監(jiān)控.png

    監(jiān)控.png

    相關(guān)表的解釋說明

字段(圖標(biāo)名稱) 字段含義
ChannelCapacity channel的容量
ChannelFillPercentage channel占用百分比
ChannelSize 目前channel中事件的總數(shù)量
EventPutAttemptCount source嘗試寫入channel的事件總數(shù)量
EventPutSuccessCount 成功寫入channel且提交的事件總數(shù)量
EventTakeAttemptCount sink嘗試從channel拉取事件的總數(shù)量。這不意味著每次事件都被返回,因為sink拉取的時候channel可能沒有任何數(shù)據(jù)
EventTakeSuccessCount sink成功讀取的事件的總數(shù)量
StartTime channel啟動的時間(毫秒)
StopTime channel停止的時間(毫秒)
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容