Skip to content

Building RabbitMQ

aborkar-ibm edited this page Dec 30, 2021 · 82 revisions

Building RabbitMQ

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

  • Ubuntu 18.04 has 3.6.10-1
  • Ubuntu 20.04 has 3.8.2
  • Ubuntu 21.04 has 3.8.9-2
  • Ubuntu 21.10 has 3.8.9-3
  • SLES 15 SP2 has 3.8.3-3.3.4
  • SLES 15 SP3 has 3.8.11-3.3.3

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

  • RHEL (7.8, 7.9, 8.2, 8.4, 8.5)
  • SLES (12 SP5, 15 SP2, 15 SP3)
  • Ubuntu (18.04, 20.04, 21.04, 21.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.9.11/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 ant ant-junit xz xz-devel git wget tar make curl java-1.8.0-ibm java-1.8.0-ibm-devel wget tar make perl gcc gcc-c++ openssl openssl-devel ncurses-devel ncurses unixODBC unixODBC-devel fop 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.9 (For RHEL 7.x)

    Instructions for building Python can be found here

  • RHEL (8.2, 8.4, 8.5)

    sudo yum install -y sed  make glibc-common gcc gcc-c++ gzip findutils zip unzip libxslt xmlto patch subversion ca-certificates ant xz xz-devel git wget tar make curl java-1.8.0-openjdk java-1.8.0-openjdk-devel perl gcc 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
    
  • SLES (12 SP5, 15 SP2, 15 SP3)

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

    sudo apt-get update
    sudo apt-get install -y locales ant  openssl wget tar xz-utils make python3 xsltproc rsync git zip sed wget tar make perl openssl gcc g++ libncurses-dev libncurses5-dev unixodbc unixodbc-dev libssl-dev openjdk-8-jdk libwxgtk3.0-dev xsltproc fop libxml2-utils 
    sudo ln -sf /usr/bin/python3 /usr/bin/python
    
  • Ubuntu (20.04, 21.04, 21.10)

    sudo apt-get update
    sudo apt-get install -y locales ant  openssl wget tar xz-utils make python3 xsltproc rsync git zip sed wget tar make perl openssl gcc g++ libncurses-dev libncurses5-dev unixodbc unixodbc-dev libssl-dev openjdk-8-jdk xsltproc fop libxml2-utils
    sudo ln -sf /usr/bin/python3 /usr/bin/python
    
  • Install Erlang 24.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 git://github.com/elixir-lang/elixir
cd elixir && git checkout v1.12.3
make
sudo env PATH=$PATH make install
export PATH=/usr/local/bin:$PATH
elixir --version

1.5) Install Hex

cd $SOURCE_ROOT
git clone git://github.com/hexpm/hex.git
cd hex &&  git checkout v0.21.3
mix install
mix hex.info

1.6) Download the source and build RabbitMQ Server

cd $SOURCE_ROOT
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.9.11/rabbitmq-server-3.9.11.tar.xz
tar -xf rabbitmq-server-3.9.11.tar.xz
cd rabbitmq-server-3.9.11
sudo cp $SOURCE_ROOT/hex/_build/dev/lib/hex/ebin/*  deps/.mix/archives/hex-0.21.3/hex-0.21.3/ebin/
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.9.11
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 in /etc/rabbitmq directory.

  • Enable RabbitMQ management plugin and start RabbitMQ server

    cd $SOURCE_ROOT/rabbitmq-server-3.9.11
    sudo ln -s $PWD/plugins deps/rabbit/plugins
    sudo mkdir -p ${SOURCE_ROOT}/rabbitmq-server-3.9.11/deps/rabbit/
    cp -r escript/ ${SOURCE_ROOT}/rabbitmq-server-3.9.11/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