修改为使用ip注册,定义register.server.ip,config.server.ip便于支持本地运行以及使用docker方式运行

This commit is contained in:
lsy
2017-11-20 18:03:42 +08:00
parent cd92efaa88
commit ceed3d285e
7 changed files with 48 additions and 16 deletions
+6 -2
View File
@@ -1,3 +1,7 @@
#自定义参数,用于命令行替换,默认值是127.0.0.1
register:
server:
ip: 127.0.0.1
# 从配置中心加载文件
spring:
cloud:
@@ -13,6 +17,6 @@ spring:
eureka:
client:
serviceUrl:
defaultZone: http://micro:fast@127.0.0.1:10002/eureka/,http://micro:fast@127.0.0.1:10003/eureka/ #配置所有的注册中心
defaultZone: http://micro:fast@${register.server.ip}:10002/eureka/,http://micro:fast@${register.server.ip}:10003/eureka/ #配置所有的注册中心
instance:
hostname: www.cms.com
prefer-ip-address: true
@@ -1,3 +1,5 @@
#自定义参数,用于命令行替换,默认值是127.0.0.1
register.ip: 127.0.0.1
# 程序实例的配置,git仓库的配置
spring:
application:
@@ -12,6 +14,6 @@ spring:
eureka:
client:
service-url:
defaultZone: http://micro:fast@127.0.0.1:10002/eureka/,http://micro:fast@127.0.0.1:10003/eureka/ #配置所有的注册中心
defaultZone: http://micro:fast@${register.ip}:10002/eureka/,http://micro:fast@${register.ip}:10003/eureka/ #配置所有的注册中心
instance:
hostname: www.config.server.com
prefer-ip-address: true
+6 -2
View File
@@ -1,3 +1,7 @@
#自定义参数,用于命令行替换,默认值是127.0.0.1
register:
server:
ip: 127.0.0.1
# 从配置中心加载文件
spring:
cloud:
@@ -13,6 +17,6 @@ spring:
eureka:
client:
serviceUrl:
defaultZone: http://micro:fast@127.0.0.1:10002/eureka/,http://micro:fast@127.0.0.1:10003/eureka/ #配置所有的注册中心
defaultZone: http://micro:fast@${register.server.ip}:10002/eureka/,http://micro:fast@${register.server.ip}:10003/eureka/ #配置所有的注册中心
instance:
hostname: www.gateway.com
prefer-ip-address: true
@@ -1,14 +1,21 @@
#自定义参数,用于命令行替换,默认值是127.0.0.1
register:
server:
ip: 127.0.0.1
config:
server:
ip: 127.0.0.1
#从配置中心加载配置文件,启动eureka-server服务
spring:
cloud:
config:
uri: http://config:server@127.0.0.1:9999/
uri: http://config:server@${config.server.ip}:9999/
profile: dev
label: master
name: eureka-server
eureka:
client:
service-url:
defaultZone: http://micro:fast@127.0.0.1:10003/eureka #和其他注册中心连接
defaultZone: http://micro:fast@${register.server.ip}:10003/eureka #和其他注册中心连接
instance:
hostname: www.eureka.server.com # 实例的主机名
prefer-ip-address: true
@@ -1,13 +1,20 @@
#自定义参数,用于命令行替换,默认值是127.0.0.1
register:
server:
ip: 127.0.0.1
config:
server:
ip: 127.0.0.1
spring:
cloud:
config:
name: eureka-server2
profile: dev
label: master
uri: http://config:server@127.0.0.1:9999/
uri: http://config:server@${config.server.ip}:9999/
eureka:
client:
service-url:
defaultZone: http://micro:fast@127.0.0.1:10002/eureka #和其他注册中心连接
defaultZone: http://micro:fast@${register.server.ip}:10002/eureka #和其他注册中心连接
instance:
hostname: www.eureka.server2.com # 实例的主机名
prefer-ip-address: true
+6 -2
View File
@@ -1,3 +1,7 @@
#自定义参数,用于命令行替换,默认值是127.0.0.1
register:
server:
ip: 127.0.0.1
# 从配置中心加载文件
spring:
cloud:
@@ -13,6 +17,6 @@ spring:
eureka:
client:
serviceUrl:
defaultZone: http://micro:fast@127.0.0.1:10002/eureka/,http://micro:fast@127.0.0.1:10003/eureka/ #配置所有的注册中心
defaultZone: http://micro:fast@${register.server.ip}:10002/eureka/,http://micro:fast@${register.server.ip}:10003/eureka/ #配置所有的注册中心
instance:
hostname: www.ucenter.com
prefer-ip-address: true
+6 -2
View File
@@ -1,3 +1,7 @@
#自定义参数,用于命令行替换,默认值是127.0.0.1
register:
server:
ip: 127.0.0.1
# 从配置中心加载文件
spring:
cloud:
@@ -13,6 +17,6 @@ spring:
eureka:
client:
serviceUrl:
defaultZone: http://micro:fast@127.0.0.1:10002/eureka/,http://micro:fast@127.0.0.1:10003/eureka/ #配置所有的注册中心
defaultZone: http://micro:fast@${register.server.ip}:10002/eureka/,http://micro:fast@${register.server.ip}:10003/eureka/ #配置所有的注册中心
instance:
hostname: www.upms.com
prefer-ip-address: true