[rabbitmq-discuss] Naming RabbitMQ nodes with complete domain names

447 views
Skip to first unread message

Max Bridgewater

unread,
Feb 18, 2011, 9:51:59 PM2/18/11
to rabbitmq...@lists.rabbitmq.com
Hi,

This is probably a silly question but it really baffles me right now.
The original issue is this: I'm trying to use JInterface to connect to
a rabbitmq cluster hosted on EC2. But I keep getting "Cannot connect
to peer node". My understanding is that this error is happening
because I'm using the address 'rab...@domain.org' to contact the
remote RabbitMQ node named: rabbit@domain. (Note the missing TLD).
That is, because there is no exact match between the node name given
to JInterface and the name of the node it is connecting to, the
connection fails.

I desperately tried configuring RabbitMQ to take the complete domain
name (domain.org) instead of just the short domain name (domain). Any
suggestion on how to resolve this issue?

Beyond this, this problem begs the question of how do RabbitMQ nodes
located on different machines across different domains communicate
with each other if the only way they can be referred to each other by
short name? Up until now, I've only clustered nodes on the same
machine.

I'm sure missing something. Please enlighten me.

Sincerely,
Max.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Alvaro Videla

unread,
Feb 19, 2011, 12:32:25 AM2/19/11
to Max Bridgewater, rabbitmq...@lists.rabbitmq.com
Have you tried changing the Erlang option -sname to -name?

That's the way Erlang uses to specify long names.

See http://erlang.org/doc/man/erl.html and then modify your rabbitmq-server script accordingly.

Cheers,

Alvaro

Sent from my iFad

Max Bridgewater

unread,
Feb 19, 2011, 12:49:39 PM2/19/11
to Alvaro Videla, rabbitmq...@lists.rabbitmq.com
Hi Alvaro,

I believe you are right. The according modification of the rabbitmq
scripts seems not that straightforward. Here is what I've got sofar:

a) Changed the option -sname to -name in rabbitmq-multi
b) Changed the node name initialization in rabbitmq-env from
NODENAME=rabbit@${HOSTNAME%%.*} to #NODENAME=rabbit@${HOSTNAME}
c) Changed the node names in rabbitmq.config to use full host names.
d) Cleared the mnesia database.

Now, when I attempt to start the nodes, hereunder is what I get.
Apparently, despite these modifications rabbitmq/erlang is still
attempting to set the short name.

Any idea what else I'm missing?
Thanks,
Max.

============================================
Starting all nodes...
Starting node rab...@ec2-174-122-225-215.compute-1.amazonaws.com...
Activating RabbitMQ plugins ...
0 plugins activated:

{error_logger,{{2011,2,19},{12,33,32}},"Can't set short node
name!\nPlease check your configuration\n",[]}

Alvaro Videla

unread,
Feb 19, 2011, 1:19:36 PM2/19/11
to Max Bridgewater, rabbitmq...@lists.rabbitmq.com
Restart the epmd process or if you are just running RabbitMQ then kill it after you stop the server.

Hope that helps.

Sent from my iFad

Max Bridgewater

unread,
Feb 19, 2011, 4:07:56 PM2/19/11
to Alvaro Videla, rabbitmq...@lists.rabbitmq.com
Thanks Alvaro. Unfortunately this still doesn't work for me. The steps
I followed are:

a) Stop rabbitmq
b) Change the option -sname to -name in rabbitmq-multi
c) Change the node name initialization in rabbitmq-env from


NODENAME=rabbit@${HOSTNAME%%.*} to #NODENAME=rabbit@${HOSTNAME}

d) Change the node names in rabbitmq.config to use full host names.
e) Cleare the mnesia database.
f) Reboot the complete machine
g) Start rabbitmq

The error message remains the same:
{error_logger,{{2011,2,19},{16,4,40}},"Can't set short node


name!\nPlease check your configuration\n",[]}

Regards,
Max.

Matthias Radestock

unread,
Feb 19, 2011, 5:52:21 PM2/19/11
to Max Bridgewater, rabbitmq...@lists.rabbitmq.com
Max,

Max Bridgewater wrote:
> Thanks Alvaro. Unfortunately this still doesn't work for me. The steps
> I followed are:
>
> a) Stop rabbitmq
> b) Change the option -sname to -name in rabbitmq-multi

You'd also need to change this in rabbitmq-server.

However, ...

>>>>> The original issue is this: I'm trying to use JInterface to connect to
>>>>> a rabbitmq cluster hosted on EC2. But I keep getting "Cannot connect
>>>>> to peer node". My understanding is that this error is happening
>>>>> because I'm using the address 'rab...@domain.org' to contact the
>>>>> remote RabbitMQ node named: rabbit@domain. (Note the missing TLD).
>>>>> That is, because there is no exact match between the node name given
>>>>> to JInterface and the name of the node it is connecting to, the
>>>>> connection fails.
>>>>>
>>>>> I desperately tried configuring RabbitMQ to take the complete domain
>>>>> name (domain.org) instead of just the short domain name (domain). Any
>>>>> suggestion on how to resolve this issue?

I'd suggest configuring your local name resolution s.t. the hostname of
the machine rabbit is running on resolves to the correct IP. That way
you don't have to mess with long names.

Btw, what are you trying to accomplish with JInterface?


Regards,

Matthias.

Santiago Ezcurra

unread,
May 23, 2013, 7:37:17 PM5/23/13
to rabbitmq...@googlegroups.com, rabbitmq...@lists.rabbitmq.com, Max Bridgewater
Hi there.....I know this is old thread, but I'm having the same problem.....the thing is that I'm trying to build a cluster on amazon ec2. there, there is no domain and the machines only have a hostname of the form ip-0-0-0-0. everything works fine for one node (and erlang starts with -name rabbit@ip-x-x-x-x), but when i try to join cluster to another node, there is no name resolution happening between both machines (other than specifying mutually on respectives ec/hosts). 
those machines does recognize the name ip-x-x-x-x.ec2.internal....but I'm just failing to configure this name. When i tried specifying this long name in NODENAME in env file, it's when erlang (or rabbitmq, don't know) complains with "can't get short name whatever". and maybe it's because the newer version, but I can't find where to change the -sname by -name in any scripts.....could you please have any advice for me ??

Thanks !

Santiago.
Reply all
Reply to author
Forward
0 new messages