日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > windows >内容正文

windows

Ganglia:分布式监控系统

發(fā)布時間:2025/3/18 windows 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ganglia:分布式监控系统 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Ganglia:分布式監(jiān)控系統(tǒng)


Ganglia的核心包含gmond、gmetad以及一個Web前端。主要是用來監(jiān)控系統(tǒng)性能,如:cpu 、mem、硬盤利用率, I/O負載、網(wǎng)絡(luò)流量情況等,通過曲線很容易見到每個節(jié)點的工作狀態(tài),對合理調(diào)整、分配系統(tǒng)資源,提高系統(tǒng)整體性能起到重要作用


Ganglia監(jiān)控端安裝


1、安裝依賴的軟件包

1 yum?install?ntp?vim-enhanced?gcc?gcc-c++?flex?bison?autoconf?automake?bzip2-devel?ncurses-devel?zlib-devel?libjpeg-devel?libpng-devel?libtiff-devel?freetype-devel?libXpm-devel?gettext-devel??pam-devel?python-devel?perl?perl-devel?expat?expat-devel?pcre?pcre-devel?apr?apr-devel?cairo-devel和pango-devel

需要安裝rrdtool工具 最新版本的ganglia已可以直接使用yum安裝rrdtool工具即可,

2、安裝confuse

1 2 3 4 5 wget?http://download.savannah.gnu.org/releases/confuse/confuse-2.7.tar.gz tar?zxf?confuse-2.7.tar.gz cd?confuse-2.7 ./configure?CFLAGS=-fPIC?--disable-nls?;make;make?install? cd?..

3、安裝ganglia

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ?wget?http://downloads.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.3.1/ganglia-3.3.1.tar.gz tar?zxf?ganglia-3.3.1.tar.gz cd?ganglia-3.3.1 #server?監(jiān)控端 ./configure?--prefix=/usr/local/ganglia?--with-static-modules?--enable-gexec?--enable-status?--with-gmetad?--with-python=/usr?--with-librrd=/usr/local/rrdtool?--with-libexpat=/usr?--with-libconfuse=/usr/local?--with-libpcre make make?install cd?gmetad cp?gmetad.conf?/opt/modules/ganglia/etc/ cp?gmetad.init?/etc/init.d/gmetad vim?/etc/init.d/gmetad 修改為GMETAD=/usr/local/ganglia/sbin/gmetad ip?route?add?239.2.11.71?dev?eth0??##添加廣播路由

Ganglia:被監(jiān)控端安裝:


1、安裝依賴的軟件包

1 yum?install?ntp?vim-enhanced?gcc?gcc-c++?flex?bison?autoconf?automake?bzip2-devel?ncurses-devel?zlib-devel?libjpeg-devel?libpng-devel?libtiff-devel?freetype-devel?libXpm-devel?gettext-devel??pam-devel?python-devel?perl?perl-devel?expat?expat-devel?pcre?pcre-devel?apr?apr-devel
1 2 3 4 5 wget?http://download.savannah.gnu.org/releases/confuse/confuse-2.7.tar.gz tar?zxf?confuse-2.7.tar.gz cd?confuse-2.7 ./configure?CFLAGS=-fPIC?--disable-nls?;make;make?install? cd?..


2、安裝ganglia

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 wget?http://downloads.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.3.1/ganglia-3.6.0.tar.gz tar?zxf?ganglia-3.6.0.tar.gz cd?ganglia-3.6.0 ./configure?--prefix=/usr/local/ganglia?--enable-gexec?--enable-status?--with-python=/usr?--with-libapr?--with-libconfuse=/usr/local?--with-libexpat=/usr?--with-libpcre make make?install cd?gmond ./gmond?-t?>?/usr/local/ganglia/etc/gmond.conf cp?gmetad.init?/etc/init.d/gmond vim?/etc/init.d/gmond 修改為: GMETAD=/usr/local/ganglia/sbin/gmond mkdir?/usr/local/ganglia/lib64/ganglia/python_modules cp?python_modules/*/*.py?/usr/local/ganglia/lib64/ganglia/python_modules ip?route?add?239.2.11.71?dev?eth0

安裝已完成,過程簡單。


Web網(wǎng)頁頁面在https://github.com/ganglia/ganglia-web

自行下載配置使用即可。



下面來監(jiān)控,使其能正常工作和使用。

ganglia是分布式監(jiān)控系統(tǒng),也可以不使用分布來用。下面就分兩種方式來解說。

1、不使用分布式來監(jiān)控的方式

1 2 3 4 5 6 7 8 9 10 11 12 服務(wù)器配置文件 修改兩項: data_source?"test1"?192.168.107.2 data_source?"test2"?172.16.1.4 ##這里分了兩個監(jiān)控組 data_source是關(guān)鍵字, “test1,test2”?是監(jiān)控主機組的名字,全局要唯一。?后面跟著要監(jiān)控的ip或主機名,如果有多個可以用空格隔開就可以了 gridname?"Test" 這個是定義監(jiān)控集的名字,

如下所示:




現(xiàn)在ganglia還沒有啟動,在啟動之前執(zhí)行下面命令:

可以使用命令查看是不是有配置錯誤的地方導(dǎo)致啟動不了

/usr/local/ganglia/sbin/gmetad -d 5

出錯的地方應(yīng)該可以修改配置文件gmetad.conf得到修正、

service gmetad start 來啟動服務(wù)


好了,再看客戶端的配置吧

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 在客戶端配置 globals?{ ??daemonize?=?yes ??setuid?=?yes ??user?=?nobody ??debug_level?=?0 ??max_udp_msg_len?=?1472 ??mute?=?no ??deaf?=?no ??allow_extra_data?=?yes ??host_dmax?=?86400?/*secs.?Expires?(removes?from?web?interface)?hosts?in?1?day?*/ ??host_tmax?=?20?/*secs?*/ ??cleanup_threshold?=?300?/*secs?*/ ??gexec?=?no ??#?By?default?gmond?will?use?reverse?DNS?resolution?when?displaying?your?hostname ??#?Uncommeting?following?value?will?override?that?value. ??#?override_hostname?=?"mywebserver.domain.com" ??#?If?you?are?not?using?multicast?this?value?should?be?set?to?something?other?than?0. ??#?Otherwise?if?you?restart?aggregator?gmond?you?will?get?empty?graphs.?60?seconds?is?reasonable ??send_metadata_interval?=?0?/*secs?*/ } cluster?{ ??name?=?"test1"??????####需要修改與服務(wù)器端設(shè)定相同的名字?### ??owner?=?"nobody"?????????###修改為nobody ??latlong?=?"unspecified" ??url?=?"unspecified" } host?{ ??location?=?"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??##與設(shè)定的要一樣哦 ??port?=?8649???????????????##默認端口 ??ttl?=?1 } udp_recv_channel?{ ??mcast_join?=?239.2.11.71???##與設(shè)定的要一樣哦 ??port?=?8649????????????????##默認端口 ??bind?=?239.2.11.71 ??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 } /*?You?can?specify?as?many?tcp_accept_channels?as?you?like?to?share ???an?xml?description?of?the?state?of?the?cluster?*/ tcp_accept_channel?{ ??port?=?8649 ??#?If?you?want?to?gzip?XML?output ??gzip_output?=?no }

啟動客戶端

在客戶端也是可以使用debug來調(diào)試配置是不是有錯

/usr/local/ganglia/sbin/gmond -d 5


service gmond start


下面來說第2種分布式監(jiān)控系統(tǒng)


2、分布式監(jiān)控


主gmetad ? ?多個次gmetad ? ?被監(jiān)控點

|------ gmond

?? ? _ gmetad---|------ gmond

?? ? | |------ gmond

?? ? |?

gmetad-------|_ gmetad---|-------gmond

? ? ? | ? ? | ?? ? ? ? |------gmond

? ? ? | ? ? ? |__ gmetad----|------gmond

? ? ? | ?|------gmond

? ? ? |_gmond

? ? ? |-gmond


從面可以看到多個gmetad點和多個gmond點

主要是從次節(jié)點的配置:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 下面對次節(jié)點配置如下 ?gmetad.conf ?配置如下: ?data_source?"test2"?localhost?ip/hostname ?gmond.conf配置文件如下: ?cluster?{ ??name?=?"test2" ??owner?=?"nobody" ??latlong?=?"unspecified" ??url?=?"unspecified" } host?{ ??location?=?"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?=?172.16.1.4?####次節(jié)點的ip地址。也就次節(jié)點自己的ip地址 ??port?=?8649 ??} udp_recv_channel?{ ??port?=?8649 ??family?=?inet4 } /*?You?can?specify?as?many?tcp_accept_channels?as?you?like?to?share ???an?xml?description?of?the?state?of?the?cluster?*/ tcp_accept_channel?{ ??port?=?8649 }

次節(jié)點下的gmond節(jié)點配置與次節(jié)點gmond的配置一樣,直接copy一份到gmond上面就好。


關(guān)于Ganglia的主要配置到此為止了。Ganglia的views功能還在研究當(dāng)中,不過這個view添加很麻煩,我配置的好久也,只是在配置文件中添加,在頁面上沒有添加成功,因為頁面上沒有添加view的功能,,這個很不爽,網(wǎng)上查了很多資料,只是在官網(wǎng)上找到一點相關(guān)E文,,,,,,希路過的大牛能指點一二,多謝!




本文轉(zhuǎn)自 ZhouLS 51CTO博客,原文鏈接:http://blog.51cto.com/zhou123/1543105


總結(jié)

以上是生活随笔為你收集整理的Ganglia:分布式监控系统的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。