2011년 2월 17일 목요일

Ganglia 설치(Slackware 13.1 기준)

1) Ganglia 설치전에 아래 패키지가 설치해야 한다.

* APR (http://apr.apache.org/)
* libConfuse (http://www.nongnu.org/confuse/)
* expat (http://expat.sourceforge.net/)
* python (http://www.python.org/)
* PCRE (http://www.pcre.org/)
* RRDtool (http://oss.oetiker.ch/rrdtool/)

이중 libConfuse와 RRDTool은 Slackbuild에서 다운로드 받을 수있고 python은 이미 깔려 있다. 나머지 패키지는 직접 소스를 다운로드 받아 설치해야 한다.

2) 설치가 완료되면,  http://sourceforge.net/projects/ganglia/ 에서 Ganglia 소스코드를 다운로드 받아 아래와 같이 설치한다.
$ ./configure --sysconfdir=/etc/ganglia --with-gmetad
$ make
$ make install
3)  gmond와 gmetad 초기화스크립트를 시작 스크립트로 복사
$ cp gmond/gmond.init /etc/rc.d/rc.gmond
$ cp gmetad/gmetad.init /etc/rc.d/rc.gmetad (헤드노드만)
4) gmond.conf를 /etc/ganglia로 복사
$ cp gmond/gmond.conf /etc/ganglia/.
$ cp gmetad/gmetad.conf /etc/ganglia/. (헤드 노드만)
5) /etc/ganglia/gmond.conf 수정
name : 클러스터 이름
host : gmond가 수집한 정보를 보낼 서버의 주소
bind : 다른 노드에서 보내온 정보를 받을 서버의 주소
계산노드는 host만, 헤드노드는 host와 bind 모두 설정
cluster {
  //name = "unspecified"
  name = "my cluster" 
}
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.1.1 
  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
  bind = 192.168.1.1
}
6) /etc/ganglia/gmetad.conf 수정 (헤드 노드만)
클러스터의 이름과 gmond.conf에서 bind로 설정된 노드의 주소 또는 이름 추가
data_source "my cluster" 192.168.1.1
7) Web Frontend 설치
mkdir /var/www/htdoc/ganglia
cp -a web/* /var/www/htdoc/ganglia/
8) /var/www/htdoc/ganglia/conf.php에서 rrd 파일 저장위치와 rrdtool의 위치 확인
# Where gmetad stores the rrd archives.
$gmetad_root = "/var/lib/ganglia";
$rrds = "$gmetad_root/rrds";

# Leave this alone if rrdtool is installed in $gmetad_root,
# otherwise, change it if it is installed elsewhere (like /usr/bin)
define("RRDTOOL", "/usr/bin/rrdtool");
9) 8)의 rrd파일 저장 위치 생성 후 nobody로 소유자 변경.
mkdir -p /var/lib/ganglia/rrds
chown nobody.nobody /var/lib/ganglia/rrds
10) Apache 설정에 PHP 모듈이 활성화 되어있는지 확인
/etc/httpd/httpd.conf에서 다음 라인의 주석제거
# Uncomment the following line to enable PHP:
#
Include /etc/httpd/mod_php.conf
11) 모든 노드에서 gmond 시작, 헤드노드에서 gmetad , httpd 시작
$ /etc/rc.d/rc.gmond start
$ /etc/rc.d/rc.gmetad start
$ /etc/rc.d/rc.httpd start
12) gmond, gmetad 정상동작 확인
$telnet node2 8649
$telnet localhost 8651 
 13) http://localhost/ganglia/index.php로 접속

댓글 없음:

댓글 쓰기