当前位置:网站首页>Problems encountered when the registry service Eureka switches to nocas
Problems encountered when the registry service Eureka switches to nocas
2022-07-28 05:30:00 【wang0112233】
springBoot edition 2.3.7.RELEASE
springCloudAlibab edition 2.2.2.RELEASE
springClould edition Hoxton.RELEASE
<!-- spring edition -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.7.RELEASE</version>
<relativePath/>
</parent>
<!-- Alibaba Nacos To configure -->
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>${nacos.version}</version>
</dependency>
<!-- Spring Cloud Alibaba Version Manager -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-loadbalancer</artifactId>
</dependency>
<nacos.version>2.0.3</nacos.version>
<spring-cloud-alibaba.version>2.2.2.RELEASE</spring-cloud-alibaba.version>
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
Sub service
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>Delete eureka,config
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>Packet collision hystrix,ribbon
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
</dependency>problem :
Initiate error reporting
Description: Field autoServiceRegistration in org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration required a single bean, but 2 were found: - nacosAutoServiceRegistration: defined by method 'nacosAutoServiceRegistration'in class path resource [com/alibaba/cloud/nacos/registry/NacosServiceRegistryAutoConfiguration.class] - consulAutoServiceRegistration: defined by method 'consulAutoServiceRegistration'in class path resource [org/springframework/cloud/consul/serviceregistry/ConsulAutoServiceRegistrationAutoConfiguration.class] Action: Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
The above error message shows the auto configuration class AutoServiceRegistrationAutoConfiguration Inject autoServiceRegistration Property, there are two injectable instances at the same time bean, One is NacosAutoServiceRegistration Class bean, The other is ConsulAutoServiceRegistration Class bean. It's used here NacosAutoServiceRegistration Example bean, So we need to exclude spring-cloud-starter-consul-discovery Dependent spring-cloud-consul-discovery rely on :
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
<version>2.2.0.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-consul-discovery</artifactId>
</exclusion>
</exclusions>
</dependency>Initiate error reporting
[com.alibaba.nacos.client.remote.worker] ERROR c.a.n.c.remote.client.grpc.GrpcClient - Server check fail, please check server nacos.shands.com ,port 1884 is available , error ={} java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
The configuration file is 8848 But the report is wrong 1884, I have checked many schemes , Some ports are not open , There are some address errors ,
What I encounter here is version conflict , See the beginning of the specific version
spring Errors caused by version upgrade AddFromTemplate
@Override
public Collection<String> setTemplateParameter(String name,
Collection<String> rest) {
return addTemplatedParam(rest, name);
//return addTemplateParameter(rest, name);
}
After the change
@Override
public Collection<String> setTemplateParameter(String name, Collection<String> rest) {
if (rest == null) {
rest = new ArrayList();
}
((Collection)rest).add(String.format("{%s}", name));
return (Collection)rest;
}Before change
// KB,MB
factory.setMaxFileSize(maxFileSize);
/// Total upload data size
factory.setMaxRequestSize(maxRequestSize);After the change
// KB,MB
factory.setMaxFileSize(DataSize.parse(maxFileSize));
/// Total upload data size
factory.setMaxRequestSize(DataSize.parse(maxRequestSize));边栏推荐
- 解决Oracle使用in语句不能超过1000问题
- Share several methods of managing flag bits in C program
- Oracle用sql查询某张表的字段信息(字段类型、长度等)
- CentOS7安装MySQL5.7
- Edge calculation kubeedge+edgemash
- 多线程进阶:volatile的作用以及实现原理
- repackag failed: Unable to find main class
- What are the methods of array objects in Es5 and what are the new methods in ES6
- Bean的作用域、执行流程、生命周期
- Test Development - UI testing in automated testing
猜你喜欢

Microservice failure mode and building elastic system

多系统架构设计思考

Digital twin solutions inject new momentum into the construction of chemical parks

How practical is the struct module? Learn a knowledge point immediately

JUC笔记

使用navicat或plsql导出csv格式,超过15位数字后面变成000(E+19)的问题

7.<tag-字符串和API的取舍>补充: 剑指 Offer 05. 替换空格

科研论文写作方法:在方法部分添加分析和讨论说明自己的贡献和不同

Framework step by step easy-to-use process
![[internal mental skill] - creation and destruction of function stack frame (C implementation)](/img/a9/81644ee9ffb74a5dc8ff1bc3977f49.png)
[internal mental skill] - creation and destruction of function stack frame (C implementation)
随机推荐
多线程进阶:volatile的作用以及实现原理
repackag failed: Unable to find main class
Autoreleasepool problem summary
24小时内的时间段无交叉
Microservice failure mode and building elastic system
Digital twin technology creates visual application of smart mine
【ARIXV2204】Neighborhood attention transformer
JVM篇 笔记3:类加载与字节码技术
[computer level 3 information security] overview of information security assurance
List<Long>,List<Integer>互相转换
Why is MD5 irreversible, but it may also be decrypted by MD5 free decryption website
BeanUtils. Copyproperties cannot copy different list sets problem solving lists.transform function
Thinking on multi system architecture design
Flask Development & get/post request
New methods and features of ES6 built-in objects
论文写作用词
You must configure either the server or JDBC driver (via the ‘serverTimezone)
Share several methods of managing flag bits in C program
php7.1 连接sqlserver2008r2 如何测试成功
Database date types are all 0