본문 바로가기
haproxy

nbproc 파라미터를 통한 haproxy데몬 추가



#multi-process 환경의 서버에서 daemon 파라미터를 줄경우 기본적으로 아래와 같이 1개의 프로세스로 동작한다.
[root@NODE0 haproxy]# pstree -na |grep  ha | grep -v grep
  `-haproxy -f /etc/haproxy/i.cfg

#nbproc 을 줄 경우 haproxy의 데몬을 여러 프로세스로 동작 하여 여러 프로세스를 사용 할 수 있다.
#이때 해당 서버의 cpy 개수 보다 많은 값을 설정하면 에러발생 한다.

[root@NODE0 haproxy]# vi i.cfg
    global
        daemon
        maxconn 1000
        nbproc 2# 2개로 프로세스 사용 하는 파라미터 추가 한다.

    defaults
        mode http
        timeout connect 5000ms
        timeout client 50000ms
        timeout server 50000ms

    frontend http-in
        bind *:80
        default_backend servers

    backend servers
        balance roundrobin
        server server1 192.168.229.135:80
        server server2 192.168.229.136:80

# 변경된 설정으로 재시작시 데몬이 추가 된 것을 확인 할 수 있다.
[root@NODE0 haproxy]# pstree -na |grep  ha | grep -v grep
  |-haproxy -f /etc/haproxy/i.cfg

  `-haproxy -f /etc/haproxy/i.cfg


반응형