diff --git a/ms/cms/src/main/resources/bootstrap.yml b/ms/cms/src/main/resources/bootstrap.yml index 3a15ccf..99d2c60 100644 --- a/ms/cms/src/main/resources/bootstrap.yml +++ b/ms/cms/src/main/resources/bootstrap.yml @@ -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 \ No newline at end of file + prefer-ip-address: true \ No newline at end of file diff --git a/ms/config-server/src/main/resources/bootstrap.yml b/ms/config-server/src/main/resources/bootstrap.yml index aea05c6..2ad114e 100644 --- a/ms/config-server/src/main/resources/bootstrap.yml +++ b/ms/config-server/src/main/resources/bootstrap.yml @@ -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 \ No newline at end of file + prefer-ip-address: true \ No newline at end of file diff --git a/ms/gateway/src/main/resources/bootstrap.yml b/ms/gateway/src/main/resources/bootstrap.yml index 1410c9e..ecdbb5c 100644 --- a/ms/gateway/src/main/resources/bootstrap.yml +++ b/ms/gateway/src/main/resources/bootstrap.yml @@ -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 diff --git a/ms/register-center1/src/main/resources/bootstrap.yml b/ms/register-center1/src/main/resources/bootstrap.yml index f185ba6..f5dbdad 100644 --- a/ms/register-center1/src/main/resources/bootstrap.yml +++ b/ms/register-center1/src/main/resources/bootstrap.yml @@ -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 # 实例的主机名 \ No newline at end of file + prefer-ip-address: true \ No newline at end of file diff --git a/ms/register-center2/src/main/resources/bootstrap.yml b/ms/register-center2/src/main/resources/bootstrap.yml index cf1452f..fea02ca 100644 --- a/ms/register-center2/src/main/resources/bootstrap.yml +++ b/ms/register-center2/src/main/resources/bootstrap.yml @@ -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 # 实例的主机名 \ No newline at end of file + prefer-ip-address: true \ No newline at end of file diff --git a/ms/ucenter/src/main/resources/bootstrap.yml b/ms/ucenter/src/main/resources/bootstrap.yml index 2ff0f4d..52b5916 100644 --- a/ms/ucenter/src/main/resources/bootstrap.yml +++ b/ms/ucenter/src/main/resources/bootstrap.yml @@ -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 \ No newline at end of file + prefer-ip-address: true \ No newline at end of file diff --git a/ms/upms/src/main/resources/bootstrap.yml b/ms/upms/src/main/resources/bootstrap.yml index cd427d0..a9089ee 100644 --- a/ms/upms/src/main/resources/bootstrap.yml +++ b/ms/upms/src/main/resources/bootstrap.yml @@ -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 \ No newline at end of file + prefer-ip-address: true \ No newline at end of file