[rabbitmq-discuss] FYI: RabbitMQ default installation broken on Ubuntu (potential all Debian-likes)

René Gallati regal at nine.ch
Fri Sep 7 16:42:52 BST 2012


On 09/07/2012 05:14 PM, Simon MacMullen wrote:
> On 07/09/12 14:49, Rene Gallati wrote:
> <snip>
>> What is really happening is, that rabbitmq-server
>> absolutely requires that the hostname-part be defined as entry in
>> /etc/hosts as name for 127.0.0.1 !
> <snip>
>
> This is not true.
>
> It *does* require that the hostname resolve, i.e. that "ping `hostname`"
> works and maps to *an* IP address of the machine. As Tim says, this is
> an Erlang requirement, but I don't think it's too hideous.

There are some subtle differences here. The machine has a perfect 
resolvable hostname. The difference is, if the hostname does NOT resolve 
to 127.0.0.1 (which I expect is pretty much standard) then it does not 
work.

Put simply, if your machine is called testmachine and has an IP address 
of 8.7.6.5 then it rabbitmq-server will fail to start.

As soon as you change /etc/hosts from:

127.0.0.1 localhost

8.7.6.5	testmachine testmachine.domain.tld

to:

127.0.0.1 localhost testmachine

8.7.6.5 testmachine.domain.tld

THEN it will work.

I'm sure you'll agree that this is neither standard nor sensible.

Note that no matter what you do, the machine is always perfectly capable 
to ping itself, ie. "host testmachine", "ping testmachine" etc. will 
always give the expected and correct result, but until you add the 
hostname to the localhost entry, rabbitmq-server will simply be unable 
to start in the default configuration as it is being installed from the 
currently available package in the repository.

> And for the record every installation of Ubuntu I've seen (including a
> recent 12.04 LTS install), does add the hostname to /etc/hosts. But this
> is not necessary - on my main development machine the hostname actually
> resolves over DNS, and RabbitMQ starts fine.

Yes they add the hostname but not to the *127.0.0.1* entry. That is the 
difference. And without that the current standard package won't start on 
a freshly installed Ubuntu Linux 12.04 LTS - and I suspect on a lot of 
other variants neither.

Apparently that is a problem of Erlang and not RabbitMQ, but I propose 
as a temporary workaround to not let the package-installer start the 
service since that fails and causes the whole installation to report 
error and abort. Instead either display a message that one needs to set 
NODENAME to rabbit at localhost (or actually change the file that is being 
installed by default to this value) so that it works out of the box as 
it probably should.

CU

René


More information about the rabbitmq-discuss mailing list