出现问题:2020-10-11 15:03:02,284 INFO c.n.c.s.URLConfigurationSource[122]: To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-10-11 15:03:02,295 WARN c.n.c.s.URLConfigurationSource[121]: No URLs will be polled as dynamic configuration sources.
2020-10-11 15:03:02,295 INFO c.n.c.s.URLConfigurationSource[122]: To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-10-11 15:03:02,547 INFO c.a.c.s.SentinelWebAutoConfiguration[80]: [Sentinel Starter] register SentinelWebInterceptor with urlPatterns: [/**].
2020-10-11 15:03:02,688 INFO o.s.s.c.ThreadPoolTaskScheduler[181]: Initializing ExecutorService ‘Nacos-Watch-Task-Scheduler’
2020-10-11 15:03:03,094 INFO o.s.b.a.e.w.EndpointLinksResolver[58]: Exposing 2 endpoint(s) beneath base path ‘/actuator’
2020-10-11 15:03:03,180 ERROR c.a.c.n.discovery.NacosWatch[128]: namingService subscribe failed, properties:NacosDiscoveryProperties{serverAddr=‘localhost:8848’, endpoint=’’, namespace=’’, watchDelay=30000, logName=’’, service=’’, weight=1.0, clusterName=‘DEFAULT’, group=‘DEFAULT_GROUP’, namingLoadCacheAtStart=‘false’, metadata={preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip=‘172.19.80.167’, networkInterface=’’, port=-1, secure=false, accessKey=’’, secretKey=’’, heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null}
java.lang.IllegalArgumentException: Param ‘serviceName’ is illegal, serviceName is blank
at com.alibaba.nacos.api.naming.utils.NamingUtils.getGroupedName(NamingUtils.java:32)
at com.alibaba.nacos.client.naming.NacosNamingService.subscribe(NacosNamingService.java:446)
at com.alibaba.cloud.nacos.discovery.NacosWatch.start(NacosWatch.java:124)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
at org.springframework.context.support.DefaultLifecycleProcessor.access
200
(
D
e
f
a
u
l
t
L
i
f
e
c
y
c
l
e
P
r
o
c
e
s
s
o
r
.
j
a
v
a
:
53
)
a
t
o
r
g
.
s
p
r
i
n
g
f
r
a
m
e
w
o
r
k
.
c
o
n
t
e
x
t
.
s
u
p
p
o
r
t
.
D
e
f
a
u
l
t
L
i
f
e
c
y
c
l
e
P
r
o
c
e
s
s
o
r
200(DefaultLifecycleProcessor.java:53) at org.springframework.context.support.DefaultLifecycleProcessor
200(DefaultLifecycleProcessor.java:53)atorg.springframework.context.support.DefaultLifecycleProcessorLifecycleGroup.start(DefaultLifecycleProcessor.java:360)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:894)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)
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:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at com.tamu.tio.TioApplication.main(TioApplication.java:30)
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:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
2020-10-11 15:03:03,185 INFO o.s.a.r.c.CachingConnectionFactory[524]: Attempting to connect to: [172.19.80.167:5672]
2020-10-11 15:03:03,261 INFO o.s.a.r.c.CachingConnectionFactory[497]: Created new connection: rabbitConnectionFactory#64a40280:0/SimpleConnection@69c43e48 [delegate=amqp://admin@172.19.80.167:5672/, localPort= 34722]
2020-10-11 15:03:04,098 INFO o.a.c.http11.Http11NioProtocol[173]: Starting ProtocolHandler [“http-nio-9090”]
2020-10-11 15:03:04,116 INFO o.s.b.w.e.t.TomcatWebServer[203]: Tomcat started on port(s): 9090 (http) with context path ‘’
2020-10-11 15:03:04,123 WARN c.a.c.n.r.NacosServiceRegistry[59]: No service to register for nacos client…
2020-10-11 15:03:04,126 INFO com.tamu.tio.TioApplication[61]: Started TioApplication in 10.321 seconds (JVM running for 10.938)
2020-10-11 15:03:04,137 INFO c.a.n.c.c.impl.ClientWorker[262]: [fixed-localhost_8848] [subscribe] null.properties+DEFAULT_GROUP
2020-10-11 15:03:04,142 INFO c.a.n.c.config.impl.CacheData[93]: [fixed-localhost_8848] [add-listener] ok, tenant=, dataId=null.properties, group=DEFAULT_GROUP, cnt=1
解决办法
项目tio采用的是2个节点的服务器部署的情况
由于加了nacos 有单个项目变成微服务项目
在A服务器上安装了单机版的nacos并启动部署了tio服务配置文件只有application.properties配置nacos
在B上部署tio服务器并使用A服务器上的nacos 需要配置application.properties和bootstrap.properties 都需要配置nacos的服务
不然的话会出现上面问题