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 cluster.conf add ip:port records issue #12352

Open
chixiaopao opened this issue Jul 15, 2024 · 5 comments
Open

nacos cluster.conf add ip:port records issue #12352

chixiaopao opened this issue Jul 15, 2024 · 5 comments

Comments

@chixiaopao
Copy link

Describe the bug
nacos version: 2.1.2
when I use nacos cluster mode, configure it in cluster.conf using dns.
referring to KomachiSion's suggestion in this issue link. @KomachiSion
#3858
the ip information is still added.

Actually behavior
An IP record is automatically added.
image
Error Logs (unable to find local peer: addedIp + port)
image

How to Reproduce
use dns for nacos cluster mode

Desktop (please complete the following information):

  • Centos
  • Version nacos 2.1.2
@chixiaopao
Copy link
Author

Our company does not let us know the IP information. so this parameter : nacos.inetutils.ip-address is not ok for us.

@chixiaopao
Copy link
Author

After research, it is necessary to configure nacos.inetutils.ip-address as the dns address, but the dns address must meet the following rules:
[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(.[a-zA-Z0-9][-a-zA-Z0-9]{0,62 })+.?

@KomachiSion
Copy link
Collaborator

sorry, I can't get the key point in your issue, in nacos k8s demo, it use dns(domain) way to configura cluster.conf and it works well in my k8s env for thousands of nacos cluster.

Is it your domain config with wrong?

@chixiaopao
Copy link
Author

hi @KomachiSion

thank you for your feedback.
We haven't used k8s yet.
Our prod env and dev env are isolated. We can't login the prod env to do some operations, and our admin does not allow us to directly use IP to config cluster.conf in the prod env. We can only use hostname/dns to config it.
after my test, If use hostname/dns, nacos will check whether its own IP is in the cluster.conf list when it starts. If it does not exist, it will add the IP to the list. I looked at the source code and found that (nacos.inetutils.ip-address or nacos.server.ip) is configured as hostname/dns then no new record will be added to cluster.conf during detection.

But there is a regex rule: [a-zA-Z0-9][-a-zA-Z0-9]{0,62}(.[a-zA-Z0-9][-a-zA-Z0-9]{0,62 })+.? which is used for check the hostname/dns, it need the hostname/dns must be contains (.) in the hostname/dns, I don't think it makes sense. Our company's host name does not have (.) when it is defined.

I'm not sure if my understanding is correct. I directly modified the regular expression and configured nacos.inetutils.ip-address: hostname in the prod env. Is this correct?

@chixiaopao
Copy link
Author

chixiaopao commented Jul 18, 2024

sorry, this is correct regular expression: [a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants