Cluster join never happens for manual clustering #380
When using manual clustering in this cookbook, rabbitmq(e.g. rabbit1-ubuntu-1404) starts as a member of a single node cluster named as its own hostname.
This is because the current join action process doesn't consider the current cluster name and only checks if the node is a part of whatever cluster or not.
This PR is to check if the node is a part of the desired cluster defined through the attribute ( node['rabbitmq']['clustering']['cluster_name'] ) so that the join action will happen if the node is a part of the wrong/(in my case, default=hostname) cluster.
referenced this pull request
Jul 6, 2016
The issue of the current logic was because it checks only if the node is a part of some cluster or not and skipped join process - so the missing test point here is to verify if the node is a part of the cluster with the target peers as well as being a member of the cluster named after the attribute.
By both ways, you could notice in case clustering logic is not working as it's expected.
There still seems to be a bug in this fix. I had to make the following change to get the second node to join the first node because the second node is already in a cluster with itself: