[rabbitmq 설치]
1. proxy 설정 (사내망 서버일 경우)
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
$ chown –R rabbitmq.rabbitmq /block/dbfiles
$ mkdir /block/logs/rabbitmq
$ chown –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"}'
<rabbitmqadmin 설치>
$cd /usr/local/bin/
# Get the cli and make it available to use.
wget http://127.0.0.1:15672/cli/rabbitmqadmin
$chmod 775 rabbitmqadmin
$mv rabbitmqadmin /usr/local/bin
<make exchange>
./rabbitmqadmin declare exchange name=DRM.Processing type=direct ./rabbitmqadmin declare exchange name=Event.Processing type=direct ./rabbitmqadmin declare exchange name=File.ConvertProcessing type=direct ./rabbitmqadmin declare exchange name=File.Logging type=direct ./rabbitmqadmin declare exchange name=File.Processing type=direct ./rabbitmqadmin declare exchange name=File.SearchProcessing type=direct ./rabbitmqadmin declare exchange name=Post.ErrorProcessing type=direct ./rabbitmqadmin declare exchange name=Post.RetryProcessing type=direct |
<make queue>
./rabbitmqadmin declare queue name=DRM.DecryptQueue durable=true ./rabbitmqadmin declare queue name=Event.FeedQueue durable=true ./rabbitmqadmin declare queue name=Event.NotiQueue durable=true ./rabbitmqadmin declare queue name=File.ConvertQueue durable=true ./rabbitmqadmin declare queue name=File.LogQueue durable=true ./rabbitmqadmin declare queue name=File.SearchQueue durable=true ./rabbitmqadmin declare queue name=Post.ErrorQueue durable=true ./rabbitmqadmin declare queue name=Post.RetryQueue durable=true |
<bind queue to exchange>
./rabbitmqadmin declare binding source="DRM.Processing" destination_type="queue" destination="DRM.DecryptQueue" ./rabbitmqadmin declare binding source="Event.Processing" destination_type="queue" destination="Event.FeedQueue" ./rabbitmqadmin declare binding source="Event.Processing" destination_type="queue" destination="Event.NotiQueue" ./rabbitmqadmin declare binding source="File.ConvertProcessing" destination_type="queue" destination="File.ConvertQueue" ./rabbitmqadmin declare binding source="File.Logging" destination_type="queue" destination="File.LogQueue" ./rabbitmqadmin declare binding source="File.Processing" destination_type="queue" destination="File.ConvertQueue" ./rabbitmqadmin declare binding source="File.Processing" destination_type="queue" destination="File.SearchQueue" ./rabbitmqadmin declare binding source="File.SearchProcessing" destination_type="queue" destination="File.SearchQueue" ./rabbitmqadmin declare binding source="Post.ErrorProcessing" destination_type="queue" destination="Post.ErrorQueue" ./rabbitmqadmin declare binding source="Post.RetryProcessing" destination_type="queue" destination="Post.RetryQueue" |
<삭제 :>
yum remove rabbitmq-server
yum remove erlang