Different cluster node names #3114
-
Hi, [root@host1 ~]# rabbitmqctl eval "rabbit_mnesia:cluster_nodes(all)." [root@host2 ~]# rabbitmqctl eval "rabbit_mnesia:cluster_nodes(all)." [root@host3 ~]# rabbitmqctl eval "rabbit_mnesia:cluster_nodes(all)." [root@host3 ~]# rabbitmqctl cluster_status Cluster name: [email protected] Disk Nodes [email protected] Running Nodes [email protected] Versions [email protected]: RabbitMQ 3.8.17 on Erlang 24.0.2 Maintenance status Node: [email protected], status: not under maintenance Alarms (none) Network Partitions (none) Listeners Node: [email protected], interface: [::], port: 15672, protocol: http, purpose: HTTP API Feature flags Flag: drop_unroutable_metric, state: disabled |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can explicitly set cluster name to any value you like. By default it is "computed" from the name of the node itself: -spec cluster_name() -> binary().
cluster_name() ->
case rabbit_runtime_parameters:value_global(cluster_name) of
not_found -> cluster_name_default();
Name -> Name
end.
cluster_name_default() ->
{ID, _} = parts(node()),
FQDN = rabbit_net:hostname(),
list_to_binary(atom_to_list(make({ID, FQDN}))). so when a cluster is formed in parallel every node will have its own value. The name is not used by RabbitMQ except for some entities declared by Federation links, so I don't see any issue with it. There is no way to solve this without requiring a sequential node |
Beta Was this translation helpful? Give feedback.
-
A couple more things are worth mentioning. You can explicitly set cluster ID via Also, nodes have an internal cluster ID that's not exposed to the user. That is used by Tanzu RabbitMQ (the commercial edition) and are not exposed to the user in any way. So when a node needs a unique cluster ID that's consistent, there is such mechanism and it cannot be changed by the users. |
Beta Was this translation helpful? Give feedback.
A couple more things are worth mentioning. You can explicitly set cluster ID via
rabbitmq.conf
which would make it available to every cluster member even very early on boot. Perhaps that's what you want here, instead of using CLI tools to set cluster name.Also, nodes have an internal cluster ID that's not exposed to the user. That is used by Tanzu RabbitMQ (the commercial edition) and are not exposed to the user in any way. So when a node needs a unique cluster ID that's consistent, there is such mechanism and it cannot be changed by the users.