1. Error message
Start MQ, rabbitmq-server start
Error:
zhaohui@zhaohuideMacBook-Pro rabbitmq % rabbitmq-server start
BOOT FAILED
===========
ERROR: epmd error for host localhost: nxdomain (non-existing domain)2023-08-10 09:19:51.202102+08:00 [error] <0.135.0>
2023-08-10 09:19:51.202102+08:00 [error] <0.135.0> BOOT FAILED
2023-08-10 09:19:51.202102+08:00 [error] <0.135.0> ===========
2023-08-10 09:19:51.202102+08:00 [error] <0.135.0> ERROR: epmd error for host localhost: nxdomain (non-existing domain)
2023-08-10 09:19:51.202102+08:00 [error] <0.135.0>
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> supervisor: {local,rabbit_prelaunch_sup}
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> errorContext: start_error
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> reason: {epmd_error,"localhost",nxdomain}
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> offender: [{pid,undefined},
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> {id,prelaunch},
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> {mfargs,{rabbit_prelaunch,run_prelaunch_first_phase,[]}},
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> {restart_type,transient},
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> {significant,false},
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> {shutdown,5000},
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0> {child_type,worker}]
2023-08-10 09:19:52.220312+08:00 [error] <0.135.0>
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> crasher:
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> initial call: application_master:init/4
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> pid: <0.133.0>
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> registered_name: []
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> exception exit: { {shutdown,
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> {failed_to_start_child,prelaunch,
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> {epmd_error,"localhost",nxdomain}}},
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> {rabbit_prelaunch_app,start,[normal,[]]}}
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> in function application_master:init/4 (application_master.erl, line 142)
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> ancestors: [<0.132.0>]
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> message_queue_len: 1
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> messages: [{'EXIT',<0.134.0>,normal}]
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> links: [<0.132.0>,<0.44.0>]
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> dictionary: []
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> trap_exit: true
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> status: running
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> heap_size: 376
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> stack_size: 28
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> reductions: 170
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0> neighbours:
2023-08-10 09:19:52.221082+08:00 [error] <0.133.0>
2023-08-10 09:19:52.241139+08:00 [notice] <0.44.0> Application rabbitmq_prelaunch exited with reason: { {shutdown,{failed_to_start_child,prelaunch,{epmd_error,"localhost",nxdomain}}},{rabbit_prelaunch_app,start,[normal,[]]}}
Kernel pid terminated (application_controller) ({application_start_failure,rabbitmq_prelaunch,{ {shutdown,{failed_to_start_child,prelaunch,{epmd_error,"localhost",nxdomain}}},{rabbit_prelaunch_app,start,[normal,[]]}}})Crash dump is being written to: erl_crash.dump...done
2. Reasons and solutions
According to the error message, there is an error of epmd error for host localhost: nxdomain (non-existing domain). This error is generally caused by DNS resolution issues.
The solution is as follows:
-
Check if your host can successfully resolve the localhost domain name. It can be tested with the following command:
ping localhost
-
If it cannot be resolved, there may be a problem with the DNS configuration. You can try modifying
/etc/hosts
the file tolocalhost
map to the correct IP address, for example:127.0.0.1 localhost ::1 localhost
-
Make sure your internet connection is working. Sometimes an unstable or disconnected network connection will cause DNS resolution to fail.
-
Check the RabbitMQ configuration file for errors. You can check
rabbitmq.conf
the configuration items in or other related configuration files to ensure that there are no wrong or illegal configurations.