ラップトップに RabbitMQ をインストールしました。サーバー ( rabbitmq-server -detached
)を起動してから、rabbitmqctl start_app
問題なく動作します (私の Java アプリケーションは接続してメッセージを送受信できます)。
$ rabbitmqctl start_app
Starting node 'rabbit@11-020-7206' ...
しかし、ネットワークが異なる別の場所に行くと、ラップトップは別のホスト名を取得し、それで何もできなくなります。停止または開始しようとすると、ノードがダウンしているというエラーが表示されます。
$ rabbitmqctl stop
Stopping and halting node 'rabbit@Mahdis-MacBook-Pro' ...
Error: unable to connect to node 'rabbit@Mahdis-MacBook-Pro': nodedown
DIAGNOSTICS
===========
attempted to contact: ['rabbit@Mahdis-MacBook-Pro']
rabbit@Mahdis-MacBook-Pro:
* connected to epmd (port 4369) on Mahdis-MacBook-Pro
* epmd reports node 'rabbit' running on port 25672
* TCP connection succeeded but Erlang distribution failed
* suggestion: hostname mismatch?
* suggestion: is the cookie set correctly?
* suggestion: is the Erlang distribution using TLS?
current node details:
- node name: 'rabbitmq-cli-14528@Mahdis-MacBook-Pro'
- home dir: /Users/mahdi
- cookie hash: HBqyY/jYPLAyrH1wt3dTWQ==
サーバーを完全に起動しようとすると、ノードが実行されていると表示されます。
$ rabbitmq-server -detached
Warning: PID file not written; -detached was passed.
ERROR: node with name "rabbit" already running on "Mahdis-MacBook-Pro"
この混乱を避けるためにホスト名を修正するにはどうすればよいですか?