How to fix rabbitmq installation?
I brew installed rabbitmq, and had this problem several weeks later after installing. 

You may have a look at

/usr/local/etc/rabbitmq/rabbitmq-env.conf


and run in terminal:

$ hostname


make sure the value of hostname equals the value of NODENAME

You can set the value of hostname by

sudo scutil --set HostName xxx