Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nacos 0.8.0 cluster environment occurred to find local peer: 127.0.0.1:8848 error #770

Closed
polluxxing opened this issue Feb 15, 2019 · 4 comments
Labels
kind/bug Category issues or prs related to bug.

Comments

@polluxxing
Copy link

nacos.log信息如下:
java.lang.IllegalStateException: unable to find local peer: 127.0.0.1:8848, all peers: [192.168.0.20:8848, 192.168.0.21:8848, 192.168.0.19:8848]
at com.alibaba.nacos.naming.raft.PeerSet.local(PeerSet.java:191)
at com.alibaba.nacos.naming.monitor.PerformanceLoggerThread.collectmetrics(PerformanceLoggerThread.java:114)

naming-raft.log信息如下:
2019-02-15 16:14:45,001 WARN [IS LEADER] no leader is available now!

host文件如下:
image

cluster.conf文件如下:
#it is ip
#example
192.168.0.19:8848
192.168.0.20:8848
192.168.0.21:8848

@nacos-bot
Copy link
Collaborator

Hi @nickzxing, we detect non-English characters in the issue. This comment is an auto translation from @nacos-bot to help other users to understand this issue.
We encourage you to describe your issue in English which is more friendly to other users.

Nacos 0.8.0 cluster environment occurred to find local peer: 127.0.0.1:8848 error

The nacos.log information is as follows:
java.lang.IllegalStateException: unable to find local peer: 127.0.0.1:8848, all peers: [192.168.0.20:8848, 192.168.0.21:8848, 192.168.0.19:8848]
at com.alibaba.nacos.naming.raft.PeerSet.local(PeerSet.java:191)
at com.alibaba.nacos.naming.monitor.PerformanceLoggerThread.collectmetrics(PerformanceLoggerThread.java:114)

The naming-raft.log information is as follows:
2019-02-15 16:14:45,001 WARN [IS LEADER] no leader is available now!

The host file is as follows:
image

The cluster.conf file is as follows:
#it is ip
#example
192.168.0.19:8848
192.168.0.20:8848
192.168.0.21:8848

@nacos-bot nacos-bot changed the title Nacos 0.8.0集群环境发生 unable to find local peer: 127.0.0.1:8848的错误 Nacos 0.8.0 cluster environment occurred to find local peer: 127.0.0.1:8848 error Feb 15, 2019
@nacos-bot nacos-bot added the kind/bug Category issues or prs related to bug. label Feb 15, 2019
@polluxxing
Copy link
Author

当我将每个节点的cluster.conf中对应自身ip的配置换成127.0.0.1,如下:
192.168.0.19机器的cluster.conf配置:
127.0.0.1:8848
192.168.0.20:8848
192.168.0.21:8848

192.168.0.20机器的cluster.conf配置:
192.168.0.19:8848
127.0.0.1:8848
192.168.0.21:8848

192.168.0.21机器的cluster.conf配置:
192.168.0.19:8848
192.168.0.20:8848
127.0.0.1:8848

此时nacos.log无报错信息:
image

naming-raft.log依然有报错信息:
image

@polluxxing
Copy link
Author

必须保证InetAddress.getLocalHost().getHostAddress()或者hostname -i打印的结果是192.xxx.xxx.xxx而不是127.0.0.1才行。希望文档中某些问题能详细说明,或者优化
image

@nkorange
Copy link
Collaborator

@nickzxing
This problem is going be be fixed in Nacos 0.9.0. Refer to #580 and #704 . The document will also be updated soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

No branches or pull requests

3 participants