Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check-rabbitmq-node-health picks only first nodes in the cluster #43

Open
rgedagit opened this issue Aug 28, 2016 · 8 comments
Open

check-rabbitmq-node-health picks only first nodes in the cluster #43

rgedagit opened this issue Aug 28, 2016 · 8 comments

Comments

@rgedagit
Copy link

When we have a list of nodes in cluster it always pick first nodes in list and show health is ok.

call is made for nodes ("#{url_prefix}://#{host}:#{port}/api/nodes/) -> returns a list of all nodes in cluster
function to pick node nodeinfo = JSON.parse(resource.get)[0] -> picked first nodes in the list.

ex: if the list is rabbitmq1, rabbitmq2, rabbitmq3, it checks the health on rabbitmq1 only always as it is first is list.

@arjuntalla
Copy link

it is low hanging fruit and here is the proposal for the fix if everyone agrees i will move forward with the fix

change the call from "#{url_prefix}://#{host}:#{port}/api/nodes”, -> "#{url_prefix}://#{host}:#{port}/api/nodes/rabbit@#{host}”

change the nodeinfo from nodeinfo = JSON.parse(resource.get)[0] -> nodeinfo = JSON.parse(resource.get)

make the host address not optional and make the hostname as real hostname

@rgedagit
Copy link
Author

Not a bad idea, but why can't we use rabbitmqctrl instead of the admin API and also makes less complex

@majormoses
Copy link
Member

@arjuntalla can you link me to the proposal?

@majormoses
Copy link
Member

Apologies misread thought you meant there was an existing proposal.

@majormoses
Copy link
Member

that makes sense to me, we should maybe have a default of the first node (or even better try to find the right node based on something we can know like its ipaddress?). This makes it a backwards compatible change.

@rocdove
Copy link

rocdove commented Jul 10, 2017

"#{url_prefix}://#{host}:#{port}/api/nodes/rabbit@#{host}”, it‘s a good diea. but the ’host ‘ must a hostname, IP address will don't work.

@majormoses
Copy link
Member

makes sense from what I saw of your commit I think yours works, do you want to pr it for a bit closer review?

@Infraded
Copy link

Infraded commented Aug 3, 2017

I've submitted a PR to fix this with configurable options in PR #70. Some of the fixes listed in this thread make assumptions about node naming that wouldn't be compatible with non-default naming methods. This also adds 3 new options to override the node name determined by the check if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants