RabbitMQ Installation on Ubuntu 18.04 Fails

225 views
Skip to first unread message

Alessandro

unread,
Feb 1, 2020, 6:44:47 PM2/1/20
to rabbitmq-users
I am trying to set up a shell script to install RabbitMQ on a VM running Ubuntu 18.04. I have followed the instructions on the RabbitMQ web site and I have arrived at the script given below. The Erlang part of the script appears to be successful. The RabbitMQ part, too, appears to be successful but then the attempt to start the RabbitMQ server fails with: "Failed to start RabbitMQ broker".

I have tried several variants of the script given below and I actually found one which nearly works, in the sense that it is successful but only some of the time (e.g. today I ran it on two identical VMs and it was successful on one VM instance but failed on the other VM instance).

So my question is: where can I find an installation procedure for RabbitMQ for Ubuntu 18.04?


curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -

sudo apt
-key adv --keyserver "hkps://keys.openpgp.org" --recv-keys "0x0A9AF2115F4687BD29803A206B73A36E6026DFCA"

sudo apt
-get install apt-transport-https

## Add Bintray repositories that provision latest RabbitMQ and Erlang 21.x releases
sudo tee
/etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
deb http
://dl.bintray.com/rabbitmq-erlang/debian bionic erlang-21.x
EOF

## Configure apt to install erlang-* packages from Bintray and not standard Debian or Ubuntu repository:
sudo tee
/etc/apt/preferences.d/erlang <<EOF
Package: erlang*
Pin: release o=Bintray
Pin-Priority: 1000
EOF

sudo apt
-get update -y

# This is recommended. Metapackages such as erlang and erlang-nox must only be used
# with apt version pinning. They do not pin their dependency versions.
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

# ------------------------------------------------------------------------------
echo
"-- Install RabbitMQ  --"

sudo apt
-get update -y

## Install prerequisites
sudo apt
-get install curl gnupg -y

## Install RabbitMQ signing key
curl
-fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -

## Install apt HTTPS transport
sudo apt
-get install apt-transport-https

## Add Bintray repositories that provision latest RabbitMQ and Erlang 21.x releases
sudo tee
/etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
## Installs the latest Erlang 22.x release.
## Change component to "erlang-21.x" to install the latest 21.x version.
## "bionic" as distribution name should work for any later Ubuntu or Debian release.
## See the release to distribution mapping table in RabbitMQ doc guides to learn more.
deb https
://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
deb https
://dl.bintray.com/rabbitmq/debian bionic main
EOF

## Update package indices
sudo apt
-get update -y

## Install rabbitmq-server and its dependencies
sudo apt
-get install rabbitmq-server -y --fix-missing


Gavin M. Roy

unread,
Feb 1, 2020, 7:56:29 PM2/1/20
to rabbitm...@googlegroups.com
I'd try following the instructions on the official documentation:


And specifically, install the Debian packages of Erlang that are maintained by the RabbitMQ team instead of what's packaged by the Ubuntu team.

Gavin

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/d911b4d0-b701-4129-9c20-eb4046d1e920%40googlegroups.com.

Alessandro

unread,
Feb 2, 2020, 8:07:56 AM2/2/20
to rabbitmq-users
Thanks for your feedback, Gavin.

Following the instructions on the official documentation is what I thought I was doing (but, of course, I may have got something wrong -- the official instructions are not straightforward).

I have tried using the Debian packages as you suggested (I tried both Stretch and Buster) but without luck. I guess the issue is some incompatibility between RabbitMQ and Erlang.

My question then remains: is there a reliable way of installing RabbitMQ on a clean Ubuntu 18.04 platform? 
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

Alessandro

unread,
Feb 2, 2020, 12:43:29 PM2/2/20
to rabbitmq-users
I would like to add to my original posting that I tried several procedures for RabbitMQ installations on Ubuntu 18.04 but they all failed. The last one was derived from an Ask Ubuntu Post by Luke Bakken:

apt-get install -y sudo
apt
-get update -y
apt
-get install curl gnupg -y
curl
-fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -
apt
-get install apt-transport-https
tee
/etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
deb https
://dl.bintray.com/rabbitmq-erlang/debian bionic erlang

deb https
://dl.bintray.com/rabbitmq/debian bionic main

EOF
apt
-get update -y
apt
-get install rabbitmq-server -y --fix-missing

In all cases, I attempted the RabbitMQ installation on a VM where I had just installed Ubuntu 18.04 Server. The failure is reported at the end of the installation procedure through message: "Failed to start RabbitMQ broker".

Quite possibly, I am doing something terribly stupid. In that case, I would be much obliged to anyone pointing me to my error. Or else there is something broken with the RabbitMQ installation for Ubuntu 18.04 (which I was able to do multiple times in the past months).

Luke Bakken

unread,
Feb 2, 2020, 7:46:32 PM2/2/20
to rabbitmq-users
Hi Alessandro,

It would be very helpful if you could provide output. Complete installation output, the RabbitMQ logs and journalctl logs for the rabbitmq-server.service unit are a good start.

Thanks,
Luke

Luke Bakken

unread,
Feb 2, 2020, 7:59:01 PM2/2/20
to rabbitmq-users
For what it's worth, I just used the attached Vagrantfile to bring up a Ubuntu 18.04 VM with RabbitMQ installed. The script is identical to the one posted on Ask Ubuntu.

I have also attached the complete provisioning output. Maybe you can spot a difference with your environment.

Luke
provisioning-output.txt
Vagrantfile

Alessandro

unread,
Feb 3, 2020, 4:26:11 PM2/3/20
to rabbitmq-users
Hello Luke,

Here is what I have done:
  1. I have create a new VM and I have installed Ubuntu 18.04 Server on it
  2. After completion of the installation, I have run script TeConfigVmRabbitMQ.sh to execute your recommended RabbitMQ installation procedure. The output of the installation script was re-directed to RabbitmqInst.log. Both the script and its log file are attached.
  3. The installation failed. The ouputs of "journalctl -xe" and "systemctl status rabbitmq-server.service" are attached.
  4. Directory /var/log/rabbitmq is empty
I am unable to evaluate the content of the log files. My impression is that the repository from which the RabbitMQ/Erlang packages are downloaded is corrupted. The background to this belief is that I have had situations where exactly the same installation procedure executed in exactly the same environment sometimes succeeded and sometimes failed; the outcome might depend on which repository is used in a given run. 

Any help is appreciated ...
TeConfigVmRabbitMQ.sh
journalctl.log
RabbitmqInst.log
systemctlStatus.log

Luke Bakken

unread,
Feb 3, 2020, 8:45:14 PM2/3/20
to rabbitmq-users
Hello,

I don't really see anything unusual in the output except that RabbitMQ won't start. If you log in as root, and run rabbitmq-server in the foreground, do you get more information? Can you provide the complete log files from /var/log/rabbitmq? Are there any erl_crash.dump files?

It is extremely unlikely that there is a problem with our package repositories simply because we would be hearing about this from many other people.

For what it's worth I just re-ran vagrant using the Vagrantfile I provided earlier and everything installed and started as expected.

Thanks,
Luke

Alessandro

unread,
Feb 4, 2020, 3:08:28 AM2/4/20
to rabbitmq-users
Good Morning Luke,

I logged in again on the same VM where I made yesterday's experiment (a newly installed VM with Ubuntu 18.04 Server) and ran rabbitmq-server under sudo. Here is the outcome:

rabbitmq-server.png


As you can see, I get an "epmd error for host pnp-vm2: address (cannot connect to host/port)". I have seen that there are a few other reports for this error but I cannot quite understand them.

I have also checked the /var/log/rabbitmq/ directory but it is empty.

Thanks in Advance for your Help & Regards,
Alessandro

Luke Bakken

unread,
Feb 4, 2020, 11:27:15 AM2/4/20
to rabbitmq-users
Hi,

Does the host name pnp-vm2 resolve correctly using a tool like nslookup or dig? Can you run this command and provide some output -

ping pnp-vm2

Luke

Alessandro

unread,
Feb 4, 2020, 12:12:39 PM2/4/20
to rabbitmq-users
Hello Luke,

If I do "ping pnp-vm2", I get a "Destination Host Unreachable" reply as in this snapshot:


If enter the command "hostname", I get "pnp-vm2" as response.

If I do "nslookup pnp-vm2" (not quite sure if this makes sense), I get the following reply:


If I perform "ifconfig -a", I get the following reply:


Am I perhaps missing some essential component? Note again that, at present, I am running on a VM where all I did was to run the installation script for Ubuntu 18.04 Server (ubuntu-18.04.2-live-server-amd64). Over the week-end, I tried first installing a LAMP server and then running the RabbitMQ installation script but still without success.

Thanks & Regards,
Alessandro

Luke Bakken

unread,
Feb 4, 2020, 12:22:48 PM2/4/20
to rabbitmq-users
Hello -

Yep, you've got some serious misconfiguration going on.

When you run ping pnp-vm2 it must resolve to either 127.0.0.1 or the IP address of the machine (10.0.2.15).

Your nslookup output suggests you are running a local DNS server that has very incorrect information about what the IP address should be for pnp-vm2.

At this point you'll have to figure out why DNS isn't working correctly in your environment. The simplest solution may be to add an entry in /etc/hosts for pnp-vm2, but your DNS resolver must also be set up to use that file first before other sources. Look at the manual page for resolv.conf

Thanks,
Luke

Alessandro

unread,
Feb 5, 2020, 4:26:15 PM2/5/20
to rabbitmq-users
Hello Luke,

Today, I re-started my VM in a different environment and, to my surprise, I found that the pnp-vm2 hostname is correctly resolved ("ping pnp-vm2" now works) and I was also able to re-start rabbitMQ. Hence, the problems I had experienced had nothing to do with RabbitMQ. I still do not understand how it is possible that the same VM might sometimes start up with a well-resolved hostname and other times with an unresolved hostname (maybe this has something to do with the DHCP server to which it connects) but this is an issue for another forum. In the meantime, I must thank you for your analyses and for having pointed me in the right direction.

Best Regards,
Alessandro
Reply all
Reply to author
Forward
0 new messages