nacos 运行的版本:2.0.3 。
nacos 为单机运行非集群,启动命令 ./startup.sh -m standalone (使用的是 dev 账户启动的,非 root)
nacos 的配置文件 nacos/conf/application.properties 中没有配置 mysql 链接信息。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
</parent>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2020.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2021.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
版本参考的是: https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E
nacos 是正常启动的,微服务启动注册到 127.0.0.1:8848(使用的是 dev 账户启动的,非 root)
只用到了注册服务,服务发现,没有用到别的 nacos 功能
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
微服务都能够正常注册到 nacos,但是,过段时间(晚上 18 点重启微服务),次日早上微服务便会自动停机,nacos 后台管理系统中就看到微服务下线了(很多个微服务都下线),这些微服务的日志为:
2021-10-22 11:00:41.433 WARN 19068 --- [ Thread-10] c.a.nacos.common.notify.NotifyCenter : [NotifyCenter] Start destroying Publisher
2021-10-22 11:00:41.433 WARN 19068 --- [ Thread-10] c.a.nacos.common.notify.NotifyCenter : [NotifyCenter] Destruction of the end
2021-10-22 11:00:41.436 WARN 19068 --- [ Thread-4] c.a.n.common.http.HttpClientBeanHolder : [HttpClientBeanHolder] Start destroying common HttpClient
2021-10-22 11:00:41.437 WARN 19068 --- [ Thread-4] c.a.n.common.http.HttpClientBeanHolder : [HttpClientBeanHolder] Destruction of the end
2021-10-22 11:00:41.444 INFO 19068 --- [extShutdownHook] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'Nacos-Watch-Task-Scheduler'
2021-10-22 11:00:41.445 INFO 19068 --- [extShutdownHook] c.a.c.n.registry.NacosServiceRegistry : De-registering from Nacos Server now...
2021-10-22 11:00:41.448 INFO 19068 --- [extShutdownHook] c.a.c.n.registry.NacosServiceRegistry : De-registration finished.
2021-10-22 11:00:49.101 WARN 19068 --- [extShutdownHook] o.s.b.f.support.DisposableBeanAdapter : Destroy method 'close' on bean with name 'nacosServiceRegistry' threw an exception: java.lang.NullPointerException
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.