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-server-1.4.1-SNAPSHOT 读取application.properties是否生效? #4556

Closed
geek-lwh opened this issue Dec 23, 2020 · 3 comments · Fixed by #4590
Closed

nacos-server-1.4.1-SNAPSHOT 读取application.properties是否生效? #4556

geek-lwh opened this issue Dec 23, 2020 · 3 comments · Fixed by #4590
Assignees
Labels
kind/bug Category issues or prs related to bug.
Milestone

Comments

@geek-lwh
Copy link

geek-lwh commented Dec 23, 2020

nacos-server-1.4.1-SNAPSHOT 集群启动
application.properties 文件修改 server.port=8849,而非默认8848.
cluster.conf 添加3个集群节点 ip1:8849,ip2:8849,ip3:8849
运行start.sh 启动失败 8848端口被占用(该机器上已经有其他项目使用了8848端口,所以nacos我修改成了8849端口.)

报错信息 start.out
----->
org.springframework.boot.web.embedded.tomcat.ConnectorStartFailedException: Connector configured to listen on port 8848 failed to start
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.checkConnectorHasStarted(TomcatWebServer.java:228)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.checkThatConnectorsHaveStarted(TomcatWebServer.java:220)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:200)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
at com.alibaba.nacos.Nacos.main(Nacos.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:107)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)

<------

再次观察cluster.conf 文件
原来是 ip1:8849,ip2:8849,ip3:8849
现在是 ip1:8849,ip2:8849,ip3:8849,localhostIp:8848

这个localhostIp:8848 是启动时候给我添加的 导致启动失败?
而且是8848端口,启动的banner读取的server.port信息也是8848
Nacos 1.4.1-SNAPSHOT
Running in cluster mode, All function modules
Port: 8848
Console: http://ip:**8848**/nacos/index.html

我想问applicaion.properties 中修改的server.port 是否生效?
该问题在1.4.0 版本没有问题,因为1.4.0版本的集群信息界面上有许多弃用的信息所以升级了1.4.1 snapshot 版本,遇到这个问题

@geek-lwh geek-lwh changed the title nacos-server-1.4.1-SNAPSHOT 集群启动 cluster文件被添加8848端口 nacos-server-1.4.1-SNAPSHOT 读取application.properties是否生效? Dec 23, 2020
@KomachiSion
Copy link
Collaborator

localhostIp 是你设置的ip吗?

@geek-lwh
Copy link
Author

localhostIp 是你设置的ip吗?

可能文字阐述不明确 localhostIp 的意思就是我启动nacos的那台机器的ip,更详细的描述如下

集群配置 192.1.1.1:8849,192.1.1.2:8849,192.1.1.3:8849
然后我在192.1.1.1:8849 启动,也就是上面集群中的一台机器
结果报错说8848 端口被占用,回头看了application.properties,以为端口没改,但是实际上application.properties的server.port已经从8848改成8849了.
启动报错后查看cluster.conf.原来配置的192.1.1.1:8849,192.1.1.2:8849,192.1.1.3:8849 变成了 192.1.1.1:8849,192.1.1.2:8849,192.1.1.3:8849,192.1.1.1:8848

@geek-lwh
Copy link
Author

localhostIp 是你设置的ip吗?

最简单的复现就是 修改application.properties的server.port,
sh startup.sh -m standalone
端口号还是8848

@KomachiSion KomachiSion added kind/bug Category issues or prs related to bug. and removed kind/research labels Dec 25, 2020
paderlol added a commit to paderlol/nacos that referenced this issue Dec 26, 2020
paderlol added a commit to paderlol/nacos that referenced this issue Dec 28, 2020
@KomachiSion KomachiSion linked a pull request Dec 29, 2020 that will close this issue
5 tasks
@KomachiSion KomachiSion added this to the 1.4.1 milestone Dec 29, 2020
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

Successfully merging a pull request may close this issue.

4 participants