因项目使用的框架比较老,而且zk作为注册中心其实是有问题的,因为zk不是高可用的(详情请自行百度zk leader选举机制),经内部决定,将升级成nacos为注册中心(配置中心功能暂时不需要)
升级过程版本选择
| Spring Cloud Alibaba Version | Sentinel Version | Nacos Version | RocketMQ Version | Dubbo Version | Seata Version |
|---|---|---|---|---|---|
| 2.2.7.RELEASE | 1.8.1 | 2.0.3 | 4.6.1 | 2.7.13 | 1.3.0 |
| 2.2.6.RELEASE | 1.8.1 | 1.4.2 | 4.4.0 | 2.7.8 | 1.3.0 |
| 2021.1 or 2.2.5.RELEASE or 2.1.4.RELEASE or 2.0.4.RELEASE | 1.8.0 | 1.4.1 | 4.4.0 | 2.7.8 | 1.3.0 |
| 2.2.3.RELEASE or 2.1.3.RELEASE or 2.0.3.RELEASE | 1.8.0 | 1.3.3 | 4.4.0 | 2.7.8 | 1.3.0 |
| 2.2.1.RELEASE or 2.1.2.RELEASE or 2.0.2.RELEASE | 1.7.1 | 1.2.1 | 4.4.0 | 2.7.6 | 1.2.0 |
| 2.2.0.RELEASE | 1.7.1 | 1.1.4 | 4.4.0 | 2.7.4.1 | 1.0.0 |
| 2.1.1.RELEASE or 2.0.1.RELEASE or 1.5.1.RELEASE | 1.7.0 | 1.1.4 | 4.4.0 | 2.7.3 | 0.9.0 |
| 2.1.0.RELEASE or 2.0.0.RELEASE or 1.5.0.RELEASE | 1.6.3 | 1.1.1 | 4.4.0 | 2.7.3 | 0.7.1 |
SCA版本说明:https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E
因项目springboot版本使用的是1.5.9.RELEASE,最终选择nacos版本1.4.1
将原本的zk注册中心的包注释掉
引入nacos注册中心的包
com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery
org.springframework.cloud spring-cloud-dependencies Edgware.SR4 pom import com.alibaba.cloud spring-cloud-alibaba-dependencies 1.5.1.RELEASE pom import
最后修改项目的nacos配置
spring:
cloud:
nacos:
discovery:
server-addr: localhost:8848



