Reputation: 11
I have 2 RabbitMQ servers and trying to cluster as per this link https://haptik.ai/tech/rabbitmq-cluster-failover/. Done all the required settings in server1 and in the server2 when i execute the below statement. I am getting the error
rabbitmqctl join_cluster [email protected]
Please find below the detailed error message
Clustering node rabbit@INCHNACCWAS01 with [email protected]
** (FunctionClauseError) no function clause matching in RabbitMQCtl.format_error/3
The following arguments were given to RabbitMQCtl.format_error/3:
# 1
{:badmatch, {:error, {:node_name, :short}}}
# 2
%{disc: false, longnames: false, node: :rabbit@INCHNACCWAS01, ram: false, timeout: :infinity}
# 3
RabbitMQ.CLI.Ctl.Commands.JoinClusterCommand
(rabbitmqctl) lib/rabbitmqctl.ex:367: RabbitMQCtl.format_error/3
(rabbitmqctl) lib/rabbitmqctl.ex:124: anonymous fn/5 in RabbitMQCtl.exec_command/2
(rabbitmqctl) lib/rabbitmqctl.ex:45: RabbitMQCtl.main/1
(elixir) lib/kernel/cli.ex:105: anonymous fn/3 in Kernel.CLI.exec_fun/2
Upvotes: 1
Views: 3558
Reputation: 9637
This is a known bug in that version of RabbitMQ. Please upgrade to the latest version.
Upvotes: 2
Reputation: 17
When I used
rabbitmqctl join_cluster rabbit@ip
I got this error,then I use
rabbitmqctl join_cluster rabbit@hostname
the problem sloved.Maybe you could use hostname.
Upvotes: 1
Reputation: 46
You can use rabbitmqctl status
for more information.
[root@node1 ~]# rabbitmqctl status
Status of node rabbit@node1 ...
Which means you current node name is node1
, and you should use
rabbitmqctl join_cluster rabbit@node1
command. Sometimes the RABBITMQ nodename is NOT the same as HOSTNAME.
According to this method, you can doublecheck EXACT node name of both this and target instance and then create correct adding-cluster command.
Upvotes: 2