-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Does nacos support to register a instance with host name? #963
Comments
@riyueshiwang What is the need of registering hostname? Why not IP? |
@nkorange Now we use host name like this 'mesos-slave-online717-bjdxt9.cloud.xxx' in our company. It's not easy to get the actural IP for some reason. Before we used eureka1.x to register and it worked, and now we expect to change our registry from eureka to nacos. |
@riyueshiwang You have a good point, it will be supported in the next one or two version. |
能否增加一个配置参数,让用户可以指定是否优先使用hostname映射的ip地址?即优先使用 InetAddress.getLocalHost() 获取的ip地址。 |
@nkorange I would like to try this. Could you help me to start this ? |
@Albert-Hugo Great, first please get familiar with the code in naming module, you can start with the class 'Instance'. |
@nkorange Ok, thank you. |
@nkorange after I change some code and try to build project and then I run this command 'mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V' . It shows this error message. 'PMD Failure: com.alibaba.nacos.naming.core.Instance:300 Rule:UndefineMagicConstantRule Priority:3 魔法值【":"】.' . Where should I define this magic constant to fix this bug? |
@Albert-Hugo It's already defined, use UtilsAndCommons.IP_PORT_SPLITER. |
@nkorange Thanks. It is ok now. But I wonder when should I use this kind constants in the project. Because I saw some of codes that it just using plain string like I did , but it dose not break the build rule. |
[ISSUE #963] to support registering instance with host name
Issue Description
Type: feature request
Describe what happened (or what feature you want)
I used host name instead of ip to register instance while using nacos, i got this error as follows. Does nacos support to register a instance with host name?
Describe what you expected to happen
As we all use host name instead of ip, I expect to register and update the instance with host name.
How to reproduce it (as minimally and precisely as possible)
As describe above.
Tell us your environment
nacos_1.0.0_rc2
Anything else we need to know?
The text was updated successfully, but these errors were encountered: