User Tools

Site Tools


apps:rabbitmq:setup_a_rabbitmq-cluster

Setup a RabbitMQ-Cluster

:!: Work in Progress! :!:

Goal

  • 3 Nodes (mb1, mb2, mb3), based on CentOS8

Prepare Repository

Execute on all nodes.

Setup the yum repository according to https://www.rabbitmq.com/install-rpm.html#package-cloud.

vim /etc/yum.repos.d/rabbitmq.repo
##
## Zero dependency Erlang
##

[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/8/$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://github.com/rabbitmq/signing-keys/releases/download/2.0/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/8/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

##
## RabbitMQ server
##

[rabbitmq_server]
name=rabbitmq_server
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/8/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[rabbitmq_server-source]
name=rabbitmq_server-source
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/8/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

Update the cache. Accept the required keys from packetcloud.io and github.com.

dnf makecache

Install rabbitmq-server

Execute on all nodes.

Install the RabbitMQ-Server with all dependencies.

dnf install rabbitmq-server

Start the RabbitMQ-Server on system startup.

systemctl enable rabbitmq-server.service

Set the Erlang Cookie

Execute on mb1.

All nodes in the cluster must have the same erlang cookie. We copy it fro mb1 to the other nodes.

scp /var/lib/rabbitmq/.erlang.cookie mb2:/var/lib/rabbitmq/.erlang.cookie
scp /var/lib/rabbitmq/.erlang.cookie mb3:/var/lib/rabbitmq/.erlang.cookie

Create Config File

https://github.com/rabbitmq/rabbitmq-server/blob/v3.8.x/deps/rabbit/docs/rabbitmq.conf.example

vim /etc/rabbitmq/rabbitmq.conf
scp /etc/rabbitmq/rabbitmq.conf mb2:/etc/rabbitmq/
scp /etc/rabbitmq/rabbitmq.conf mb3:/etc/rabbitmq/
apps/rabbitmq/setup_a_rabbitmq-cluster.txt · Last modified: 2021-05-08 10:49 by Manuel Frei