mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 12:56:28 +08:00
修复zookeeper连接报错问题
This commit is contained in:
@@ -11,10 +11,9 @@ spring:
|
||||
application:
|
||||
name: sop-admin
|
||||
|
||||
# zookeeper客户端连接
|
||||
cloud:
|
||||
zookeeper:
|
||||
connect-string: localhost:2181
|
||||
connect-string: 10.1.31.126:2181
|
||||
baseSleepTimeMs: 3000
|
||||
maxRetries: 3
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
<commons-lang3.version>3.8.1</commons-lang3.version>
|
||||
<commons-codec.version>1.11</commons-codec.version>
|
||||
<zookeeper.version>3.4.12</zookeeper.version>
|
||||
<curator-recipes.version>4.0.1</curator-recipes.version>
|
||||
<validation-api.version>2.0.1.Final</validation-api.version>
|
||||
<hibernate-validator.version>6.0.13.Final</hibernate-validator.version>
|
||||
</properties>
|
||||
@@ -59,24 +60,21 @@
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<!-- zookeeper -->
|
||||
<!-- zookeeper客户端针对zookeeper-3.4.x
|
||||
如果zookeeper使用3.5.x,可以直接使用curator-recipes最高版本
|
||||
详情:http://curator.apache.org/zk-compatibility.html
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-zookeeper-all</artifactId>
|
||||
<groupId>org.apache.curator</groupId>
|
||||
<artifactId>curator-recipes</artifactId>
|
||||
<version>${curator-recipes.version}</version>
|
||||
<exclusions>
|
||||
<!-- 不使用服务发现 -->
|
||||
<exclusion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
|
||||
</exclusion>
|
||||
<!-- 这里为什么要排除,详见:http://curator.apache.org/zk-compatibility.html -->
|
||||
<exclusion>
|
||||
<groupId>org.apache.zookeeper</groupId>
|
||||
<artifactId>zookeeper</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.zookeeper</groupId>
|
||||
<artifactId>zookeeper</artifactId>
|
||||
|
@@ -7,7 +7,8 @@ spring:
|
||||
|
||||
cloud:
|
||||
zookeeper:
|
||||
connect-string: localhost:2181
|
||||
# zookeeper配置
|
||||
connect-string: 10.1.31.126:2181
|
||||
|
||||
eureka:
|
||||
port: 1111
|
||||
|
@@ -14,10 +14,9 @@ spring:
|
||||
# 指定服务名
|
||||
name: easyopen-service
|
||||
|
||||
# 指定zookeeper
|
||||
cloud:
|
||||
zookeeper:
|
||||
connect-string: localhost:2181
|
||||
connect-string: 10.1.31.126:2181
|
||||
|
||||
# 指定接口路径
|
||||
easyopen:
|
||||
|
@@ -8,7 +8,7 @@ spring:
|
||||
|
||||
cloud:
|
||||
zookeeper:
|
||||
connect-string: localhost:2181
|
||||
connect-string: 10.1.31.126:2181
|
||||
|
||||
# 注册中心
|
||||
eureka:
|
||||
|
@@ -18,13 +18,15 @@ spring:
|
||||
|
||||
cloud:
|
||||
zookeeper:
|
||||
connect-string: localhost:2181 # zookeeper地址
|
||||
connect-string: 10.1.31.126:2181
|
||||
|
||||
gateway: # Spring Cloud Gateway配置,如果用了zuul,这段配置没有效果
|
||||
discovery:
|
||||
locator:
|
||||
lower-case-service-id: true
|
||||
enabled: true
|
||||
|
||||
|
||||
# 数据源
|
||||
datasource:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
|
@@ -14,7 +14,7 @@ spring:
|
||||
|
||||
cloud:
|
||||
zookeeper:
|
||||
connect-string: localhost:2181
|
||||
connect-string: 10.1.31.126:2181
|
||||
|
||||
api:
|
||||
# 测试地址
|
||||
|
Reference in New Issue
Block a user