Commit ac8480ed by 张子昊

配置更新

parent 816244b0
server:
port: 7001
spring:
application:
name: public-eureka-server
security:
user:
name: name
password: password
eureka:
server:
# 保护模式(忽略高频注册/失效)
# enableSelfPreservation: false
# 缩短清理间隔(默认60秒,调整为5秒)
evictionIntervalTimerInMs: 5000
instance:
# 实例名,仅为名称,随意即可
instance-id: publicEureka
# 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式
hostname: localhost
# ip-address: 127.0.0.1
# prefer-ip-address: true
client:
# eureka单机时,无需构建eureka服务端集群,eureka服务机自然无需注册
registerWithEureka: false
# eureka单机时,无需同步其他服务机注册表
fetchRegistry: false
serviceUrl:
# eureka单机时,eureka服务机的defaultZone无实际意义,只是不写会使用默认值并报错
defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:${server.port}/eureka/
\ No newline at end of file
...@@ -4,20 +4,23 @@ spring: ...@@ -4,20 +4,23 @@ spring:
application: application:
name: public-eureka-server name: public-eureka-server
security: security:
basic:
enabled: false
user: user:
name: name name: name
password: password password: password
eureka: eureka:
instance: instance:
# 本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式 # 实例名,仅为名称,随意即可
instance-id: publicEureka
# 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式
hostname: localhost hostname: localhost
# ip-address: 127.0.0.1
# prefer-ip-address: true
client: client:
# eureka单机时,无需构建eureka服务端集群,eureka服务机自然无需注册
registerWithEureka: false registerWithEureka: false
# eureka单机时,无需同步其他服务机注册表
fetchRegistry: false fetchRegistry: false
serviceUrl: serviceUrl:
defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:${server.port}/eureka/ # eureka单机时,eureka服务机的defaultZone无实际意义,只是不写会使用默认值并报错
# server: defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.instance.hostname}:${server.port}/eureka/
# enable-self-preservation: false \ No newline at end of file
\ No newline at end of file
...@@ -16,21 +16,25 @@ spring: ...@@ -16,21 +16,25 @@ spring:
# 开启从注册中心动态创建路由的功能,利用微服务进行路由 # 开启从注册中心动态创建路由的功能,利用微服务进行路由
enabled: true enabled: true
# 使用小写服务名,只能大写或小写,两者无法通过此配置兼容 # 使用小写服务名,只能大写或小写,两者无法通过此配置兼容
lower-case-service-id: true # lower-case-service-id: true
eureka: eureka:
server: server:
# 自定义配置,简化、统一配置逻辑 # 自定义配置,简化、统一配置逻辑
# target: localhost:7001 target: localhost:7001
# 使用公司 eureka # 使用公司 eureka
target: 172.18.101.171:58336 # target: 172.18.101.171:58336
instance: instance:
# 实例名,仅为名称,随意即可
instance-id: publicGateway
# 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式 # 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式
hostname: localhost hostname: localhost
# ip-address: 127.0.0.1
# prefer-ip-address: true
client: client:
# 作为公共gateway,自身不注册,仅提供对外转发 # 作为公共gateway,自身不注册,仅提供对外转发
# register-with-eureka: true # register-with-eureka: true
fetch-registry: true fetch-registry: true
service-url: service-url:
# defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.server.target}/eureka # defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.server.target}/eureka
defaultZone: http://${eureka.server.target}/eureka defaultZone: http://${eureka.server.target}/eureka
\ No newline at end of file
...@@ -20,14 +20,20 @@ spring: ...@@ -20,14 +20,20 @@ spring:
eureka: eureka:
server: server:
# 自定义配置,简化、统一配置逻辑 # eureka服务目标(域名:端口) 自定义配置,简化、统一配置逻辑
target: localhost:7001 target: localhost:7001
# 使用公司 eureka
# target: 172.18.101.171:58336
instance: instance:
# 实例名,仅为名称,随意即可
instance-id: publicGateway
# 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式 # 实例host,本地调试时,可以是localhost,实际上应为指向当前主机的域名,或使用ip模式
hostname: localhost # hostname: localhost
ip-address: 127.0.0.1
prefer-ip-address: true
client: client:
# 作为公共gateway,自身不注册,仅提供对外转发 # 作为公共gateway,自身不注册,仅提供对外转发
register-with-eureka: false # register-with-eureka: true
fetch-registry: true fetch-registry: true
service-url: service-url:
defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.server.target}/eureka defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@${eureka.server.target}/eureka
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment