Zookeeper作为springboot的配置中心注册不了

springcloud2.0之后就用zookeeper3.5(集体你看下自己的版本下pom里边的curator相关jar的版本,只要是4.0的版本就往下看,zookeeper3.5啦)

如果你只是为了搭建这个环境,你不用看了,因为我这边没有介绍,我只说错误,报错
如果你老是发现你注册zookeeper节点不成功,而且你使用的是zookeeper的3.4或者3.3,且使用springboot的2版本,那么可能这对你有用,而且你还在想是不是那个啥not attemp connect 。。。SASL啥的那你看看吧
Zookeeper作为springboot的配置中心注册不了_第1张图片
上边说了curator4.0硬要求zookeeper3.5的
所以下个最新版zookeeper,不要看别人做行就行,不是你说行就行,要zookeeper说行啦

zookeeper依赖导入就一个

		
			org.springframework.cloud
			spring-cloud-starter-zookeeper-discovery
		
https://github.com/spring-cloud/spring-cloud-zookeeper/blob/master/spring-cloud-zookeeper-dependencies/pom.xml

这个pom是springcloud对zookeeper集成的jar包,它规定了很多和zookeeper有关的jar包的版本。
而我们同时引入的starter-zookeeper-discovy这个包里边有依赖zookeeper和curator。但是因为这两版本不匹配啥的,所以我们需要最新3.5的zookeeper

spring-cloud-zookeeper-dependencies-2.0.0.RELEASE  zookeeper和curator的版本。
spring-cloud-zookeeper/spring-cloud-starter-zookeeper-discovery  zookeeper 注册启动器的配置pom,这个需要curator-x-discovery 在framework上构建的服务发现实现。

		
			
				org.springframework.cloud
				spring-cloud-zookeeper-core
				${project.version}
			
			
				org.springframework.cloud
				spring-cloud-zookeeper-config
				${project.version}
			
			
				org.springframework.cloud
				spring-cloud-zookeeper-discovery
				${project.version}
			
			
				org.springframework.cloud
				spring-cloud-starter-zookeeper
				${project.version}
			
			
				org.springframework.cloud
				spring-cloud-starter-zookeeper-all
				${project.version}
			
			
				org.springframework.cloud
				spring-cloud-starter-zookeeper-config
				${project.version}
			
			
				org.springframework.cloud
				spring-cloud-starter-zookeeper-discovery
				${project.version}
			
			
				org.apache.curator
				curator-framework
				${curator.version}
				
					
						log4j
						log4j
					
					
						io.netty
						netty
					
				
			
			
				org.apache.curator
				curator-recipes
				${curator.version}
				
					
						log4j
						log4j
					
					
						io.netty
						netty
					
				
			
			
				org.apache.curator
				curator-x-discovery
				${curator.version}
				
					
						log4j
						log4j
					
					
						io.netty
						netty
					
				
			
			
				org.apache.curator
				curator-test
				${curator.version}
				test
				
					
						log4j
						log4j
					
					
						io.netty
						netty
					
				
			
		
	

代码和配套的zookeeper3.5.5 地址
我博客下载地址 2019/9/10那天的那个文件有标注或者私聊我,看到会回复

你可能感兴趣的:(java)