Skip to content

[reopen of #125 as long discussion ] Node not join to cluster #359

@chrisduong

Description

@chrisduong

Hi,

I'm using rabbitmq cookbook v.4.7.0, and installed latest RabbitMQ version 3.6.1, I noticed that that the LWRP rabbitmq_cluster would only join the node into the cluster only_if "the node is not running any cluster.

However, whenever RabbitMQ server starts it would run in single cluster mode with the cluster name is the node's name itself.

This is the cluster status when the node2 first startup.

[root@node2 ~]# rabbitmqctl cluster_status
Cluster status of node rabbit@node2 ...
[{nodes,[{disc,[rabbit@node2]}]},
{running_nodes,[rabbit@node2]},
{cluster_name,<<"rabbit@node2">>},
{partitions,[]},
{alarms,[{rabbit@node2,[]}]}]

Which means the code block joined_cluster?(var_node_name, var_cluster_status) always return true, and Chef would complain and not join to the cluster:

Chef::Log.warn("[rabbitmq_cluster] Node is already member of #{current_cluster_name(var_cluster_status)}. Joining cluster will be skipped.")

The LWRP only join with the first node in the array, so it make more sense that we should check the cluster status from that node only (for preventing failure when joining) than checking the running_nodes from the "joining node".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions