RabbitMQ with Management Support

Exported on 23-Aug-2021 15:09:04

Install NGINX, PHP8 and MariaDB 10.5

Supported Linux OS: Debian 10 Ubuntu 20.04 CentOS 8

Parameters

Name Type Script Reference Default Value Comment
Linux - Debian 10 Linux / Unix Server linuxDebian10
Linux User Linux OS Credential linuxUser

1 - Repo config files

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
Deploy archive rabbitmq - soruce files.zip to remote path files/
  1. Locate Files archive "rabbitmq - soruce files.zip", This can be downloaded from Attune
  2. Copy the Files archive to the server
  3. Extract the root of the Files archive to files/, relative to the home directory
  4. Check that the files are in the correct location

2 - Update system in prepare packages

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
if command -v yum &> /dev/null
then
    echo "You are using yum package manager"
    sudo yum update -y
    sudo yum install -y curl redhat-lsb-core chkconfig
elif command -v apt &> /dev/null
then
    echo "You are using apt package manager"
    sudo apt update
    sudo apt install -y gnupg2 curl apt-transport-https lsb-release
else
    echo "Did not know witch package manager OS its using"
    exit
fi

3 - Install RabbitMQ

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
dist=$(lsb_release -is)

if [ "$dist" == "CentOS" ] || [ "$dist" == "Fedora" ]; then
    sudo curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
    sudo rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
    sudo rpm --import https://packagecloud.io/rabbitmq/erlang/gpgkey
    sudo rpm --import https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey

    sudo rm -rf /etc/yum.repos.d/rabbitmq.repo
    sudo cp files/centos-rabbitmq.repo /etc/yum.repos.d/rabbitmq.repo
    
    sudo yum update -y
    sudo yum -q makecache -y --disablerepo='*' --enablerepo='rabbitmq_erlang' --enablerepo='rabbitmq_server'
    sudo yum install socat logrotate -y
    sudo yum install --repo rabbitmq_erlang --repo rabbitmq_server erlang rabbitmq-server -y
    sudo rabbitmq-plugins enable rabbitmq_management
    sudo chkconfig rabbitmq-server on
    sudo /sbin/service rabbitmq-server start
    
    # Disable Firewall
    sudo systemctl stop firewalld
    sudo systemctl disable firewalld

elif [ "$dist" == "Debian" ] || [ "$dist" == "Ubuntu" ]; then
    sudo apt-key adv --keyserver "hkps://keys.openpgp.org" --recv-keys "0x0A9AF2115F4687BD29803A206B73A36E6026DFCA"
    sudo apt-key adv --keyserver "keyserver.ubuntu.com" --recv-keys "F77F1EDA57EBB1CC"
    curl -1sLf 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey' | sudo apt-key add -
    
    ## Add apt repositories maintained by Team RabbitMQ
    sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases
##
## "bionic" as distribution name should work for any reasonably recent Ubuntu or Debian release.
## See the release to distribution mapping table in RabbitMQ doc guides to learn more.
deb http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main
deb-src http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main

## Provides RabbitMQ
##
## "bionic" as distribution name should work for any reasonably recent Ubuntu or Debian release.
## See the release to distribution mapping table in RabbitMQ doc guides to learn more.
deb https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ bionic main
deb-src https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ bionic main
EOF

    sudo apt-get update -y
    
    sudo apt-get install -y erlang-base \
                            erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
                            erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
                            erlang-runtime-tools erlang-snmp erlang-ssl \
                            erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl
                            
    sudo apt-get install rabbitmq-server -y --fix-missing
    
    sudo service rabbitmq-server start
    sudo rabbitmq-plugins enable rabbitmq_management
fi