report an error when building a rocketmq stand-alone environment.
Problem encountered: using command
nohup sh mqnamesrv &
The following error occurred
java. net. UnknownHostException: hadoop03: hadoop03: unknown error
at java. net. InetAddress. getLocalHost(InetAddress.java:1505)
at org. apache. rocketmq. common. BrokerConfig. localHostName(BrokerConfig.java:201)
at org. apache. rocketmq. common. BrokerConfig.& lt; init> (BrokerConfig.java:39)
at org. apache. rocketmq. broker. BrokerStartup. createBrokerController(BrokerStartup.java:101)
at org. apache. rocketmq. broker. BrokerStartup. main(BrokerStartup.java:56)
Caused by: java. net. UnknownHostException: hadoop03: unknown error
at java. net. Inet4AddressImpl. lookupAllHostAddr(Native Method)
at java. net. InetAddress$2. lookupAllHostAddr(InetAddress.java:928)
at java. net. InetAddress. getAddressesFromNameService(InetAddress.java:1323)
at java. net. InetAddress. getLocalHost(InetAddress.java:1500)
… 4 common frames omitted
This is because the IP address corresponding to your host name cannot be found during startup. Just add the above configuration in /etc/hosts
Solution:
Operate according to the following command
Add the mapping marked in red to the file. Note: permission problems may occur during editing, and the root account needs to be switched
:wq! Save exit
Use the JPS command to check the process to see if NamesrvStartup has been started. If it is about closing it
sh mqshutdown namesrv
Start mqnamesrv again
nohup sh mqnamesrv &
Check the log and solve the problem
Read More:
- failed to obtain in-memory shard lock [How to Solve]
- [Solved] JRebel Error: ERROR Failed to obtain seat. Unable to connect to license server
- [Solved] Docker Error: Failed to connect to bus: Host is down
- [Solved] Flyter uses screenutil to obtain screen width and height initialization error
- Failed to parse host mirrors.opencas.cn [How to Solve]
- How to Solve Clickhouse restart error: Cannot obtain value of path from config file…
- Error: Host Key Verification Failed [How to Solve]
- ADS1.2 Error: cannot obtain license [How to Solve]
- Centos7 hive started to report an error. There is no route to the host. The firewall has been closed
- [Solved] SSH + GIT Operate Error: Host key verification failed
- RabbitMQ:address (cannot connect to host/port) [How to Solve]
- [SpringBoot] Maven Error: Connection refused to host: 127.0.0.1
- How to Solve SSH Login Error: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
- [Solved] ERROR: Unknown host CPU architecture: arm64
- [Errno 14] curl#6 – “Could not resolve host: yum.dockerproject.org; Unknown error“
- [Solved] Could not resolve host: yum.dockerproject.org; Unknown error
- [Solved] Git Run Error: Could not resolve host: github.com
- if a proxy or similar is necessary `net.git-fetch-with-cli`, Rust Complete `Couldn‘t resolve host name (Coul
- [Solved] CDH ipa: ERROR: Host ‘cdh-master-v02.yunes.com‘ does not have corresponding DNS A/AAAA record
- It can be opened with localhost, but not with IP address. The request host name is invalid