OS/Linux

rabbitmq 설치

아르비스 2015. 2. 12. 22:22

2. yum daum 사이트 추가 (ftp.daum.net : 117.52.11.181)

/etc/yum.repos.d/Daum.repo

[daum_base]

name=CentOS-$releasever - Base

baseurl=http://ftp.daum.net/centos/$releasever/os/$basearch/

gpgcheck=0

enabled=1

[daum_updates]

name=CentOS-$releasever - Updates

baseurl=http://ftp.daum.net/centos/$releasever/updates/$basearch/

gpgcheck=0

enabled=1

[daum_extras]

name=CentOS-$releasever - Extras

baseurl=http://ftp.daum.net/centos/$releasever/extras/$basearch/

gpgcheck=0

enabled=1

3. erlang 설치 (pacakges.erlang-solutions.com : 31.172.186.53)

/etc/yum.repos.d/erlang_solutions.repo

[erlang]

name=Centos $releasever - $basearch - Erlang Solutions

baseurl=http://packages.erlang-solutions.com/rpm/centos/$releasever/$basearch

gpgcheck=0

gpgkey=http://packages.erlang-solutions.com/debian/erlang_solutions.asc

enabled=1

4. rabbitmq 설치

yum install erlang

yum install rabbitmq-server-3.3.4-1.noarch.rpm

5. rabbitmq 설정

vi /etc/rabbitmq/rabbitmq-env.conf

#rabbitmq-env.conf

#Host Name

HOSTNAME=cl-EFSS-linux20

#Node Name

NODENAME=rabbit@cl-EFSS-linux20

RABBITMQ_NODE_PORT=5672

RABBITMQ_MNESIA_BASE=/block/dbfiles

RABBITMQ_LOG_BASE=/block/logs/rabbitmq

 

5-1. folder 생성

 $ mkdir /block/dbfiles

 $ chmod –R rabbitmq.rabbitmq /block/dbfiles

 

 $ mkdir /block/logs/rabbitmq

 $ chmod –R rabbitmq.rabbitmq /block/logs/rabbitmq

 

6. 기동 : service rabbitmq-server start

7. management plugin 설치

  rabbitmq-plugins list

  rabbitmq-plugins enable rabbitmq_management

8. 계정 생성

rabbitmqctl add_user rabbitmq rabbit123

rabbitmqctl set_user_tags rabbitmq administrator

rabbitmqctl set_permissions -p / rabbitmq ".*" ".*" ".*"

 

rabbitmqctl add_user efss efss00

rabbitmqctl set_user_tags efss monitoring

rabbitmqctl set_permissions -p / efss ".*" ".*" ".*"

 

9. rabbitmq clustering

 - /etc/host server, host 등록

 - cookie 복제 (1번 서버 .erlang.cookie 내용을 2 서버에 복제)

 - 2 서버에서 실행

rabbitmqctl stop_app

rabbitmqctl join_cluster rabbit@cl-EFSS-linux20

rabbitmqctl start_app

 

10. mirrored queue 설정

 - rabbitmqctl set_policy ha-all ".*" '{"ha-mode":"all"}'