我在 Lucid EC2 实例上全新安装了rabbitmq-server
。主机名设置正确,但 rabbitmq 不会获取主机名,并坚持调用自身localhost
。有什么办法可以让它改正吗?
$ cat /etc/hostname
mifune
$ hostname
mifune
$ cat /etc/hosts
127.0.0.1 localhost mifune
...
$ sudo rabbitmqctl status
Status of node rabbit@localhost ...
[{running_applications,[{rabbit,"RabbitMQ","1.7.2"},
{mnesia,"MNESIA CXC 138 12","4.4.12"},
{os_mon,"CPO CXC 138 46","2.2.4"},
{sasl,"SASL CXC 138 11","2.1.8"},
{stdlib,"ERTS CXC 138 10","1.16.4"},
{kernel,"ERTS CXC 138 10","2.13.4"}]},
{nodes,[rabbit@localhost]},
{running_nodes,[rabbit@localhost]}]
...done.
答案1
您是否相信切换顺序/etc/hosts/
:
127.0.0.1 localhost mifune
到:
127.0.0.1 mifune localhost
有效果吗?
确保在执行此操作之前停止 rabbitmq,或者 rabbitmq 会忘记自己是谁,开始在附近徘徊,缠着每个人询问去超市的路线。它还可能会变得精神失常,需要彻底清除并重新安装。