본문 바로가기

OpenFire/server

HAProxy - ConnectionManager - Openfire


ㅁ make 설치 및 확인

# rpm -qa | grep ^make

# yum info make | grep Repo

# yum install make -y


ㅁ haproxy 설치

[

  ssl 사용할 경우 USE_OPENSSL=1

- 32 but

# make TARGET=linux26 ARCH=x86

- 64 bit

# make TARGET=linux26 ARCH=x86_64

]


# make clean

# make TARGET=linux26 USE_OPENSSL=1 ADDLIB=-lz

# make install
# cp ./examples/haproxy.init /etc/rc.d/init.d/haproxy
# chmod 755 /etc/rc.d/init.d/haproxy
# mkdir -p /etc/haproxy
# cp ./examples/haproxy.cfg /etc/haproxy/
# mkdir -p /etc/haproxy/errors
# cp ./examples/errorfiles/* /etc/haproxy/errors/
# cd /usr/sbin
# ln -s /usr/local/sbin/haproxy haproxy

# mkdir /ust/share/haproxy


ㅁ 구동

#sudo service haproxy start


ㅁ 설정 변경

 - cm-proxy 의 포트는 HAProxy 가 받을 포트

 - connection-manager 추가 해준다.

#vi /etc/haproxy/haproxy.cfg


ㅁ maxconn 추가

    > ulimit -n 관계있음. ulimit 수정 필요


# this config needs haproxy-1.1.28 or haproxy-1.2.1

global
        log 127.0.0.1   local0
        log 127.0.0.1   local1 notice
        #log loghost    local0 info
        maxconn 40000
        chroot /usr/share/haproxy
        uid 99
        gid 99
        daemon

defaults
        log     global
        mode    tcp
        option  tcplog
        option  dontlognull
        timeout server 5d

        timeout connect 5d
        timeout client 5d

        maxconn 40000
frontend http-in
        bind *:8081
        mode http
        reqadd X-Forwarded-Proto: http
#       default_backend http_backend
        stats enable
        stats refresh 10s
        stats uri /haproxy_stats

#backend http_backend
#       mode http
#       balance roundrobin
#       cookie SERVERID insert indirect nocache

listen cm-proxy 0.0.0.0:5222
        maxconn 40000
        mode tcp
        option tcplog
        balance roundrobin
        server cm-s1 127.0.0.1:5201 check maxconn 12000
        server cm-s2 127.0.0.1:5202 check maxconn 12000
        server cm-s3 127.0.0.1:5203 check maxconn 12000



ㅁ manager 접속

 - http://domain.com:8081/haproxy_stats

 

external_image

ㅁ 3개의 클라이언트 접속 분배.

 

'OpenFire > server' 카테고리의 다른 글

OpenfirePresenceSpooler  (0) 2016.01.04
[System Architecture] ConnectionManager  (0) 2015.12.21
[Cache - CacheFactory ] regist guide, life-cycle  (0) 2015.12.21
[Cache] PropertyEventDispatcher key list.  (0) 2015.12.21
openfire 사용 포트  (0) 2015.12.21