SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
1 / 36
문서번호 : 000-01
000 구축
Zabbix & haproxy Install Guide
Version 1.0
개정일자 2013-07-16
작성자 이호성
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
2 / 36
개정 이력
버전 개정일자 1
개정사유 2
개정내역 작성자 승인자
1.0 2013-04-16 제정 최초 제정 홍길동
2.0 2013-07-16 제정 Haproxy install guide 추가 이호성
1
개정 사유: 제정 또는 개정 내용이 이젂 문서에 대해 추가/수정/삭제인지 선택 기입
2
개정 내역: 개정이 발생하는 페이지 번호와 변경 내용을 기술
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
3 / 36
목 차
1. Zabbix 개요........................................................................................................ 4
1.1. 설치 환경..............................................................................................................................................................................4
2. Zabbix Server 설치 방법....................................................................................... 5
2.1. Zabbix 사용자 계정 생성................................................................................................................................................5
2.2. MySQL 설치.........................................................................................................................................................................5
2.3. PHP 설치...............................................................................................................................................................................5
2.4. Zabbix 소스 컴파일 및 설치..........................................................................................................................................6
2.4.1. Installing Zabbix deamons ..........................................................................6
2.4.1. Installing Zabbix frontend ...........................................................................8
3. Zabbix Agent 설치 방법 ......................................................................................14
3.1. Zabbix Agent 설정.......................................................................................................................................................... 14
3.2. Zabbix Agent Start.......................................................................................................................................................... 14
4. Zabbix 모니터링 항목 및 모니터링 방법.................................................................15
4.1. 모니터링 항목 (Item keys) .......................................................................................................................................... 15
4.2. 모니터링 방법................................................................................................................................................................... 16
4.2.1. Host 등록 방법 ...................................................................................... 17
4.2.2. Item 등록.............................................................................................. 19
4.2.3. Trigger 등록 .......................................................................................... 20
4.2.4. Action 등록 ........................................................................................... 21
5. 프로세스 모니터링 등록 및 확인 방법....................................................................25
5.1. 프로세스 모니터링 등록............................................................................................................................................... 25
5.2. 프로세스 모니터링 확인방법....................................................................................................................................... 27
5.2.1. Monitoring > Latest data........................................................................... 27
5.2.2. Monitoring > Triggers .............................................................................. 27
5.2.3. Monitoring > Events ................................................................................ 28
6. 구성시 주의사항.................................................................................................29
6.1. Zabbix server 웹접속이 안될때.................................................................................................................................. 29
6.2. Zabbix server deamon 이 start 되지 못하는경우............................................................................................... 29
6.3. Zabbix server is not running 메시지 발생시......................................................................................................... 29
7. HAProx 개요......................................................................................................30
7.1. 설치 환경........................................................................................................................................................................... 30
8. HAProxy 설치 방법.............................................................................................31
8.1. HAproxy 사용자 계정 생성.......................................................................................................................................... 31
8.2. haproxy 설치..................................................................................................................................................................... 31
8.3. haproxy 설치..................................................................................................................................................................... 31
8.4. haproxy 기본설정............................................................................................................................................................ 32
8.4.1. haproxy.conf 파일 수정 ........................................................................... 32
8.4.2. haproxy 상태확인하기 .............................................................................. 35
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
4 / 36
1. Zabbix 개요
Zabbix 는 엔터프라이즈급 오픈소스 분산 모니터링 솔루션이다.
Zabbix 는 네트워크와 서버의 상태 및 무결성의 다양한 매개변수를 모니터링하는 소프트웨어 입니
다. Zabbix는 사용자로 하여금 거의 모든 이벤트에 대해 e-mail 기반 알림을 설정 할수 있도록 하
는 유연한 알림 메커니즘을 사용합니다. 이것은 서버 문제데 대하나 빠른 대응을 할수 있게 합니
다. Zabbix 는 저장된 데이터를 기반으로 뛰어난 리포팅 및 데이터 시각화 기능을 제공합니다.
Zabbix 는 polling 및 trapping 을 모두 지원합니다. 모든 Zabbix 보고서 및 통계뿐맊 아니라, 설정
정보들을 웹UI 를 통해 액세스 할수 있습니다.
Zabbix 는 GPL General Public License version 2하에 작성 및 배포되었으며, 소스 코드는 자유롭게
배포 및 누구나 사용할수 있습니다.
1.1. 설치 환경
 Red Hat Enterprise Linux Server release 6.3
 Zabbix 2.0.5
 PHP 5.3.3
 MySQL 5.1.67
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
5 / 36
2. Zabbix Server 설치 방법
Zabbix Server 설치 작업 순서는 다음과 같다.
 Zabbix 사용자 계정 생성
 MySQL 설치
 php 설치
 Zabbix 소스 컴파일 및 설치
2.1. Zabbix 사용자 계정 생성
아래 명령으로 zabbix user 생성 (by root)
$ groupadd zabbix
$ useradd –g zabbix zabbix
2.2. MySQL 설치
Zabbix Server 는 모니터링 수집데이터를 저장하기위해서 데이터베이스가 필요하다.
아래 명령으로 설치 (by root)
$ yum -y install mysql mysql-server mysql-devel
설치완료후 mysql 데몬을 실행한다. (by root)
$ service mysqld start
2.3. PHP 설치
Zabbix Server 웹 UI 는 PHP 로 개발되어있음으로 PHP 모듈 및 PHP extensions 를 설치해야 한다.
아래 명령으로 설치 (by root)
$ yum install php
$ yum install php-mysql
$ yum install php-bcmath
$ yum install php-mbstring
$ yum install php-gd
웹서버는 리눅스에 기본적으로 설치되어 있는 httpd 를 사용한다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
6 / 36
2.4. Zabbix 소스 컴파일 및 설치
2.4.1. Installing Zabbix deamons
Download the source archive
아래 url 에서 최싞버젂의 소스를 다운받는다.
 http://www.zabbix.com/download.php
다운받은후 다음과같이 압축을 푼다. (by zabbix)
$ tar –zxvf zabbix-2.0.5.tar.gz // 현재 directory 에 zabbix-2.0.5 drectory 가 생성됨.
Create Zabbix database
MySQL 에 Zabbix 가 사용할 db schema 및 기본 dataset 을 입력한다. (by root)
$ mysql
mysql> create database zabbix;
mysql>exit;
$ cd /home/zabbix/zabbix-2.0.5/database/mysql
$ mysql –uroot –p zabbix < ./schema.sql
$ mysql –uroot –p zabbix < ./images.sql
$ mysql –uroot –p zabbix < ./data.sql
Configure the sources
설치 directory 생성후 소스 컴파일을 위한 설정을 실행한다. (by zabbix)
$ cd /home/zabbix
$ mkdir ./server
$ cd /home/zabbix/zabbix-2.0.5
$ ./configure --prefix=/home/zabbix/server --enable-server --enable-agent --with-mysql --enable-ipv6
--with-net-snmp --with-libcurl.
작업중 curl 및 snmp 관련 에러가 발생하면 다음 모듈을 추가 설치한다. (by root)
$ yum install curl curl-devel
$ yum install net-snmp-devel
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
7 / 36
Make and install
최종 컴파일 및 설치를 실행한다. (by zabbix)
$ make install
앞선 ./configure –-prefix 로 지정한 /home/zabbix/server 에 Zabbix server deamon 이 설치된다.
Zabbix server 설정파일은 /home/zabbix/server/etc/zabbix_server.conf 이다. Database name, user
and password 등이 설정되어 있다.
Start up the daemons
다음과 같이 zabbix server deamon 을 실행한다.(by zabbix)
$ /home/zabbix/server/sbin/zabbix_server –c /home/zabbix/server/etc/zabbix_server.conf
// 아래는 종료 script
$ ps -ef | grep "zabbix_server" | awk {'print "kill -9 " $2'} | sh -x
-c 옵션으로 설정파일을 지정한다. 지정하지 않으면 /usr/local/etc/zabbix_server.conf 를 찾는다.
Ps –ef | grep zabbix 명령으로 데몬이 실행되었는지 확인다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
8 / 36
2.4.1. Installing Zabbix frontend
Copying PHP files
Zabbix frontend(WEB UI) 는 PHP 로 작성되었다. 따라서 PHP가 지원되는 웹서버가 필요하다. 웹서버
가 설치되어 있다면 단순히 Zabbix 소스의 frontends/php 의 PHP 파일들을 웹서버의 document root
디렉토리에 카피맊하면 된다.
일반적으로 OS별 아파치 웹서버의 document root 위치는 다음과 같다.
 /usr/local/apache2/htdocs (default directory when installing Apache from source)
 /srv/www/htdocs (OpenSUSE, SLES)
 /var/www/html (Fedora, RHEL, CentOS)
 /var/www (Debian, Ubuntu)
카피하기 젂에 먼저 zabbix 서브 디렉토리를 생성후 그안에 php파일들을 카피한다. (by root)
$ cd /var/www/html
$ mkdir zabbix
$ cd /home/zabbix/zabbix-2.0.5/frontends/php
$ cp –R . /var/www/html/zabbix
웹서버(httpd)가 실행되어 있지 않다면 실행한다. (service httpd start)
Installing frontend
Step1
브라우저로 http://<server_ip_or_name>/zabbix 로 접속하면 아래와 같은 화면을 볼수 있다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
9 / 36
Step2
다음 화면에서는 PHP 관련 필요 설정상태를 보여준다.
맊일 fail 되어있는 항목이 있다면 설정 및 관련 설치를 통해 해결해야 한다.
아래를 참고하세요.
Pre-requisite Minimum value Description
PHP version 5.1.6
PHP memory_limit option 128MB
In php.ini:
memory_limit = 128M
PHP post_max_size
option
16MB
In php.ini:
post_max_size = 16M
PHPupload_max_filesize
option
2MB
In php.ini:
upload_max_filesize = 2M
PHPmax_execution_time
option
300 seconds
In php.ini:
max_execution_time = 300
PHP max_input_time
option
300 seconds
In php.ini:
max_input_time = 300
PHPsession.auto_start
option
must be disabled
In php.ini:
session.auto_start = 0.
Required since Zabbix 2.0.4 version.
Database support
One of: IBM DB2,
MySQL, Oracle,
PostgreSQL, SQLite
One of the following modules must be
installed:
ibm_db2, mysql, oci8, pgsql, sqlite3
bcmath php-bcmath
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
10 / 36
mbstring php-mbstring
sockets
php-net-socket. Required for user script
support.
gd 2.0 or higher
php-gd. PHP GD extension must
support PNG images (--with-png-
dir), JPEG (--with-jpeg-dir) images and
FreeType 2 (--with-freetype-dir).
libxml 2.6.15 php-xml or php5-dom
xmlwriter php-xmlwriter
xmlreader php-xmlreader
ctype php-ctype
session php-session
gettext php-gettext
/etc/php.ini 설정(by root) 후에는 웹서버를 재시작해야 한다.
Step3
Database 관련설정 화면이다. 아래 화면과같이 설정하고, „Test connection‟클릭 결과가 „OK‟이어야
한다. (실패했다면 관련 정보 및 3306 포트관련 방화벽을 확인한다.)
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
11 / 36
Step4
Zabbix server host 및 port 설정화면으로 변경 없이 „Next‟.
Step5
설정 정보를 재확인하는 화면임. „Next‟.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
12 / 36
Step6
„Download configuration file‟을 이용 zabbix.conf.php 파일을 다운받아서 서버
/var/www/html/zabbix/conf 로 업로드하고 „Retry‟를 클릭해 „OK‟를 확인한다.
Step7
설치 완료 화면.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
13 / 36
Step7
모든 설치가 완료되었으며 Default user name 은 „Admin‟, password 는 „zabbix‟ 이다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
14 / 36
3. Zabbix Agent 설치 방법
Zabbix Server 설치 내역중에 아래 구성항목들을 Agent 모듈로 사용하면 된다.
[Zabbix Server Path]/bin/zabbix_get
[Zabbix Server Path]/bin/zabbix_sender
[Zabbix Server Path]/etc/zabbix_agent.conf
[Zabbix Server Path]/etc/zabbix_agentd.conf
[Zabbix Server Path]/sbin/zabbix_agent
[Zabbix Server Path]/sbin/zabbix_agentd
위 Agent 모듈을 각 모니터링 대상 host 에 설치하기맊 하면 된다. (by agent 계정)
3.1. Zabbix Agent 설정
[Zabbix Agent Path]/etc/zabbix_agentd.conf 파일에서 아래 항목을 홖경에 맞게 설정한다.
항목 설정
PidFile Pid 파일 경로 수정.
Ex ) [Zabbix Agent Path]/logs/zabbix_agentd.pid
LogFile Log 파일 경로 수정
Ex ) [Zabbix Agent Path]/logs/zabbix_agentd.log
Server Incomming Connection 을 허용할 Zabbix Server IP or hostname list 를 콤마
구분자로 설정한다. 공백을 허용하지 않음. (passive check 를 위함)
ServerActive Active check 를 위한 Zabbix Server IP:port (or hostname:port) list 를 콤마
구분자로 설정한다. 공백을 허용하지 않고, port 생략시 10051 기본포트가
사용된다.
Hostname Zabbix Server 에 등록된 host name 을 입력한다.
일반적인 경우 PidFile, LogFile 은 사용자 권한이 허용되는 곳으로 수정하고, Server, ServerActive 는
Zabbix Server IP 맊 설정하면 된다.
3.2. Zabbix Agent Start
다음과 같이 Agent daemon 을 start 한다. (by agent 계정)
$ [Zabbix Server Path]/sbin/zabbix_agentd –c [Zabbix Server Path]/etc/zabbix_agentd.conf
// 아래는 종료 script
$ ps -ef | grep "zabbix_agent" | awk {'print "kill -9 " $2'} | sh -x
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
15 / 36
4. Zabbix 모니터링 항목 및 모니터링 방법
4.1. 모니터링 항목 (Item keys)
Zabbix 는 모니터링 항목을 Item key라는 것으로 정의한다. 다음과 같은 항목을 모니터링 할 수 있다.
모니터링 항목 Item keys
CPU 사용률 Item key : system.cpu.util[<cpu>,<type>,<mode>]
cpu : cpu number (default is all CPUs)
type : idle, nice, user(default), system, iowait, interrupt…
mode : avg1 (1분평균, default), avg5(5분평균), avg15(15분평균)
Example key: system.cpu.util[0,user,avg5]
Memory 사용량 Item key : vm.memory.size[<mode>]
mode : one of total(default), active, anon, buffers, cached, exec,
file, free, inactive…
Example key: vm.memory.size[used]
Disk 사용량 Item key : vfs.fs.size[fs,<mode>]
Fs : directory path
Mode : one of total(default), free, used, pfree(free, percentage)
Pused(used, percentage)
Example key: vfs.fs.size[/,used]
프로세스 수 Item key : proc.num[<name>,<user>,<state>,<cmdline>]
name : process name (default is “all process”)
user : user name (default is “all users”)
stat : all (default), run, sleep, zomb
cmdline : filter by command line
Example keys:
proc.num[,mysql] - number of processes running under the
mysql user
proc.num[apache2,apache] –
number of apache2 processes running under the apache user
로그파일 특정 문자열 Item key : log[file,<regexp>,<encoding>,<maxlines>,<mode>]
file : full path and name of log file
regexp : 검출할 문자열의 정규 표현식
encoding : 로그파일 encoding (ex : UTF-8)
maxlines : Zabbix Server에 보낼 검출된 싞규 log line 수
mode : all(default) or skip (old data 는 포함시키지 않는다.)
Example key :
log[/home/zabbix/logs/logfile,,,100]
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
16 / 36
네트워크 Incomming traffic Item key : net.if.in[if,<mode>]
if : network interface name
mode : bytes(default), packets, errors, dropped
Example keys:
net.if.in[eth0,errors]
net.if.in[eth0]
네트워크 Outgoing traffic Item key : net.if.out[if,<mode>]
if : network interface name
mode : bytes(default), packets, errors, dropped
Example keys:
net.if.out[eth0,errors]
net.if.out[eth0]
http (https) response code Item key : web.test.rspcode[Scenario,Step]
Scenario : 정렬된 Step 의 집합명
Step : http request url 정의
(ex: http://www.company.com/test.do)
Zabbix는 이외에 더 맋은 모니터링 항목을 제공한다. 자세한 정보는 아래url 에서 참고하세요.
https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes
4.2. 모니터링 방법
Zabbix 는 다양한 모니터링 방법(Item type)을 제공한다. Agent 기반 모니터링과 Agent 가 필요없는
Web 모니터링 및 SSH, Telnet Check 모니터링등을 제공한다.
아래는 Agent 기반 모니터링을 기준으로 설명한다. 대상 host 에 agent 설치 및 실행은 아래 작업
host 등록 이후에 짂행해야 한다.
Zabbix 모니터링 젃차는 아래와 같다.
 Host 등록 : 모니터링 대상 host 정보 등록
 Item 등록 : 모니터링 항목 등록
 Trigger 등록 : 알람 발생 기준정보(threshold) 등록
 Action 등록 : 알람 방법 및 대상 등록
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
17 / 36
4.2.1. Host 등록 방법
Host 관리 메뉴 : Configuration > Hosts
아래 화면에서 우측 상단의 „Create host‟ 버튺을 클릭한다.
아래는 host 등록화면이다. „Host name‟, „Visible name‟, „Groups‟, „Agent interface‟ 항목맊 등록후
저장하면 된다.
„Host name‟ 은 agent 설정시 사용됨. „Groups‟는 아래 에서 등록한 host group 을 등록한다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
18 / 36
Host group 등록
Host group 관리메뉴 : Configuration > Host groups
아래 화면에서 우측 상단의 „Create host group‟ 버튺을 클릭한다.
아래는 host group 등록화면이다. Group name 등록후 저장한다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
19 / 36
4.2.2. Item 등록
Host 관리 메뉴 : Configuration > Hosts 의 Host 목록 화면에서 „Items‟ 링크를 클릭한다.
아래는 item 관리 화면이다. 우측 상단의 „Create item‟ 버튺을 클릭한다.
아래는 item 등록화면이다. 각 설정값 등록후 저장한다.
일반적으로 아래 값맊 셋팅하면 된다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
20 / 36
Parameter Description
Host Select the host or template.
Name Item 명
Type
Zabbix agent – for passive checks (Zabbix Server 의 요청에 의해 데이터 수집)
Zabbix agent(active) – for active checks (agent 가 주기적으로 데이터 젂송)
자세한정보는 아래 url 참고.
https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes
Key
모니터링 항목
‘4.1 모니터링 항목’ 참고.
4.2.3. Trigger 등록
Host 관리 메뉴 : Configuration > Hosts 의 Host 목록 화면에서 „Triggers‟ 링크를 클릭한다.
아래는 Trigger 관리 화면이다. 우측 상단의 „Create trigger‟ 버튺을 클릭한다
아래는 Trigger 등록 화면이다. 설정 값 설정 후 저장한다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
21 / 36
Parameter Description
Name Trigger name.
Expression Logical expression used for calculating the trigger state.
Multiple PROBLEM
events generation
Check : 매 알람상황(event)을 발생시킨다.
Uncheck : 최초 알람상황맊 기록된다.
Comments Trigger comment
URL 알람 상황에 대한 링크정보를 제공하기 위해 설정한다.
Severity 알람의 수준을 명시한다.
Enabled Trigger 사용여부
4.2.4. Action 등록
Action 관리 메뉴 : Configuration > Actions.
아래는 Action 관리 화면이다. 우측 상단의 „Create Action‟ 버튺을 클릭한다
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
22 / 36
아래는 Action 등록 화면이다.
Action Tab 화면 : 알람 젂송 메시지를 설정한다.
Parameter Description
Name Unique action name.
Default operation step
duration
(minimum 60 seconds)
기본 알람 젂송 Term 시갂 ( 300 이면 5분마다 알람을 젂송한다)
Default subject 알람 제목.
Default message 알람 내용.
Recovery message Check : Trigger 가 정상상태일 때 메시지를 젂송한다.
Recovery subject Recovery message subject.
Recovery message Recovery message.
Enabled 알람 젂송 사용 여부.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
23 / 36
Conditions Tab 화면 : 어떤 Trigger 에 대한 알람을 젂송할것인지 설정.
위는 host 가 maintenance 상태에 있지 않고, Trigger 상태가 „PROBLEM‟ 이면서 Trigger 이름에 CPU
가 포함된 조건의 알람이 발생하면 메시지를 젂송하겠다는 설정이다.
Operations Tab 화면
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
24 / 36
Parameter Description
Step
알람 젂송(Escalation) schedule:
알람 발생 From 회수부터 To (0=infinity, execution will not be limited) 회수까
지 Step duration (0=use default period)초 갂격으로 젂송한다.
Operation
type
Send message – 알람발생후 메시지 발송 수행.
Remote command – 알람발생후 특정 명령 수행.
Conditions
Condition for executing operation:
Not ack - only when the event is unacknowledged
Ack - only when the event is acknowledged
Operation type: send message
Send to user
groups
알람 메시지 수싞 대상 그룹 설정.
Send to users 알람 메시지 수싞자 설정.
Send only to 메일을 발송할건지, SMS로 발송할건지 등등 설정.
Default
message
Action tab 에서 설정한 default message 를 발송할건지 여부.
Subject Subject of the custom message.
Message The custom message.
Operation type: remote command
Target list Command 를 수행할 대상 호스트 설정.
Type Command type 설정.
Commands 수행할 명령 설정.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
25 / 36
5. 프로세스 모니터링 등록 및 확인 방법
5.1. 프로세스 모니터링 등록
Host 등록은 ‘4.2.1 host 등록 방법’ 참고
Item 등록
아래는 TestServer 에서 커맨드라인에 ‘server=jboss’ 가 포함된 프로세스 수를 모니터링하기 위한
Item 등록화면이다. 아래와 같이 등록하면, 60 초마다 해당 프로세스 개수가 기록된다.
Item key : proc.num[,,,server=jboss]
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
26 / 36
Trigger 등록
아래는 이젂에 등록한 item 을 이용해 60 초 동안 평균 프로세스 개수가 0 이면 알람(Trigger event)
가 발생하도록 설정한 화면이다.
위 화면의 Expression 이 중요한데, 직접 수기로 작성할수도 있고. 아래처럼 Add 버튺을 이용한
등록화면을 이용할수 있다.
Expression 에서 사용할수 있는 다양한 함수들이 제공된다. 다음 url 을 참고하세요.
https://www.zabbix.com/documentation/2.0/manual/config/triggers/expression
Acion 등록 „4.2.4 Acion 등록‟ 참고.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
27 / 36
5.2. 프로세스 모니터링 확인방법
5.2.1. Monitoring > Latest data
아래 Monitoring > Latest data 화면을 통해서 서버별 설정된 item 데이터들이 잘 수집되는지 확인할
수 있다.
History를 이용해 그 동안 수집된 데이터 이력을 모두 확인 가능하다.
5.2.2. Monitoring > Triggers
최근 알람발생(Trigger Event)한 Trigger 목록을 확인할수 있다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
28 / 36
5.2.3. Monitoring > Events
모든 알람발생(Trigger Event) 이력을 확인할수 있다.
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
29 / 36
6. 구성시 주의사항
6.1. Zabbix server 웹접속이 안될때
Zabbix 공식사이트에서 제공하는 설치 문서중 php 카피하는 아래 명령으로 하면 안됨.
mkdir <htdocs>/zabbix
cd frontends/php
cp -a . <htdocs>/zabbix
마지막 카피 명령을 „cp –R . <htdocs>/zabbix‟ 로 작업해야 함.
6.2. Zabbix server deamon 이 start 되지 못하는경우
Zabbix_server.conf 파일의 „LogFile‟, „PidFile‟ 경로 설정에 권한을 확인하세요.
6.3. Zabbix server is not running 메시지 발생시
Zabbix Server Web UI 에서 „Zabbix server is running….‟메시지가 나오는 경우 Zabbix Server 의 10051
포트 Listen 중인지 or 접근 가능한지 방화벽을 확인해야함.
그럼에도 메시지가 계속 보인다면.
아래 명령을 통해 웹서버가 network connection 을 할수 있는 권한을 부여해야 한다.
setsebool -P httpd_can_network_connect 1
관련 url : http://archives.ryandaigle.com/articles/2005/9/27/mythweb-howto-fix-fsockopen-function-
fsockopen-unable-to-connect-to-127-0-0-1-6543-permission-denied-error
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
30 / 36
7. HAProx 개요
Haproxy는 오픈소스 기반의 SLB (Server Load Balance) 솔루션입니다. 기존의 하드웨어 방식의 로드
발란스 기능을 제공하며 설치 및 서비스의 구성이 갂단하며 서비스의 이중화 구현 또한 빠르게 구
성할수 있습니다. 이젂부터 리눅스에서는 ipvsadm이나 Pirania를 제공함으로써 SLB구현에 대한
기능을 제공하였습니다. 최근에는 포탈 회사 같은 곳에서 haproxy를 이용하여 성공적인 서비스를
구현한 사례들도 맋이 소개되고 있습니다.
HAproxy 는 GPL General Public License version 2하에 작성 및 배포되었으며, 소스 코드는 자유롭게
배포 및 누구나 사용할수 있습니다.
7.1. 설치 환경
 Red Hat Enterprise Linux Server release 6.4
 Ubuntu 13.0.4 Raring Ringtail
 Haproxy 1.4.22
 JBOSS EWS, jBoss EAP6
 Base configuration : Round-Robin
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
31 / 36
8. HAProxy 설치 방법
HAProxy 설치방법은 아래와 같이 짂행합니다.
.
 Haproxy 소스 다운로드 (http://haproxy.1wt.eu/)
 컴파일 및 설치
 Haproxy 사용자 및 그룹생성
 SLB 설정 (/etc/haproxy/haproxy.conf)
8.1. HAproxy 사용자 계정 생성
아래 명령으로 haproxy user 생성 (by root)
$ groupadd haproxy
$ useradd –g haproxy haproxy
8.2. haproxy 설치
haproxy를 설치하는 과정은 우분투 13.0.4 버젂의 경우 apt-get repository에서도 손쉽게 다운로드
받아서 설치할수 있습니다..
Ubuntu 13.0.4 Raring Ringtail
$ sudo apt-get install haproxy
Wget을 이용한 haproxy source 다운로드 받으실수 있습니다.
$ wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.24.tar.gz
8.3. haproxy 설치
아래와 같이 컴파일 과정을 짂행합니다. (설치젂 README 파일을 참고하시기 바랍니다.)
tar xvfz haproxy-1.4.24.tar.gz
$ cd harproxy-1.4.22
$ make TARGET=linux26 ARCH=x86_64
$ make install
$ cd examples
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
32 / 36
$ cp haproxy.init /etc/rc.d/init.d/haproxy
$ chmod 755 /etc/rc.d/init.d/haproxy
$ mkdir -p /etc/haproxy/
$ cp /생성위치/haproxy-1.4.24/examples/haproxy.cfg /etc/haproxy/
$ mkdir -p /etc/haproxy/errors/
$ cp /생성위치/haproxy-1.4.24/examples/errorfiles/* /etc/haproxy/errors/
$ cd /usr/sbin
$ ln -s /usr/local/haproxy/sbin/haproxy haproxy
$ vi /etc/haproxy/haproxy.cfg
8.4. haproxy 기본설정
8.4.1. haproxy.conf 파일 수정
아래의 생성된 경로에 haproxy.conf 파일을 수정합니다.
 /etc/haproxy/haproxy.conf
아래와 같이 수정하여 SLB 설정을 짂행합니다. (기본적인 구현은 가능합니다)
# this config needs haproxy-1.1.28 or haproxy-1.2.1
# vm1 192.168.0.211
# vm2 192.168.0.212
# LB 192.168.0.200
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
33 / 36
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen webfarm 192.168.0.200:80
mode http
stats enable
stats auth us3r:passw0rd
balance roundrobin
option httpchk HEAD / HTTP/1.0
option forwardfor
cookie LSW_WEB insert
option httpclose
stats enable
stats auth hslee:dlghtjd77
stats /admin
server web01 192.168.0.211:80 cookie LSW_WEB01 check inter 2000 rise 2 fall 5
server web02 192.168.0.212:80 cookie LSW_WEB02 checck inter 2000 rise 2 fall 5
Ubuntu 13.0.4 설정
ubuntu 에서는 아래와 같이 /etc/default/haproxy 설정을 짂행합니다.
$ # Set ENABLED to 1 if you want the init script to start haproxy.
ENABLED=1
# Add extra flags here.
#EXTRAOPTS="-de -m 16"
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
34 / 36
haproxy deamon 가동
$ sudo service haproxy start - 우분투 리눅스에서 데몬 가동
$ service haproxy start  RHEL 또는 CentOS 데몬 가동
Haproxy 옵션
Haproxy 에서 사용하게 되는 옵션의 경우 아래의 아래의 사이트를 참조하시면 더 맋은 정보를 확인
하실수 있습니다. haproxy 에서 사용하는 옵션의 경우 크게 global 옵션과 default 옵션을 나누게
됩니다.
 code.google.com/p/haproxy-docs/wiki/monitor_uri
- Global 및 Default 섹션에 기본으로 적용되는 옵션-
daemon: 백그라운드 모드(background mode)로 실행
log: syslog 설정
log-send-hostname: 로그를 보낼 hostname 설정
uid: 프로세스의 userid 를 number 로 변경
user: 프로세스의 user name 지정
gid : 프로세스의 groupid 를 number 로 변경
group : 프로세스의 group name 지정
node: 두 개 이상의 프로세스나 서버가 같은 IP 주소를 공유할 때 name 설정(HA 설정)
maxconn: 프로세스당 최대 연결 개수
pidfile <pidfile> : haprox y 가동시 모든 데몬에 pid 를 <pidfile>안에 작성
ulimit –n <number> : 각 프로세스 file-descriptor 를 조정, 자동적으로 계산하여 적용하기 때문에
haproxy 에서는 사용하지 않는 것을 권장.
pidfile <pidfile> : haproxy 가동시 모든 데몬에 pid 를 <pidfile>안에 작성
- Listen 섹션 기본적용 옵션
Listen Webfarm 192.168.0.200:80 : 서비스 IP 및 포트지정
mode http: 연결 프로토콜 지정
option httpchk: health check 연결하고자 하는 프로토콜의 health check 지정
option log-health-checks: health 체크 로그기록
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
35 / 36
option forwardfor: 클라이언트 정보 젂달 (접속한 클라이언트의 브라우져 정보등이 기록)
option httpclose: keep-alive 문제 발생 시 off 옵션
( SLB 서버의 메모리를 과도하게 사용하게 되는 경우도 발생)
cookie SERVERID rewrite: 쿠키로 서버 구별 시 사용 여부
cookie JSESSIONID prefix: HA 구성 시 prefix 이후에 서버 정보 주입 여부
balance roundrobin: 순홖 분배 방식
stats enable: 서버 상태 보기 가능 여부
stats uri /admin: 서버 상태 보기 웹페이지로 서버의 상태를 확인 가능
stats auth [계정]:[패스워드] : 서버 상태보기 웹페이지에 접근할 때 사용자 인증처리
8.4.2. haproxy 상태확인하기
haproxy에 등록된 서버들에 대한 상태들을 보기 위해서 아래와 같이 대표 서비스 IP에 /admin 을
접근하면 아래와 같이 등록된 서버들에 대한 모니터링 페이지를 확인할수 있습니다.
 http://192.168.0.200/admin
 최초 접속하게 되면 인증 페이지가 나타나게 됩니다.
 /etc/haproxy/haproxy.conf 파일에 stats auth [계정] : [패스워드]에 정의한 정보입니다
Zabbix & haproxy Install Guide
ooo 구축
000-01 V1.0 2013-07-16 이호성
36 / 36

Weitere ähnliche Inhalte

Was ist angesagt?

[오픈소스컨설팅]초간단 Cubrid HA구성
[오픈소스컨설팅]초간단 Cubrid HA구성[오픈소스컨설팅]초간단 Cubrid HA구성
[오픈소스컨설팅]초간단 Cubrid HA구성Ji-Woong Choi
 
Db프로그래밍 환경 설정(131062 장택순)
Db프로그래밍 환경 설정(131062 장택순)Db프로그래밍 환경 설정(131062 장택순)
Db프로그래밍 환경 설정(131062 장택순)TaekSoon Jang
 
[오픈소스컨설팅]MySQL Monitoring
[오픈소스컨설팅]MySQL Monitoring[오픈소스컨설팅]MySQL Monitoring
[오픈소스컨설팅]MySQL MonitoringJi-Woong Choi
 
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1Ji-Woong Choi
 
[오픈소스컨설팅]스카우터엑스 소개
[오픈소스컨설팅]스카우터엑스 소개[오픈소스컨설팅]스카우터엑스 소개
[오픈소스컨설팅]스카우터엑스 소개Open Source Consulting
 
MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항I Goo Lee
 
CentOS 에 MySQL 5.6 설치
CentOS 에 MySQL 5.6 설치CentOS 에 MySQL 5.6 설치
CentOS 에 MySQL 5.6 설치Young D
 
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3Ji-Woong Choi
 
Enterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_bootingEnterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_bootingsuk kim
 
Spring 웹 프로젝트 시작하기
Spring 웹 프로젝트 시작하기Spring 웹 프로젝트 시작하기
Spring 웹 프로젝트 시작하기jiseob kim
 
20141229 dklee docker
20141229 dklee docker20141229 dklee docker
20141229 dklee dockerDK Lee
 
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편Ji-Woong Choi
 
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트Ji-Woong Choi
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례I Goo Lee
 
[오픈소스컨설팅]systemd on RHEL7
[오픈소스컨설팅]systemd on RHEL7[오픈소스컨설팅]systemd on RHEL7
[오픈소스컨설팅]systemd on RHEL7Ji-Woong Choi
 
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOI Goo Lee
 
vert.x 를 활용한 분산서버 개발하기
vert.x 를 활용한 분산서버 개발하기vert.x 를 활용한 분산서버 개발하기
vert.x 를 활용한 분산서버 개발하기John Kim
 
클라우드/IDC 운영자를 위한 서버 모니터링(Server monitoring) 솔루션 (old version)
클라우드/IDC 운영자를 위한 서버 모니터링(Server monitoring) 솔루션 (old version)클라우드/IDC 운영자를 위한 서버 모니터링(Server monitoring) 솔루션 (old version)
클라우드/IDC 운영자를 위한 서버 모니터링(Server monitoring) 솔루션 (old version)옥시즌
 
Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Ji-Woong Choi
 
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기KTH, 케이티하이텔
 

Was ist angesagt? (20)

[오픈소스컨설팅]초간단 Cubrid HA구성
[오픈소스컨설팅]초간단 Cubrid HA구성[오픈소스컨설팅]초간단 Cubrid HA구성
[오픈소스컨설팅]초간단 Cubrid HA구성
 
Db프로그래밍 환경 설정(131062 장택순)
Db프로그래밍 환경 설정(131062 장택순)Db프로그래밍 환경 설정(131062 장택순)
Db프로그래밍 환경 설정(131062 장택순)
 
[오픈소스컨설팅]MySQL Monitoring
[오픈소스컨설팅]MySQL Monitoring[오픈소스컨설팅]MySQL Monitoring
[오픈소스컨설팅]MySQL Monitoring
 
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
[오픈소스컨설팅]Nginx 1.2.7 설치가이드__v1
 
[오픈소스컨설팅]스카우터엑스 소개
[오픈소스컨설팅]스카우터엑스 소개[오픈소스컨설팅]스카우터엑스 소개
[오픈소스컨설팅]스카우터엑스 소개
 
MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항MySQL_Fabric_운영시유의사항
MySQL_Fabric_운영시유의사항
 
CentOS 에 MySQL 5.6 설치
CentOS 에 MySQL 5.6 설치CentOS 에 MySQL 5.6 설치
CentOS 에 MySQL 5.6 설치
 
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
[오픈소스컨설팅] 아파치톰캣 운영가이드 v1.3
 
Enterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_bootingEnterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_booting
 
Spring 웹 프로젝트 시작하기
Spring 웹 프로젝트 시작하기Spring 웹 프로젝트 시작하기
Spring 웹 프로젝트 시작하기
 
20141229 dklee docker
20141229 dklee docker20141229 dklee docker
20141229 dklee docker
 
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
 
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례
 
[오픈소스컨설팅]systemd on RHEL7
[오픈소스컨설팅]systemd on RHEL7[오픈소스컨설팅]systemd on RHEL7
[오픈소스컨설팅]systemd on RHEL7
 
MySQL Deep dive with FusionIO
MySQL Deep dive with FusionIOMySQL Deep dive with FusionIO
MySQL Deep dive with FusionIO
 
vert.x 를 활용한 분산서버 개발하기
vert.x 를 활용한 분산서버 개발하기vert.x 를 활용한 분산서버 개발하기
vert.x 를 활용한 분산서버 개발하기
 
클라우드/IDC 운영자를 위한 서버 모니터링(Server monitoring) 솔루션 (old version)
클라우드/IDC 운영자를 위한 서버 모니터링(Server monitoring) 솔루션 (old version)클라우드/IDC 운영자를 위한 서버 모니터링(Server monitoring) 솔루션 (old version)
클라우드/IDC 운영자를 위한 서버 모니터링(Server monitoring) 솔루션 (old version)
 
Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드
 
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
[H3 2012] 내컴에선 잘되던데? - vagrant로 서버와 동일한 개발환경 꾸미기
 

Andere mochten auch

[제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE
[제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE  [제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE
[제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE 흥래 김
 
Introduce Google Kubernetes
Introduce Google KubernetesIntroduce Google Kubernetes
Introduce Google KubernetesYongbok Kim
 
Now and Future of APM
Now and Future of APMNow and Future of APM
Now and Future of APMcowboy93
 
별천지세미나(2회) 세션5 hamlet
별천지세미나(2회) 세션5 hamlet별천지세미나(2회) 세션5 hamlet
별천지세미나(2회) 세션5 hamletJongKwang Kim
 
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOSConfd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS충섭 김
 
클라우드 춘추전국시대 서버 개발자 생존기
클라우드 춘추전국시대 서버 개발자 생존기클라우드 춘추전국시대 서버 개발자 생존기
클라우드 춘추전국시대 서버 개발자 생존기iFunFactory Inc.
 
[Hello world 오픈세미나]varnish로 웹서버성능 향상시키기
[Hello world 오픈세미나]varnish로 웹서버성능 향상시키기[Hello world 오픈세미나]varnish로 웹서버성능 향상시키기
[Hello world 오픈세미나]varnish로 웹서버성능 향상시키기NAVER D2
 
Jco14 오픈소스를 이용한 모니터링 방법
Jco14 오픈소스를 이용한 모니터링 방법Jco14 오픈소스를 이용한 모니터링 방법
Jco14 오픈소스를 이용한 모니터링 방법정수 한
 
MariaDB Optimization
MariaDB OptimizationMariaDB Optimization
MariaDB OptimizationJongJin Lee
 
Monitoring System Targeting OpenStack, Baremetal, and Network Fabric
Monitoring System Targeting OpenStack, Baremetal, and Network FabricMonitoring System Targeting OpenStack, Baremetal, and Network Fabric
Monitoring System Targeting OpenStack, Baremetal, and Network FabricJaesuk Ahn
 
Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법Minchul Jung
 
H3 2011 대형사이트 구축을 위한 MySQL 튜닝전략
H3 2011 대형사이트 구축을 위한 MySQL 튜닝전략H3 2011 대형사이트 구축을 위한 MySQL 튜닝전략
H3 2011 대형사이트 구축을 위한 MySQL 튜닝전략KTH
 
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례NAVER LABS
 
조대협의 서버 사이드 - 대용량 아키텍처와 성능튜닝
조대협의 서버 사이드 - 대용량 아키텍처와 성능튜닝조대협의 서버 사이드 - 대용량 아키텍처와 성능튜닝
조대협의 서버 사이드 - 대용량 아키텍처와 성능튜닝Mungyu Choi
 
안정적인 서비스 운영 2014.03
안정적인 서비스 운영   2014.03안정적인 서비스 운영   2014.03
안정적인 서비스 운영 2014.03Changyol BAEK
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우jieunsys
 
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!pyrasis
 
[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble Shooting
[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble Shooting[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble Shooting
[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble ShootingJi-Woong Choi
 

Andere mochten auch (18)

[제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE
[제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE  [제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE
[제14회 JCO 컨퍼런스] 개발자를 위한 서버이중화 by JAVACAFE
 
Introduce Google Kubernetes
Introduce Google KubernetesIntroduce Google Kubernetes
Introduce Google Kubernetes
 
Now and Future of APM
Now and Future of APMNow and Future of APM
Now and Future of APM
 
별천지세미나(2회) 세션5 hamlet
별천지세미나(2회) 세션5 hamlet별천지세미나(2회) 세션5 hamlet
별천지세미나(2회) 세션5 hamlet
 
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOSConfd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
 
클라우드 춘추전국시대 서버 개발자 생존기
클라우드 춘추전국시대 서버 개발자 생존기클라우드 춘추전국시대 서버 개발자 생존기
클라우드 춘추전국시대 서버 개발자 생존기
 
[Hello world 오픈세미나]varnish로 웹서버성능 향상시키기
[Hello world 오픈세미나]varnish로 웹서버성능 향상시키기[Hello world 오픈세미나]varnish로 웹서버성능 향상시키기
[Hello world 오픈세미나]varnish로 웹서버성능 향상시키기
 
Jco14 오픈소스를 이용한 모니터링 방법
Jco14 오픈소스를 이용한 모니터링 방법Jco14 오픈소스를 이용한 모니터링 방법
Jco14 오픈소스를 이용한 모니터링 방법
 
MariaDB Optimization
MariaDB OptimizationMariaDB Optimization
MariaDB Optimization
 
Monitoring System Targeting OpenStack, Baremetal, and Network Fabric
Monitoring System Targeting OpenStack, Baremetal, and Network FabricMonitoring System Targeting OpenStack, Baremetal, and Network Fabric
Monitoring System Targeting OpenStack, Baremetal, and Network Fabric
 
Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법
 
H3 2011 대형사이트 구축을 위한 MySQL 튜닝전략
H3 2011 대형사이트 구축을 위한 MySQL 튜닝전략H3 2011 대형사이트 구축을 위한 MySQL 튜닝전략
H3 2011 대형사이트 구축을 위한 MySQL 튜닝전략
 
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
 
조대협의 서버 사이드 - 대용량 아키텍처와 성능튜닝
조대협의 서버 사이드 - 대용량 아키텍처와 성능튜닝조대협의 서버 사이드 - 대용량 아키텍처와 성능튜닝
조대협의 서버 사이드 - 대용량 아키텍처와 성능튜닝
 
안정적인 서비스 운영 2014.03
안정적인 서비스 운영   2014.03안정적인 서비스 운영   2014.03
안정적인 서비스 운영 2014.03
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우
 
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
도커 무작정 따라하기: 도커가 처음인 사람도 60분이면 웹 서버를 올릴 수 있습니다!
 
[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble Shooting
[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble Shooting[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble Shooting
[오픈소스컨설팅]Day #3 MySQL Monitoring, Trouble Shooting
 

Ähnlich wie Zabbix haproxy configuration_guide

Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11Dongil Yeom
 
PCF Installation Guide
PCF Installation GuidePCF Installation Guide
PCF Installation Guideseungdon Choi
 
20141029 하둡2.5와 hive설치 및 예제
20141029 하둡2.5와 hive설치 및 예제20141029 하둡2.5와 hive설치 및 예제
20141029 하둡2.5와 hive설치 및 예제Tae Young Lee
 
Internship backend
Internship backendInternship backend
Internship backendYein Sim
 
CentOS 5.3에 Cubrid 설치 방법
CentOS 5.3에 Cubrid 설치 방법CentOS 5.3에 Cubrid 설치 방법
CentOS 5.3에 Cubrid 설치 방법phpkorea
 
리눅스서버세팅-김태호
리눅스서버세팅-김태호리눅스서버세팅-김태호
리눅스서버세팅-김태호ETRIBE_STG
 
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치Aiden Seonghak Hong
 
ELC(Embarcadero License Center) 서버 설치가이드
ELC(Embarcadero License Center) 서버 설치가이드ELC(Embarcadero License Center) 서버 설치가이드
ELC(Embarcadero License Center) 서버 설치가이드Devgear
 
oVirt installation guide_v4.3
oVirt installation guide_v4.3oVirt installation guide_v4.3
oVirt installation guide_v4.3CheolHee Han
 
도커없이 컨테이너 만들기 1편
도커없이 컨테이너 만들기 1편도커없이 컨테이너 만들기 1편
도커없이 컨테이너 만들기 1편Sam Kim
 
도구를 활용한 더 나은 웹 개발: Yeoman
도구를 활용한 더 나은 웹 개발: Yeoman도구를 활용한 더 나은 웹 개발: Yeoman
도구를 활용한 더 나은 웹 개발: YeomanJae Sung Park
 
Virtual Development Environment Setting
Virtual Development Environment SettingVirtual Development Environment Setting
Virtual Development Environment SettingKwangyoun Jung
 
Kubuntu 9.10에 Cubrid 8.2.0.2005 Linux
Kubuntu 9.10에 Cubrid 8.2.0.2005 LinuxKubuntu 9.10에 Cubrid 8.2.0.2005 Linux
Kubuntu 9.10에 Cubrid 8.2.0.2005 Linuxphpkorea
 
취약점 점검도구 실습 보고서
취약점 점검도구 실습 보고서 취약점 점검도구 실습 보고서
취약점 점검도구 실습 보고서 Dong-Jin Park
 
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기Ted Won
 
Docker란 무엇인가? : Docker 기본 사용법
Docker란 무엇인가? : Docker 기본 사용법Docker란 무엇인가? : Docker 기본 사용법
Docker란 무엇인가? : Docker 기본 사용법pyrasis
 
postgres_빌드_및_디버깅.pdf
postgres_빌드_및_디버깅.pdfpostgres_빌드_및_디버깅.pdf
postgres_빌드_및_디버깅.pdfLee Dong Wook
 
Posquit0 - Fabric을 이용한 ssh streamlining
Posquit0 - Fabric을 이용한 ssh streamliningPosquit0 - Fabric을 이용한 ssh streamlining
Posquit0 - Fabric을 이용한 ssh streamliningByungjin Park
 

Ähnlich wie Zabbix haproxy configuration_guide (20)

Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
Udamp3 django apache-my_sql_python3_ubuntu14.04-v11
 
PCF Installation Guide
PCF Installation GuidePCF Installation Guide
PCF Installation Guide
 
20141029 하둡2.5와 hive설치 및 예제
20141029 하둡2.5와 hive설치 및 예제20141029 하둡2.5와 hive설치 및 예제
20141029 하둡2.5와 hive설치 및 예제
 
Internship backend
Internship backendInternship backend
Internship backend
 
CentOS 5.3에 Cubrid 설치 방법
CentOS 5.3에 Cubrid 설치 방법CentOS 5.3에 Cubrid 설치 방법
CentOS 5.3에 Cubrid 설치 방법
 
리눅스서버세팅-김태호
리눅스서버세팅-김태호리눅스서버세팅-김태호
리눅스서버세팅-김태호
 
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
RHive tutorial supplement 1: RHive 튜토리얼 부록 1 - Hadoop 설치
 
ELC(Embarcadero License Center) 서버 설치가이드
ELC(Embarcadero License Center) 서버 설치가이드ELC(Embarcadero License Center) 서버 설치가이드
ELC(Embarcadero License Center) 서버 설치가이드
 
oVirt installation guide_v4.3
oVirt installation guide_v4.3oVirt installation guide_v4.3
oVirt installation guide_v4.3
 
테스트
테스트테스트
테스트
 
도커없이 컨테이너 만들기 1편
도커없이 컨테이너 만들기 1편도커없이 컨테이너 만들기 1편
도커없이 컨테이너 만들기 1편
 
도구를 활용한 더 나은 웹 개발: Yeoman
도구를 활용한 더 나은 웹 개발: Yeoman도구를 활용한 더 나은 웹 개발: Yeoman
도구를 활용한 더 나은 웹 개발: Yeoman
 
Virtual Development Environment Setting
Virtual Development Environment SettingVirtual Development Environment Setting
Virtual Development Environment Setting
 
Kubuntu 9.10에 Cubrid 8.2.0.2005 Linux
Kubuntu 9.10에 Cubrid 8.2.0.2005 LinuxKubuntu 9.10에 Cubrid 8.2.0.2005 Linux
Kubuntu 9.10에 Cubrid 8.2.0.2005 Linux
 
취약점 점검도구 실습 보고서
취약점 점검도구 실습 보고서 취약점 점검도구 실습 보고서
취약점 점검도구 실습 보고서
 
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
JCO 11th 클라우드 환경에서 Java EE 운영 환경 구축하기
 
Docker란 무엇인가? : Docker 기본 사용법
Docker란 무엇인가? : Docker 기본 사용법Docker란 무엇인가? : Docker 기본 사용법
Docker란 무엇인가? : Docker 기본 사용법
 
Lam pstack
Lam pstackLam pstack
Lam pstack
 
postgres_빌드_및_디버깅.pdf
postgres_빌드_및_디버깅.pdfpostgres_빌드_및_디버깅.pdf
postgres_빌드_및_디버깅.pdf
 
Posquit0 - Fabric을 이용한 ssh streamlining
Posquit0 - Fabric을 이용한 ssh streamliningPosquit0 - Fabric을 이용한 ssh streamlining
Posquit0 - Fabric을 이용한 ssh streamlining
 

Mehr von sprdd

Linux con europe_2014_full_system_rollback_btrfs_snapper_0
Linux con europe_2014_full_system_rollback_btrfs_snapper_0Linux con europe_2014_full_system_rollback_btrfs_snapper_0
Linux con europe_2014_full_system_rollback_btrfs_snapper_0sprdd
 
Linux con europe_2014_f
Linux con europe_2014_fLinux con europe_2014_f
Linux con europe_2014_fsprdd
 
Openstack v4 0
Openstack v4 0Openstack v4 0
Openstack v4 0sprdd
 
Hardware accelerated virtio networking for nfv linux con
Hardware accelerated virtio networking for nfv linux conHardware accelerated virtio networking for nfv linux con
Hardware accelerated virtio networking for nfv linux consprdd
 
난공불락세미나 Ldap
난공불락세미나 Ldap난공불락세미나 Ldap
난공불락세미나 Ldapsprdd
 
Lkda facebook seminar_140419
Lkda facebook seminar_140419Lkda facebook seminar_140419
Lkda facebook seminar_140419sprdd
 
Glusterfs 소개 v1.0_난공불락세미나
Glusterfs 소개 v1.0_난공불락세미나Glusterfs 소개 v1.0_난공불락세미나
Glusterfs 소개 v1.0_난공불락세미나sprdd
 
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415sprdd
 
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0sprdd
 
오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0sprdd
 
HP NMI WATCHDOG
HP NMI WATCHDOGHP NMI WATCHDOG
HP NMI WATCHDOGsprdd
 
H2890 emc-clariion-asymm-active-wp
H2890 emc-clariion-asymm-active-wpH2890 emc-clariion-asymm-active-wp
H2890 emc-clariion-asymm-active-wpsprdd
 
Cluster pitfalls recommand
Cluster pitfalls recommandCluster pitfalls recommand
Cluster pitfalls recommandsprdd
 
Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1sprdd
 
Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1sprdd
 
2013fooscoverpageimage 130417105210-phpapp01
2013fooscoverpageimage 130417105210-phpapp012013fooscoverpageimage 130417105210-phpapp01
2013fooscoverpageimage 130417105210-phpapp01sprdd
 
Openstackinsideoutv10 140222065532-phpapp01
Openstackinsideoutv10 140222065532-phpapp01Openstackinsideoutv10 140222065532-phpapp01
Openstackinsideoutv10 140222065532-phpapp01sprdd
 
Rhel cluster gfs_improveperformance
Rhel cluster gfs_improveperformanceRhel cluster gfs_improveperformance
Rhel cluster gfs_improveperformancesprdd
 
Doldoggi bisiri
Doldoggi bisiriDoldoggi bisiri
Doldoggi bisirisprdd
 
유닉스 리눅스 마이그레이션_이호성_v1.0
유닉스 리눅스 마이그레이션_이호성_v1.0유닉스 리눅스 마이그레이션_이호성_v1.0
유닉스 리눅스 마이그레이션_이호성_v1.0sprdd
 

Mehr von sprdd (20)

Linux con europe_2014_full_system_rollback_btrfs_snapper_0
Linux con europe_2014_full_system_rollback_btrfs_snapper_0Linux con europe_2014_full_system_rollback_btrfs_snapper_0
Linux con europe_2014_full_system_rollback_btrfs_snapper_0
 
Linux con europe_2014_f
Linux con europe_2014_fLinux con europe_2014_f
Linux con europe_2014_f
 
Openstack v4 0
Openstack v4 0Openstack v4 0
Openstack v4 0
 
Hardware accelerated virtio networking for nfv linux con
Hardware accelerated virtio networking for nfv linux conHardware accelerated virtio networking for nfv linux con
Hardware accelerated virtio networking for nfv linux con
 
난공불락세미나 Ldap
난공불락세미나 Ldap난공불락세미나 Ldap
난공불락세미나 Ldap
 
Lkda facebook seminar_140419
Lkda facebook seminar_140419Lkda facebook seminar_140419
Lkda facebook seminar_140419
 
Glusterfs 소개 v1.0_난공불락세미나
Glusterfs 소개 v1.0_난공불락세미나Glusterfs 소개 v1.0_난공불락세미나
Glusterfs 소개 v1.0_난공불락세미나
 
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
 
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
Summit2014 riel chegu_w_0340_automatic_numa_balancing_0
 
오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0오픈소스컨설팅 클러스터제안 V1.0
오픈소스컨설팅 클러스터제안 V1.0
 
HP NMI WATCHDOG
HP NMI WATCHDOGHP NMI WATCHDOG
HP NMI WATCHDOG
 
H2890 emc-clariion-asymm-active-wp
H2890 emc-clariion-asymm-active-wpH2890 emc-clariion-asymm-active-wp
H2890 emc-clariion-asymm-active-wp
 
Cluster pitfalls recommand
Cluster pitfalls recommandCluster pitfalls recommand
Cluster pitfalls recommand
 
Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1
 
Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1
 
2013fooscoverpageimage 130417105210-phpapp01
2013fooscoverpageimage 130417105210-phpapp012013fooscoverpageimage 130417105210-phpapp01
2013fooscoverpageimage 130417105210-phpapp01
 
Openstackinsideoutv10 140222065532-phpapp01
Openstackinsideoutv10 140222065532-phpapp01Openstackinsideoutv10 140222065532-phpapp01
Openstackinsideoutv10 140222065532-phpapp01
 
Rhel cluster gfs_improveperformance
Rhel cluster gfs_improveperformanceRhel cluster gfs_improveperformance
Rhel cluster gfs_improveperformance
 
Doldoggi bisiri
Doldoggi bisiriDoldoggi bisiri
Doldoggi bisiri
 
유닉스 리눅스 마이그레이션_이호성_v1.0
유닉스 리눅스 마이그레이션_이호성_v1.0유닉스 리눅스 마이그레이션_이호성_v1.0
유닉스 리눅스 마이그레이션_이호성_v1.0
 

Zabbix haproxy configuration_guide

  • 1. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 1 / 36 문서번호 : 000-01 000 구축 Zabbix & haproxy Install Guide Version 1.0 개정일자 2013-07-16 작성자 이호성
  • 2. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 2 / 36 개정 이력 버전 개정일자 1 개정사유 2 개정내역 작성자 승인자 1.0 2013-04-16 제정 최초 제정 홍길동 2.0 2013-07-16 제정 Haproxy install guide 추가 이호성 1 개정 사유: 제정 또는 개정 내용이 이젂 문서에 대해 추가/수정/삭제인지 선택 기입 2 개정 내역: 개정이 발생하는 페이지 번호와 변경 내용을 기술
  • 3. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 3 / 36 목 차 1. Zabbix 개요........................................................................................................ 4 1.1. 설치 환경..............................................................................................................................................................................4 2. Zabbix Server 설치 방법....................................................................................... 5 2.1. Zabbix 사용자 계정 생성................................................................................................................................................5 2.2. MySQL 설치.........................................................................................................................................................................5 2.3. PHP 설치...............................................................................................................................................................................5 2.4. Zabbix 소스 컴파일 및 설치..........................................................................................................................................6 2.4.1. Installing Zabbix deamons ..........................................................................6 2.4.1. Installing Zabbix frontend ...........................................................................8 3. Zabbix Agent 설치 방법 ......................................................................................14 3.1. Zabbix Agent 설정.......................................................................................................................................................... 14 3.2. Zabbix Agent Start.......................................................................................................................................................... 14 4. Zabbix 모니터링 항목 및 모니터링 방법.................................................................15 4.1. 모니터링 항목 (Item keys) .......................................................................................................................................... 15 4.2. 모니터링 방법................................................................................................................................................................... 16 4.2.1. Host 등록 방법 ...................................................................................... 17 4.2.2. Item 등록.............................................................................................. 19 4.2.3. Trigger 등록 .......................................................................................... 20 4.2.4. Action 등록 ........................................................................................... 21 5. 프로세스 모니터링 등록 및 확인 방법....................................................................25 5.1. 프로세스 모니터링 등록............................................................................................................................................... 25 5.2. 프로세스 모니터링 확인방법....................................................................................................................................... 27 5.2.1. Monitoring > Latest data........................................................................... 27 5.2.2. Monitoring > Triggers .............................................................................. 27 5.2.3. Monitoring > Events ................................................................................ 28 6. 구성시 주의사항.................................................................................................29 6.1. Zabbix server 웹접속이 안될때.................................................................................................................................. 29 6.2. Zabbix server deamon 이 start 되지 못하는경우............................................................................................... 29 6.3. Zabbix server is not running 메시지 발생시......................................................................................................... 29 7. HAProx 개요......................................................................................................30 7.1. 설치 환경........................................................................................................................................................................... 30 8. HAProxy 설치 방법.............................................................................................31 8.1. HAproxy 사용자 계정 생성.......................................................................................................................................... 31 8.2. haproxy 설치..................................................................................................................................................................... 31 8.3. haproxy 설치..................................................................................................................................................................... 31 8.4. haproxy 기본설정............................................................................................................................................................ 32 8.4.1. haproxy.conf 파일 수정 ........................................................................... 32 8.4.2. haproxy 상태확인하기 .............................................................................. 35
  • 4. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 4 / 36 1. Zabbix 개요 Zabbix 는 엔터프라이즈급 오픈소스 분산 모니터링 솔루션이다. Zabbix 는 네트워크와 서버의 상태 및 무결성의 다양한 매개변수를 모니터링하는 소프트웨어 입니 다. Zabbix는 사용자로 하여금 거의 모든 이벤트에 대해 e-mail 기반 알림을 설정 할수 있도록 하 는 유연한 알림 메커니즘을 사용합니다. 이것은 서버 문제데 대하나 빠른 대응을 할수 있게 합니 다. Zabbix 는 저장된 데이터를 기반으로 뛰어난 리포팅 및 데이터 시각화 기능을 제공합니다. Zabbix 는 polling 및 trapping 을 모두 지원합니다. 모든 Zabbix 보고서 및 통계뿐맊 아니라, 설정 정보들을 웹UI 를 통해 액세스 할수 있습니다. Zabbix 는 GPL General Public License version 2하에 작성 및 배포되었으며, 소스 코드는 자유롭게 배포 및 누구나 사용할수 있습니다. 1.1. 설치 환경  Red Hat Enterprise Linux Server release 6.3  Zabbix 2.0.5  PHP 5.3.3  MySQL 5.1.67
  • 5. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 5 / 36 2. Zabbix Server 설치 방법 Zabbix Server 설치 작업 순서는 다음과 같다.  Zabbix 사용자 계정 생성  MySQL 설치  php 설치  Zabbix 소스 컴파일 및 설치 2.1. Zabbix 사용자 계정 생성 아래 명령으로 zabbix user 생성 (by root) $ groupadd zabbix $ useradd –g zabbix zabbix 2.2. MySQL 설치 Zabbix Server 는 모니터링 수집데이터를 저장하기위해서 데이터베이스가 필요하다. 아래 명령으로 설치 (by root) $ yum -y install mysql mysql-server mysql-devel 설치완료후 mysql 데몬을 실행한다. (by root) $ service mysqld start 2.3. PHP 설치 Zabbix Server 웹 UI 는 PHP 로 개발되어있음으로 PHP 모듈 및 PHP extensions 를 설치해야 한다. 아래 명령으로 설치 (by root) $ yum install php $ yum install php-mysql $ yum install php-bcmath $ yum install php-mbstring $ yum install php-gd 웹서버는 리눅스에 기본적으로 설치되어 있는 httpd 를 사용한다.
  • 6. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 6 / 36 2.4. Zabbix 소스 컴파일 및 설치 2.4.1. Installing Zabbix deamons Download the source archive 아래 url 에서 최싞버젂의 소스를 다운받는다.  http://www.zabbix.com/download.php 다운받은후 다음과같이 압축을 푼다. (by zabbix) $ tar –zxvf zabbix-2.0.5.tar.gz // 현재 directory 에 zabbix-2.0.5 drectory 가 생성됨. Create Zabbix database MySQL 에 Zabbix 가 사용할 db schema 및 기본 dataset 을 입력한다. (by root) $ mysql mysql> create database zabbix; mysql>exit; $ cd /home/zabbix/zabbix-2.0.5/database/mysql $ mysql –uroot –p zabbix < ./schema.sql $ mysql –uroot –p zabbix < ./images.sql $ mysql –uroot –p zabbix < ./data.sql Configure the sources 설치 directory 생성후 소스 컴파일을 위한 설정을 실행한다. (by zabbix) $ cd /home/zabbix $ mkdir ./server $ cd /home/zabbix/zabbix-2.0.5 $ ./configure --prefix=/home/zabbix/server --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl. 작업중 curl 및 snmp 관련 에러가 발생하면 다음 모듈을 추가 설치한다. (by root) $ yum install curl curl-devel $ yum install net-snmp-devel
  • 7. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 7 / 36 Make and install 최종 컴파일 및 설치를 실행한다. (by zabbix) $ make install 앞선 ./configure –-prefix 로 지정한 /home/zabbix/server 에 Zabbix server deamon 이 설치된다. Zabbix server 설정파일은 /home/zabbix/server/etc/zabbix_server.conf 이다. Database name, user and password 등이 설정되어 있다. Start up the daemons 다음과 같이 zabbix server deamon 을 실행한다.(by zabbix) $ /home/zabbix/server/sbin/zabbix_server –c /home/zabbix/server/etc/zabbix_server.conf // 아래는 종료 script $ ps -ef | grep "zabbix_server" | awk {'print "kill -9 " $2'} | sh -x -c 옵션으로 설정파일을 지정한다. 지정하지 않으면 /usr/local/etc/zabbix_server.conf 를 찾는다. Ps –ef | grep zabbix 명령으로 데몬이 실행되었는지 확인다.
  • 8. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 8 / 36 2.4.1. Installing Zabbix frontend Copying PHP files Zabbix frontend(WEB UI) 는 PHP 로 작성되었다. 따라서 PHP가 지원되는 웹서버가 필요하다. 웹서버 가 설치되어 있다면 단순히 Zabbix 소스의 frontends/php 의 PHP 파일들을 웹서버의 document root 디렉토리에 카피맊하면 된다. 일반적으로 OS별 아파치 웹서버의 document root 위치는 다음과 같다.  /usr/local/apache2/htdocs (default directory when installing Apache from source)  /srv/www/htdocs (OpenSUSE, SLES)  /var/www/html (Fedora, RHEL, CentOS)  /var/www (Debian, Ubuntu) 카피하기 젂에 먼저 zabbix 서브 디렉토리를 생성후 그안에 php파일들을 카피한다. (by root) $ cd /var/www/html $ mkdir zabbix $ cd /home/zabbix/zabbix-2.0.5/frontends/php $ cp –R . /var/www/html/zabbix 웹서버(httpd)가 실행되어 있지 않다면 실행한다. (service httpd start) Installing frontend Step1 브라우저로 http://<server_ip_or_name>/zabbix 로 접속하면 아래와 같은 화면을 볼수 있다.
  • 9. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 9 / 36 Step2 다음 화면에서는 PHP 관련 필요 설정상태를 보여준다. 맊일 fail 되어있는 항목이 있다면 설정 및 관련 설치를 통해 해결해야 한다. 아래를 참고하세요. Pre-requisite Minimum value Description PHP version 5.1.6 PHP memory_limit option 128MB In php.ini: memory_limit = 128M PHP post_max_size option 16MB In php.ini: post_max_size = 16M PHPupload_max_filesize option 2MB In php.ini: upload_max_filesize = 2M PHPmax_execution_time option 300 seconds In php.ini: max_execution_time = 300 PHP max_input_time option 300 seconds In php.ini: max_input_time = 300 PHPsession.auto_start option must be disabled In php.ini: session.auto_start = 0. Required since Zabbix 2.0.4 version. Database support One of: IBM DB2, MySQL, Oracle, PostgreSQL, SQLite One of the following modules must be installed: ibm_db2, mysql, oci8, pgsql, sqlite3 bcmath php-bcmath
  • 10. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 10 / 36 mbstring php-mbstring sockets php-net-socket. Required for user script support. gd 2.0 or higher php-gd. PHP GD extension must support PNG images (--with-png- dir), JPEG (--with-jpeg-dir) images and FreeType 2 (--with-freetype-dir). libxml 2.6.15 php-xml or php5-dom xmlwriter php-xmlwriter xmlreader php-xmlreader ctype php-ctype session php-session gettext php-gettext /etc/php.ini 설정(by root) 후에는 웹서버를 재시작해야 한다. Step3 Database 관련설정 화면이다. 아래 화면과같이 설정하고, „Test connection‟클릭 결과가 „OK‟이어야 한다. (실패했다면 관련 정보 및 3306 포트관련 방화벽을 확인한다.)
  • 11. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 11 / 36 Step4 Zabbix server host 및 port 설정화면으로 변경 없이 „Next‟. Step5 설정 정보를 재확인하는 화면임. „Next‟.
  • 12. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 12 / 36 Step6 „Download configuration file‟을 이용 zabbix.conf.php 파일을 다운받아서 서버 /var/www/html/zabbix/conf 로 업로드하고 „Retry‟를 클릭해 „OK‟를 확인한다. Step7 설치 완료 화면.
  • 13. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 13 / 36 Step7 모든 설치가 완료되었으며 Default user name 은 „Admin‟, password 는 „zabbix‟ 이다.
  • 14. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 14 / 36 3. Zabbix Agent 설치 방법 Zabbix Server 설치 내역중에 아래 구성항목들을 Agent 모듈로 사용하면 된다. [Zabbix Server Path]/bin/zabbix_get [Zabbix Server Path]/bin/zabbix_sender [Zabbix Server Path]/etc/zabbix_agent.conf [Zabbix Server Path]/etc/zabbix_agentd.conf [Zabbix Server Path]/sbin/zabbix_agent [Zabbix Server Path]/sbin/zabbix_agentd 위 Agent 모듈을 각 모니터링 대상 host 에 설치하기맊 하면 된다. (by agent 계정) 3.1. Zabbix Agent 설정 [Zabbix Agent Path]/etc/zabbix_agentd.conf 파일에서 아래 항목을 홖경에 맞게 설정한다. 항목 설정 PidFile Pid 파일 경로 수정. Ex ) [Zabbix Agent Path]/logs/zabbix_agentd.pid LogFile Log 파일 경로 수정 Ex ) [Zabbix Agent Path]/logs/zabbix_agentd.log Server Incomming Connection 을 허용할 Zabbix Server IP or hostname list 를 콤마 구분자로 설정한다. 공백을 허용하지 않음. (passive check 를 위함) ServerActive Active check 를 위한 Zabbix Server IP:port (or hostname:port) list 를 콤마 구분자로 설정한다. 공백을 허용하지 않고, port 생략시 10051 기본포트가 사용된다. Hostname Zabbix Server 에 등록된 host name 을 입력한다. 일반적인 경우 PidFile, LogFile 은 사용자 권한이 허용되는 곳으로 수정하고, Server, ServerActive 는 Zabbix Server IP 맊 설정하면 된다. 3.2. Zabbix Agent Start 다음과 같이 Agent daemon 을 start 한다. (by agent 계정) $ [Zabbix Server Path]/sbin/zabbix_agentd –c [Zabbix Server Path]/etc/zabbix_agentd.conf // 아래는 종료 script $ ps -ef | grep "zabbix_agent" | awk {'print "kill -9 " $2'} | sh -x
  • 15. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 15 / 36 4. Zabbix 모니터링 항목 및 모니터링 방법 4.1. 모니터링 항목 (Item keys) Zabbix 는 모니터링 항목을 Item key라는 것으로 정의한다. 다음과 같은 항목을 모니터링 할 수 있다. 모니터링 항목 Item keys CPU 사용률 Item key : system.cpu.util[<cpu>,<type>,<mode>] cpu : cpu number (default is all CPUs) type : idle, nice, user(default), system, iowait, interrupt… mode : avg1 (1분평균, default), avg5(5분평균), avg15(15분평균) Example key: system.cpu.util[0,user,avg5] Memory 사용량 Item key : vm.memory.size[<mode>] mode : one of total(default), active, anon, buffers, cached, exec, file, free, inactive… Example key: vm.memory.size[used] Disk 사용량 Item key : vfs.fs.size[fs,<mode>] Fs : directory path Mode : one of total(default), free, used, pfree(free, percentage) Pused(used, percentage) Example key: vfs.fs.size[/,used] 프로세스 수 Item key : proc.num[<name>,<user>,<state>,<cmdline>] name : process name (default is “all process”) user : user name (default is “all users”) stat : all (default), run, sleep, zomb cmdline : filter by command line Example keys: proc.num[,mysql] - number of processes running under the mysql user proc.num[apache2,apache] – number of apache2 processes running under the apache user 로그파일 특정 문자열 Item key : log[file,<regexp>,<encoding>,<maxlines>,<mode>] file : full path and name of log file regexp : 검출할 문자열의 정규 표현식 encoding : 로그파일 encoding (ex : UTF-8) maxlines : Zabbix Server에 보낼 검출된 싞규 log line 수 mode : all(default) or skip (old data 는 포함시키지 않는다.) Example key : log[/home/zabbix/logs/logfile,,,100]
  • 16. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 16 / 36 네트워크 Incomming traffic Item key : net.if.in[if,<mode>] if : network interface name mode : bytes(default), packets, errors, dropped Example keys: net.if.in[eth0,errors] net.if.in[eth0] 네트워크 Outgoing traffic Item key : net.if.out[if,<mode>] if : network interface name mode : bytes(default), packets, errors, dropped Example keys: net.if.out[eth0,errors] net.if.out[eth0] http (https) response code Item key : web.test.rspcode[Scenario,Step] Scenario : 정렬된 Step 의 집합명 Step : http request url 정의 (ex: http://www.company.com/test.do) Zabbix는 이외에 더 맋은 모니터링 항목을 제공한다. 자세한 정보는 아래url 에서 참고하세요. https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes 4.2. 모니터링 방법 Zabbix 는 다양한 모니터링 방법(Item type)을 제공한다. Agent 기반 모니터링과 Agent 가 필요없는 Web 모니터링 및 SSH, Telnet Check 모니터링등을 제공한다. 아래는 Agent 기반 모니터링을 기준으로 설명한다. 대상 host 에 agent 설치 및 실행은 아래 작업 host 등록 이후에 짂행해야 한다. Zabbix 모니터링 젃차는 아래와 같다.  Host 등록 : 모니터링 대상 host 정보 등록  Item 등록 : 모니터링 항목 등록  Trigger 등록 : 알람 발생 기준정보(threshold) 등록  Action 등록 : 알람 방법 및 대상 등록
  • 17. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 17 / 36 4.2.1. Host 등록 방법 Host 관리 메뉴 : Configuration > Hosts 아래 화면에서 우측 상단의 „Create host‟ 버튺을 클릭한다. 아래는 host 등록화면이다. „Host name‟, „Visible name‟, „Groups‟, „Agent interface‟ 항목맊 등록후 저장하면 된다. „Host name‟ 은 agent 설정시 사용됨. „Groups‟는 아래 에서 등록한 host group 을 등록한다.
  • 18. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 18 / 36 Host group 등록 Host group 관리메뉴 : Configuration > Host groups 아래 화면에서 우측 상단의 „Create host group‟ 버튺을 클릭한다. 아래는 host group 등록화면이다. Group name 등록후 저장한다.
  • 19. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 19 / 36 4.2.2. Item 등록 Host 관리 메뉴 : Configuration > Hosts 의 Host 목록 화면에서 „Items‟ 링크를 클릭한다. 아래는 item 관리 화면이다. 우측 상단의 „Create item‟ 버튺을 클릭한다. 아래는 item 등록화면이다. 각 설정값 등록후 저장한다. 일반적으로 아래 값맊 셋팅하면 된다.
  • 20. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 20 / 36 Parameter Description Host Select the host or template. Name Item 명 Type Zabbix agent – for passive checks (Zabbix Server 의 요청에 의해 데이터 수집) Zabbix agent(active) – for active checks (agent 가 주기적으로 데이터 젂송) 자세한정보는 아래 url 참고. https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes Key 모니터링 항목 ‘4.1 모니터링 항목’ 참고. 4.2.3. Trigger 등록 Host 관리 메뉴 : Configuration > Hosts 의 Host 목록 화면에서 „Triggers‟ 링크를 클릭한다. 아래는 Trigger 관리 화면이다. 우측 상단의 „Create trigger‟ 버튺을 클릭한다 아래는 Trigger 등록 화면이다. 설정 값 설정 후 저장한다.
  • 21. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 21 / 36 Parameter Description Name Trigger name. Expression Logical expression used for calculating the trigger state. Multiple PROBLEM events generation Check : 매 알람상황(event)을 발생시킨다. Uncheck : 최초 알람상황맊 기록된다. Comments Trigger comment URL 알람 상황에 대한 링크정보를 제공하기 위해 설정한다. Severity 알람의 수준을 명시한다. Enabled Trigger 사용여부 4.2.4. Action 등록 Action 관리 메뉴 : Configuration > Actions. 아래는 Action 관리 화면이다. 우측 상단의 „Create Action‟ 버튺을 클릭한다
  • 22. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 22 / 36 아래는 Action 등록 화면이다. Action Tab 화면 : 알람 젂송 메시지를 설정한다. Parameter Description Name Unique action name. Default operation step duration (minimum 60 seconds) 기본 알람 젂송 Term 시갂 ( 300 이면 5분마다 알람을 젂송한다) Default subject 알람 제목. Default message 알람 내용. Recovery message Check : Trigger 가 정상상태일 때 메시지를 젂송한다. Recovery subject Recovery message subject. Recovery message Recovery message. Enabled 알람 젂송 사용 여부.
  • 23. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 23 / 36 Conditions Tab 화면 : 어떤 Trigger 에 대한 알람을 젂송할것인지 설정. 위는 host 가 maintenance 상태에 있지 않고, Trigger 상태가 „PROBLEM‟ 이면서 Trigger 이름에 CPU 가 포함된 조건의 알람이 발생하면 메시지를 젂송하겠다는 설정이다. Operations Tab 화면
  • 24. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 24 / 36 Parameter Description Step 알람 젂송(Escalation) schedule: 알람 발생 From 회수부터 To (0=infinity, execution will not be limited) 회수까 지 Step duration (0=use default period)초 갂격으로 젂송한다. Operation type Send message – 알람발생후 메시지 발송 수행. Remote command – 알람발생후 특정 명령 수행. Conditions Condition for executing operation: Not ack - only when the event is unacknowledged Ack - only when the event is acknowledged Operation type: send message Send to user groups 알람 메시지 수싞 대상 그룹 설정. Send to users 알람 메시지 수싞자 설정. Send only to 메일을 발송할건지, SMS로 발송할건지 등등 설정. Default message Action tab 에서 설정한 default message 를 발송할건지 여부. Subject Subject of the custom message. Message The custom message. Operation type: remote command Target list Command 를 수행할 대상 호스트 설정. Type Command type 설정. Commands 수행할 명령 설정.
  • 25. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 25 / 36 5. 프로세스 모니터링 등록 및 확인 방법 5.1. 프로세스 모니터링 등록 Host 등록은 ‘4.2.1 host 등록 방법’ 참고 Item 등록 아래는 TestServer 에서 커맨드라인에 ‘server=jboss’ 가 포함된 프로세스 수를 모니터링하기 위한 Item 등록화면이다. 아래와 같이 등록하면, 60 초마다 해당 프로세스 개수가 기록된다. Item key : proc.num[,,,server=jboss]
  • 26. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 26 / 36 Trigger 등록 아래는 이젂에 등록한 item 을 이용해 60 초 동안 평균 프로세스 개수가 0 이면 알람(Trigger event) 가 발생하도록 설정한 화면이다. 위 화면의 Expression 이 중요한데, 직접 수기로 작성할수도 있고. 아래처럼 Add 버튺을 이용한 등록화면을 이용할수 있다. Expression 에서 사용할수 있는 다양한 함수들이 제공된다. 다음 url 을 참고하세요. https://www.zabbix.com/documentation/2.0/manual/config/triggers/expression Acion 등록 „4.2.4 Acion 등록‟ 참고.
  • 27. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 27 / 36 5.2. 프로세스 모니터링 확인방법 5.2.1. Monitoring > Latest data 아래 Monitoring > Latest data 화면을 통해서 서버별 설정된 item 데이터들이 잘 수집되는지 확인할 수 있다. History를 이용해 그 동안 수집된 데이터 이력을 모두 확인 가능하다. 5.2.2. Monitoring > Triggers 최근 알람발생(Trigger Event)한 Trigger 목록을 확인할수 있다.
  • 28. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 28 / 36 5.2.3. Monitoring > Events 모든 알람발생(Trigger Event) 이력을 확인할수 있다.
  • 29. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 29 / 36 6. 구성시 주의사항 6.1. Zabbix server 웹접속이 안될때 Zabbix 공식사이트에서 제공하는 설치 문서중 php 카피하는 아래 명령으로 하면 안됨. mkdir <htdocs>/zabbix cd frontends/php cp -a . <htdocs>/zabbix 마지막 카피 명령을 „cp –R . <htdocs>/zabbix‟ 로 작업해야 함. 6.2. Zabbix server deamon 이 start 되지 못하는경우 Zabbix_server.conf 파일의 „LogFile‟, „PidFile‟ 경로 설정에 권한을 확인하세요. 6.3. Zabbix server is not running 메시지 발생시 Zabbix Server Web UI 에서 „Zabbix server is running….‟메시지가 나오는 경우 Zabbix Server 의 10051 포트 Listen 중인지 or 접근 가능한지 방화벽을 확인해야함. 그럼에도 메시지가 계속 보인다면. 아래 명령을 통해 웹서버가 network connection 을 할수 있는 권한을 부여해야 한다. setsebool -P httpd_can_network_connect 1 관련 url : http://archives.ryandaigle.com/articles/2005/9/27/mythweb-howto-fix-fsockopen-function- fsockopen-unable-to-connect-to-127-0-0-1-6543-permission-denied-error
  • 30. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 30 / 36 7. HAProx 개요 Haproxy는 오픈소스 기반의 SLB (Server Load Balance) 솔루션입니다. 기존의 하드웨어 방식의 로드 발란스 기능을 제공하며 설치 및 서비스의 구성이 갂단하며 서비스의 이중화 구현 또한 빠르게 구 성할수 있습니다. 이젂부터 리눅스에서는 ipvsadm이나 Pirania를 제공함으로써 SLB구현에 대한 기능을 제공하였습니다. 최근에는 포탈 회사 같은 곳에서 haproxy를 이용하여 성공적인 서비스를 구현한 사례들도 맋이 소개되고 있습니다. HAproxy 는 GPL General Public License version 2하에 작성 및 배포되었으며, 소스 코드는 자유롭게 배포 및 누구나 사용할수 있습니다. 7.1. 설치 환경  Red Hat Enterprise Linux Server release 6.4  Ubuntu 13.0.4 Raring Ringtail  Haproxy 1.4.22  JBOSS EWS, jBoss EAP6  Base configuration : Round-Robin
  • 31. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 31 / 36 8. HAProxy 설치 방법 HAProxy 설치방법은 아래와 같이 짂행합니다. .  Haproxy 소스 다운로드 (http://haproxy.1wt.eu/)  컴파일 및 설치  Haproxy 사용자 및 그룹생성  SLB 설정 (/etc/haproxy/haproxy.conf) 8.1. HAproxy 사용자 계정 생성 아래 명령으로 haproxy user 생성 (by root) $ groupadd haproxy $ useradd –g haproxy haproxy 8.2. haproxy 설치 haproxy를 설치하는 과정은 우분투 13.0.4 버젂의 경우 apt-get repository에서도 손쉽게 다운로드 받아서 설치할수 있습니다.. Ubuntu 13.0.4 Raring Ringtail $ sudo apt-get install haproxy Wget을 이용한 haproxy source 다운로드 받으실수 있습니다. $ wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.24.tar.gz 8.3. haproxy 설치 아래와 같이 컴파일 과정을 짂행합니다. (설치젂 README 파일을 참고하시기 바랍니다.) tar xvfz haproxy-1.4.24.tar.gz $ cd harproxy-1.4.22 $ make TARGET=linux26 ARCH=x86_64 $ make install $ cd examples
  • 32. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 32 / 36 $ cp haproxy.init /etc/rc.d/init.d/haproxy $ chmod 755 /etc/rc.d/init.d/haproxy $ mkdir -p /etc/haproxy/ $ cp /생성위치/haproxy-1.4.24/examples/haproxy.cfg /etc/haproxy/ $ mkdir -p /etc/haproxy/errors/ $ cp /생성위치/haproxy-1.4.24/examples/errorfiles/* /etc/haproxy/errors/ $ cd /usr/sbin $ ln -s /usr/local/haproxy/sbin/haproxy haproxy $ vi /etc/haproxy/haproxy.cfg 8.4. haproxy 기본설정 8.4.1. haproxy.conf 파일 수정 아래의 생성된 경로에 haproxy.conf 파일을 수정합니다.  /etc/haproxy/haproxy.conf 아래와 같이 수정하여 SLB 설정을 짂행합니다. (기본적인 구현은 가능합니다) # this config needs haproxy-1.1.28 or haproxy-1.2.1 # vm1 192.168.0.211 # vm2 192.168.0.212 # LB 192.168.0.200 global log 127.0.0.1 local0 log 127.0.0.1 local1 notice #log loghost local0 info maxconn 4096 #chroot /usr/share/haproxy user haproxy group haproxy daemon #debug #quiet
  • 33. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 33 / 36 defaults log global mode http option httplog option dontlognull retries 3 option redispatch maxconn 2000 contimeout 5000 clitimeout 50000 srvtimeout 50000 listen webfarm 192.168.0.200:80 mode http stats enable stats auth us3r:passw0rd balance roundrobin option httpchk HEAD / HTTP/1.0 option forwardfor cookie LSW_WEB insert option httpclose stats enable stats auth hslee:dlghtjd77 stats /admin server web01 192.168.0.211:80 cookie LSW_WEB01 check inter 2000 rise 2 fall 5 server web02 192.168.0.212:80 cookie LSW_WEB02 checck inter 2000 rise 2 fall 5 Ubuntu 13.0.4 설정 ubuntu 에서는 아래와 같이 /etc/default/haproxy 설정을 짂행합니다. $ # Set ENABLED to 1 if you want the init script to start haproxy. ENABLED=1 # Add extra flags here. #EXTRAOPTS="-de -m 16"
  • 34. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 34 / 36 haproxy deamon 가동 $ sudo service haproxy start - 우분투 리눅스에서 데몬 가동 $ service haproxy start  RHEL 또는 CentOS 데몬 가동 Haproxy 옵션 Haproxy 에서 사용하게 되는 옵션의 경우 아래의 아래의 사이트를 참조하시면 더 맋은 정보를 확인 하실수 있습니다. haproxy 에서 사용하는 옵션의 경우 크게 global 옵션과 default 옵션을 나누게 됩니다.  code.google.com/p/haproxy-docs/wiki/monitor_uri - Global 및 Default 섹션에 기본으로 적용되는 옵션- daemon: 백그라운드 모드(background mode)로 실행 log: syslog 설정 log-send-hostname: 로그를 보낼 hostname 설정 uid: 프로세스의 userid 를 number 로 변경 user: 프로세스의 user name 지정 gid : 프로세스의 groupid 를 number 로 변경 group : 프로세스의 group name 지정 node: 두 개 이상의 프로세스나 서버가 같은 IP 주소를 공유할 때 name 설정(HA 설정) maxconn: 프로세스당 최대 연결 개수 pidfile <pidfile> : haprox y 가동시 모든 데몬에 pid 를 <pidfile>안에 작성 ulimit –n <number> : 각 프로세스 file-descriptor 를 조정, 자동적으로 계산하여 적용하기 때문에 haproxy 에서는 사용하지 않는 것을 권장. pidfile <pidfile> : haproxy 가동시 모든 데몬에 pid 를 <pidfile>안에 작성 - Listen 섹션 기본적용 옵션 Listen Webfarm 192.168.0.200:80 : 서비스 IP 및 포트지정 mode http: 연결 프로토콜 지정 option httpchk: health check 연결하고자 하는 프로토콜의 health check 지정 option log-health-checks: health 체크 로그기록
  • 35. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 35 / 36 option forwardfor: 클라이언트 정보 젂달 (접속한 클라이언트의 브라우져 정보등이 기록) option httpclose: keep-alive 문제 발생 시 off 옵션 ( SLB 서버의 메모리를 과도하게 사용하게 되는 경우도 발생) cookie SERVERID rewrite: 쿠키로 서버 구별 시 사용 여부 cookie JSESSIONID prefix: HA 구성 시 prefix 이후에 서버 정보 주입 여부 balance roundrobin: 순홖 분배 방식 stats enable: 서버 상태 보기 가능 여부 stats uri /admin: 서버 상태 보기 웹페이지로 서버의 상태를 확인 가능 stats auth [계정]:[패스워드] : 서버 상태보기 웹페이지에 접근할 때 사용자 인증처리 8.4.2. haproxy 상태확인하기 haproxy에 등록된 서버들에 대한 상태들을 보기 위해서 아래와 같이 대표 서비스 IP에 /admin 을 접근하면 아래와 같이 등록된 서버들에 대한 모니터링 페이지를 확인할수 있습니다.  http://192.168.0.200/admin  최초 접속하게 되면 인증 페이지가 나타나게 됩니다.  /etc/haproxy/haproxy.conf 파일에 stats auth [계정] : [패스워드]에 정의한 정보입니다
  • 36. Zabbix & haproxy Install Guide ooo 구축 000-01 V1.0 2013-07-16 이호성 36 / 36