01. 설치 환경
OS | Centos 7.8.2003 (Core) |
Erlang | v23.14 |
RabbitMQ | v3.8.9 |
private IP | 192.168.1.101 |
RabbitMQ 을 설치할 때 RabbitMQ 버전과 Erlang 버전을 참고해서 설치해야합니다.(호환성)
호환성이 맞지 않으면, RabbitMQ을 설치 하더라도 실행이 되지 않습니다.
호환성에 대한 버전은 아래 URL에서 확인 가능합니다.
www.rabbitmq.com/which-erlang.html
현재 (2020-11-29)일 기준으로 최신 버전은 RabbitMQ v3.8.9 을 yum Repo로 설치 해보겠습니다.
- OS 버전 확인
[vagrant@master ~]$ rpm --query centos-release
centos-release-7-8.2003.0.el7.centos.x86_64
02. Erlang 설치 (v23.14)
[vagrant@master ~]$ sudo vim /etc/yum.repos.d/rabbitmq_erlang.repo
# In /etc/yum.repos.d/rabbitmq_erlang.repo
[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[rabbitmq_erlang-source]
name=rabbitmq_erlang-source
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
sudo yum install erlang -y
03. RabbitMQ 설치 (v3.8.9)
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.9/rabbitmq-server-3.8.9-1.el7.noarch.rpm
RabbitMQ signingkey를 import하고, wget을 통해 다운 받은 rabbitmq rpm을 설치
sudo rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo yum install -y rabbitmq-server-3.8.9-1.el7.noarch.rpm
[vagrant@master ~]$ sudo yum install -y rabbitmq-server-3.8.9-1.el7.noarch.rpm
.ssh/
rabbitmq-server-3.8.9-1.el7.noarch.rpm
[vagrant@master ~]$ sudo yum install -y rabbitmq-server-3.8.9-1.el7.noarch.rpm
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Examining rabbitmq-server-3.8.9-1.el7.noarch.rpm: rabbitmq-server-3.8.9-1.el7.noarch
Marking rabbitmq-server-3.8.9-1.el7.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rabbitmq-server.noarch 0:3.8.9-1.el7 will be installed
--> Processing Dependency: socat for package: rabbitmq-server-3.8.9-1.el7.noarch
Loading mirror speeds from cached hostfile
* base: mirror.kakao.com
* extras: mirror.kakao.com
* updates: mirror.kakao.com
--> Running transaction check
---> Package socat.x86_64 0:1.7.3.2-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
rabbitmq-server noarch 3.8.9-1.el7 /rabbitmq-server-3.8.9-1.el7.noarch 15 M
Installing for dependencies:
socat x86_64 1.7.3.2-2.el7 base 290 k
Transaction Summary
================================================================================
Install 1 Package (+1 Dependent package)
Total size: 16 M
Total download size: 290 k
Installed size: 16 M
Downloading packages:
socat-1.7.3.2-2.el7.x86_64.rpm | 290 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : socat-1.7.3.2-2.el7.x86_64 1/2
Installing : rabbitmq-server-3.8.9-1.el7.noarch 2/2
Verifying : socat-1.7.3.2-2.el7.x86_64 1/2
Verifying : rabbitmq-server-3.8.9-1.el7.noarch 2/2
Installed:
rabbitmq-server.noarch 0:3.8.9-1.el7
Dependency Installed:
socat.x86_64 0:1.7.3.2-2.el7
Complete!
04. RabbitMQ management UI 사용
sudo rabbitmq-plugins enable rabbitmq_management
[vagrant@master ~]$ sudo rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@master:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@master...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
05. RabbitMQ 서비스 실행
sudo systemctl start rabbitmq-server
06. RabbitMQ 서비스 상태
sudo systemctl status rabbitmq-server
[vagrant@master ~]$ sudo systemctl status rabbitmq-server
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2020-11-29 11:48:03 UTC; 7s ago
Main PID: 26012 (beam.smp)
Status: "Initialized"
CGroup: /system.slice/rabbitmq-server.service
├─26012 /usr/lib64/erlang/erts-11.1.3/bin/beam.smp -W w -K true -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 10485...
├─26117 erl_child_setup 32768
├─26165 inet_gethost 4
└─26166 inet_gethost 4
Nov 29 11:48:00 master rabbitmq-server[26012]: ########## Licensed under the MPL 2.0. Website: https://rabbitmq.com
Nov 29 11:48:00 master rabbitmq-server[26012]: Doc guides: https://rabbitmq.com/documentation.html
Nov 29 11:48:00 master rabbitmq-server[26012]: Support: https://rabbitmq.com/contact.html
Nov 29 11:48:00 master rabbitmq-server[26012]: Tutorials: https://rabbitmq.com/getstarted.html
Nov 29 11:48:00 master rabbitmq-server[26012]: Monitoring: https://rabbitmq.com/monitoring.html
Nov 29 11:48:00 master rabbitmq-server[26012]: Logs: /var/log/rabbitmq/rabbit@master.log
Nov 29 11:48:00 master rabbitmq-server[26012]: /var/log/rabbitmq/rabbit@master_upgrade.log
Nov 29 11:48:00 master rabbitmq-server[26012]: Config file(s): (none)
Nov 29 11:48:02 master rabbitmq-server[26012]: Starting broker... completed with 3 plugins.
Nov 29 11:48:03 master systemd[1]: Started RabbitMQ broker.
07. RabbitMQ을 관리할 계정 생성
ID | rabbitmq |
PW | rabbitmq |
- 계정 생성
sudo rabbitmqctl add_user rabbitmq rabbitmq
[vagrant@master ~]$ sudo rabbitmqctl add_user rabbitmq rabbitmq
Adding user "rabbitmq" ...
- 관리자 권한 설정
sudo rabbitmqctl set_user_tags rabbitmq administrator
[vagrant@master ~]$ sudo rabbitmqctl set_user_tags rabbitmq administrator
Setting tags for user "rabbitmq" to [administrator] ...
- 모든 권한을 rabbitmq 계정에 줍니다.
sudo rabbitmqctl set_permissions -p / rabbitmq '.*' '.*' '.*'
[vagrant@master ~]$ sudo rabbitmqctl set_permissions -p / rabbitmq '.*' '.*' '.*'
Setting permissions for user "rabbitmq" in vhost "/" ...
08. RabbitMQ Management UI
http://192.168.1.101:15672/
'IT > Infra' 카테고리의 다른 글
[centos7] Jenkins 설치 (0) | 2021.01.05 |
---|---|
[Centos7] RabbitMQ Cluster 구성 (0) | 2020.11.29 |
[Vagrant] Multi VM , Memory, Cpus 설정 (0) | 2020.11.29 |
[Docker] Consul 설치 하기 (Feat.Mac) (0) | 2020.10.24 |
[Mac] Rabbit MQ 설치 (0) | 2020.10.11 |