Skip to content

Building RabbitMQ

linuxonz edited this page Mar 28, 2024 · 67 revisions

Building RabbitMQ

Below versions of RabbitMQ is available in respective distributions at the time of creation of these build instructions:

  • Ubuntu 20.04 has 3.8.2-0
  • Ubuntu 22.04 has 3.9.13-1
  • Ubuntu 23.10 has 3.12.1-1
  • SLES 15 SP5 has 3.8.11-150300.3.14.1

The instructions provided below specify the steps to build RabbitMQ version 3.13.0 on Linux on IBM Z for the following distributions:

  • RHEL (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)
  • SLES (12 SP5, 15 SP5)
  • Ubuntu (20.04, 22.04, 23.10)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.
  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Step 1: Build and install RabbitMQ

1.1) Build using script

If you want to build RabbitMQ using manual steps, go to STEP 1.2.

Use the following commands to build RabbitMQ using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/RabbitMQ/3.13.0/build_rabbitmq.sh

# Build RabbitMQ
bash build_rabbitmq.sh

If the build completes successfully, go to STEP 2. In case of error, check logs for more details or go to STEP 1.2 to follow manual build steps.

1.2) Install dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (7.8, 7.9)

    sudo yum install -y sed glibc-common gcc gcc-c++ gzip findutils zip unzip libxslt xmlto patch subversion ca-certificates xz xz-devel git wget tar make curl java-1.8.0-ibm java-1.8.0-ibm-devel perl openssl openssl-devel ncurses-devel ncurses unixODBC unixODBC-devel hostname
    
  • Install make 4 or later (For RHEL 7.x)

    cd $SOURCE_ROOT
    wget https://ftp.gnu.org/gnu/make/make-4.2.tar.gz
    tar -xvf make-4.2.tar.gz
    cd make-4.2
    ./configure
    make && sudo make install
    export PATH=/usr/local/bin/:$PATH
  • Build Python 3.10 (For RHEL 7.x)

    Instructions for building Python can be found here

  • RHEL (8.6, 8.8, 8.9)

    sudo yum install -y sed glibc-common gcc gcc-c++ gzip findutils zip unzip libxslt xmlto patch subversion ca-certificates xz xz-devel git wget tar make curl java-1.8.0-openjdk java-1.8.0-openjdk-devel perl openssl-devel ncurses-devel ncurses unixODBC unixODBC-devel glibc-locale-source glibc-langpack-en python3 rsync hostname diffutils
    sudo alternatives --set python /usr/bin/python3
    
  • RHEL (9.0, 9.2, 9.3)

    sudo yum install -y --allowerasing sed glibc-common gcc gcc-c++ gzip findutils zip unzip libxslt xmlto patch subversion ca-certificates xz xz-devel git wget tar make curl java-1.8.0-openjdk java-1.8.0-openjdk-devel perl openssl-devel ncurses-devel ncurses unixODBC unixODBC-devel glibc-locale-source glibc-langpack-en python3 rsync hostname diffutils
    
  • SLES (12 SP5, 15 SP5)

    sudo zypper install -y rsync make tar wget gcc gcc-c++ glibc-locale glibc-i18ndata sed curl zip unzip libxslt xsltproc patch subversion procps git-core python3-devel python3-xml java-1_8_0-openjdk  java-1_8_0-openjdk-devel perl libopenssl-devel libssh-devel ncurses-devel unixODBC unixODBC-devel xz gzip gawk net-tools
    sudo ln -sf /usr/bin/python3 /usr/bin/python
    
  • Ubuntu (20.04, 22.04, 23.10)

    sudo apt-get update
    sudo apt-get install -y locales openssl wget tar xz-utils make python3 xsltproc rsync git zip sed perl gcc g++ libncurses-dev libncurses5-dev unixodbc unixodbc-dev libssl-dev openjdk-8-jdk libxml2-utils
    sudo ln -sf /usr/bin/python3 /usr/bin/python
    
  • Install Erlang 26.2.1

    See this article for complete build/install instructions: Building Erlang on Z.

1.3) Set environment variables

export PATH=$PATH:$ERL_TOP/bin
sudo localedef -c -f UTF-8 -i en_US en_US.UTF-8
export LC_ALL=en_US.UTF-8

Note: ERL_TOP is defined when installing Erlang. However, if you install Erlang via script, erl is already in /usr/bin

1.4) Install Elixir

cd $SOURCE_ROOT
git clone https://github.com/elixir-lang/elixir.git
cd elixir && git checkout v1.15.7
make
sudo env PATH=$PATH make install
export PATH=/usr/local/bin:$PATH
elixir --version

1.5) Download the source and build RabbitMQ Server

cd $SOURCE_ROOT
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.13.0/rabbitmq-server-3.13.0.tar.xz
tar -xf rabbitmq-server-3.13.0.tar.xz
cd rabbitmq-server-3.13.0
make
sudo env PATH=$PATH make install   # For RHEL and SLES
sudo make install                  # For Ubuntu only

Step 2: Start RabbitMQ server(Optional)

2.1) Running RabbitMQ from source(Optional)

cd $SOURCE_ROOT/rabbitmq-server-3.13.0
sudo env PATH=$PATH make run-broker

2.2) Running RabbitMQ from script (Optional)

  • Create directory for RabbitMQ

    sudo mkdir /etc/rabbitmq
    

    Note: RabbitMQ comes with default built-in settings which will be sufficient for running your RabbitMQ server effectively. In case you need to customize the settings for the RabbitMQ server, copy the rabbitmq.config file into /etc/rabbitmq directory.

  • Enable RabbitMQ management plugin and start RabbitMQ server

    cd $SOURCE_ROOT/rabbitmq-server-3.13.0
    sudo ln -s $PWD/plugins deps/rabbit/plugins
    sudo mkdir -p ${SOURCE_ROOT}/rabbitmq-server-3.13.0/deps/rabbit/
    cp -r escript/ ${SOURCE_ROOT}/rabbitmq-server-3.13.0/deps/rabbit/
    sudo deps/rabbit/scripts/rabbitmq-plugins enable rabbitmq_management
    sudo deps/rabbit/scripts/rabbitmq-server

Note:
RabbitMQ management UI is available at http://localhost:15672
If build fails with erl: not found use below command.
sudo deps/rabbit/scripts/rabbitmq-server -detached

References:

Clone this wiki locally