Commit 962130c3 by flyxiaozhu

添加 配置文件

parent cfe4332a
eureka:
client:
healthcheck:
enabled: true # 开启健康检查(依赖spring-boot-starter-actuator)
instance:
lease-expiration-duration-in-seconds: 30 # 发呆时间,即服务续约到期时间(缺省为90s)
lease-renewal-interval-in-seconds: 10 # 心跳时间,即服务续约间隔时间(缺省为30s)
management:
endpoints:
web:
base-path: /actuator
exposure:
include: "*" #暴露所有 endpoints
endpoint:
health:
show-details: always
feign: # 打开feign对于hystrix的支持(默认是不打开的)
hystrix:
enabled: true
#ribbon-client:
# ribbon:
# NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RandomRule # 负载均衡使用随机策略 缺省为轮询
info:
app:
name: "@project.name@"
description: "@project.description@"
version: "@project.version@"
\ No newline at end of file
eureka:
client:
healthcheck:
enabled: true # 开启健康检查(依赖spring-boot-starter-actuator)
instance:
lease-expiration-duration-in-seconds: 30 # 发呆时间,即服务续约到期时间(缺省为90s)
lease-renewal-interval-in-seconds: 10 # 心跳时间,即服务续约间隔时间(缺省为30s)
management:
endpoints:
web:
base-path: /actuator
exposure:
include: "*" #暴露所有 endpoints
endpoint:
health:
show-details: always
#ribbon-client:
# ribbon:
# NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RandomRule # 负载均衡使用随机策略 缺省为轮询
info:
app:
name: "@project.name@"
description: "@project.description@"
version: "@project.version@"
\ No newline at end of file
eureka:
client:
healthcheck:
enabled: true # 开启健康检查(依赖spring-boot-starter-actuator)
# instance:
# lease-expiration-duration-in-seconds: 30 # 发呆时间,即服务续约到期时间(缺省为90s)
# lease-renewal-interval-in-seconds: 10 # 心跳时间,即服务续约间隔时间(缺省为30s)
management:
endpoints:
web:
base-path: /actuator
exposure:
include: "*" #暴露所有 endpoints
endpoint:
health:
show-details: always
info:
app:
name: "@project.name@"
description: "@project.description@"
version: "@project.version@"
test: so so so
\ No newline at end of file
eureka:
client:
healthcheck:
enabled: true # 开启健康检查(依赖spring-boot-starter-actuator)
registry-fetch-interval-seconds: 5 #表示eureka client间隔多久去拉取服务注册信息,默认为30秒
instance:
lease-expiration-duration-in-seconds: 30 # 发呆时间,即服务续约到期时间(缺省为90s)
lease-renewal-interval-in-seconds: 10 # 心跳时间,即服务续约间隔时间(缺省为30s)
management:
endpoints:
web:
base-path: /actuator
exposure:
include: "*" #暴露所有 endpoints
endpoint:
health:
show-details: always
info:
app:
name: "@project.name@"
description: "@project.description@"
version: "@project.version@"
# 路由匹配
zuul:
routes:
api-a:
path: /api-a/**
stripPrefix: true # 转发时去除前缀 api-a
serviceId: ribbon-server
api-b:
path: /api-b/**
stripPrefix: true
serviceId: feign-server
# Hystrix 隔离策略配置 https://blog.csdn.net/u010826617/article/details/82260873
ribbon-isolation-strategy: thread # 设置Hystrix隔离策略为线程池
thread-pool:
use-separate-thread-pools: true # 每个路由使用独立的线程池
retryable: true # 是否开启重试功能
hystrix:
command:
default:
execution:
timeout:
enabled: true # Hystrix是否启用超时时间
isolation:
thread:
timeoutInMilliseconds: 5000 # Hystrix断路器的超时时间,默认是1s,断路器的超时时间需要大于ribbon的超时时间,不然不会触发重试。
ribbon:
MaxAutoRetries: 2 # 对当前服务的重试次数
MaxAutoRetriesNextServer: 0 # 切换相同Server的次数
ConnectTimeout: 250 # ribbon请求连接的超时时间
ReadTimeout: 1000 # 请求处理的超时时间
OkToRetryOnAllOperations: true # 对所有请求操作都进行重试
#对当前服务的重试次数(第一次分配给9082的时候,如果404,则再重试MaxAutoRetries次,如果还是404,则切换到其他服务MaxAutoRetriesNextServer决定)
ribbon.MaxAutoRetries: 0
#切换服务的次数(比如本次请求分配给9082处理,发现404,则切换分配给9081处理,如果还是404,则返回404给客户端)
ribbon.MaxAutoRetriesNextServer: 1
......@@ -25,8 +25,8 @@ services:
- "7010"
environment:
# git 仓库配置
SPRING_CLOUD_CONFIG_SERVER_GIT_URI: https://github.com/fiyxiaozhu/erpConfig # 配置git仓库的地址
SPRING_CLOUD_CONFIG_SERVER_GIT_SEARCH-PATHS: respo # git仓库地址下的相对地址,可以配置多个,用,分割。
SPRING_CLOUD_CONFIG_SERVER_GIT_URI: http://gitlab.mailejifen.com:10080/jiangwei/spring-boot-admin-erp.git # 配置git仓库的地址
SPRING_CLOUD_CONFIG_SERVER_GIT_SEARCH-PATHS: config # git仓库地址下的相对地址,可以配置多个,用,分割。
# SPRING_CLOUD_CONFIG_SERVER_GIT_USERNAME: # git仓库的用户和密码
# SPRING_CLOUD_CONFIG_SERVER_GIT_PASSWORD:
SPRING_CLOUD_CONFIG_LABEL: master # 分支
......
version: '2'
services:
########################### 服务注册和发现 ####################################
eureka-server-1: # 自定义服务名--注册中心
# image: flyxiaozhu/eureka-server # 镜像名称
build: ./eureka-server/ # 通过Dockerfile自行构建
image: eureka-server:springcloud
# always (当容器退出时docker自动重启它)
# on-failure:10 (当容器非正常退出, 最多自动重启10次, 10之后不再重启)
restart: always # 总是重启
ports:
- "7000:7000"
expose: # 暴露端口,只提供容器间访问,不暴露给主机
- "7000"
environment: # 环境变量
SPRING_PROFILES_ACTIVE: peer1 # 自定义参数用于给服务的配置文件传递参数
eureka-server-2:
build: ./eureka-server/
image: eureka-server:springcloud
restart: always
expose:
- "7001"
environment:
SPRING_PROFILES_ACTIVE: peer2
########################### spring-boot-admin ####################################
admin-server:
build: ./admin-server/
image: admin-server:springcloud
restart: always
ports:
- "7020:7020" # 端口映射
expose:
- "7020"
environment:
SPRING_PROFILES_ACTIVE: secure # 环境选择 搭配 @Profile("insecure") 使用
SPRING_SECURITY_USER_NAME: flyxiaozhu # 设置登陆的用户名和密码 client为单纯的spring-boot程序
SPRING_SECURITY_USER_PASSWORD: 123456
########################### 分布式配置中心 ####################################
config-server-1:
build: ./config-server/
image: config-server:springcloud
restart: always
expose:
- "7010"
environment:
SPRING_PROFILES_ACTIVE: config1
SPRING_CLOUD_CONFIG_SERVER_GIT_URI: https://github.com/fiyxiaozhu/SpringCloudConfig
SPRING_CLOUD_CONFIG_SERVER_GIT_SEARCH-PATHS: respo
SPRING_CLOUD_CONFIG_LABEL: master
################################ 服务提供者 ########################################
server-hello-1:
build: ./server-hello
image: server-hello-1:springcloud
restart: always
ports:
- "7030:7030"
expose:
- "7030"
environment:
# 配置中心客户端配置
SPRING_CLOUD_CONFIG_LABEL: master
SPRING_CLOUD_CONFIG_PROFILE: dev
SPRING_CLOUD_CONFIG_DISCOVERY_ENABLED: "true"
SPRING_CLOUD_CONFIG_DISCOVERY_SERVICE-ID: config-server
SPRING_CLOUD_CONFIG_FAIL-FAST: "true"
SPRING_CLOUD_CONFIG_RETRY_INITIAL-INTERVAL: 1000
SPRING_CLOUD_CONFIG_RETRY_MAX-ATTEMPTS: 6
SPRING_CLOUD_CONFIG_RETRY_MAX-INTERVAL: 2000
SPRING_CLOUD_CONFIG_RETRY_MULTIPLIER: 1.1
# 信息总线配置 rabbitmq配置
SPRING_RABBITMQ_HOST: 192.168.1.250
SPRING_RABBITMQ_PORT: 5672
SPRING_RABBITMQ_USERNAME: flyxiaozhu
SPRING_RABBITMQ_PASSWORD: 1120zh.+
SPRING_CLOUD_BUS_ENABLED: "true"
SPRING_CLOUD_BUS_TRACE_ENABLED: "true" # 开启信息跟踪
# zipkin 客户端配置
SPRING_ZIPKIN_BASE-URL: http://trace-server:7060
SPRING_SLEUTH_SAMPLER_PROBABILITY: 1.0
SPRING_ZIPKIN_SENDER_TYPE: web
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 sign in to comment