-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication-feign-test.yml
More file actions
81 lines (76 loc) · 2.45 KB
/
Copy pathapplication-feign-test.yml
File metadata and controls
81 lines (76 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
server:
port: 9010
# 数据库地址
datasource:
url: 192.168.0.80:3306/gaoying
eureka:
client:
register-with-eureka: true
service-url:
defaultZone: http://192.168.0.80:8762/eureka/ #,http://eureka02:7002/eureka/,http://eureka03:7003/eureka/
instance:
# health-check-url-path: /actuator/health #应用实例的相对运行状况检查URL路径默认为 /info/health
instance-id: 消费方服务-9001 # 人性化显示出服务的信息
prefer-ip-address: true # 访问路径可显示ip地址
lease-renewal-interval-in-seconds: 2
lease-expiration-duration-in-seconds: 5
spring:
cloud:
loadbalancer:
retry:
enabled: true
application:
name: microservice-order-feign-client
# boot:
# admin:
# client:
# url: "http://localhost:8788" #指定SpringBootAdmin服务端地址
# password: password
# username: user
# instance:
# prefer-ip: true
datasource: # 数据库配置
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.0.80:3306/gaoying?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
username: root
password: root
hikari:
maximum-pool-size: 10 # 最大连接池数
max-lifetime: 1770000
metadata-map:
cluster: HACLUSTER #此服务属于HACLUSTER
status-page-url-path: /actuator/info
health-check-url-path: /actuator/health
# feign和ribbon结合,指定策略。feign默认的是轮询的策略,这里的配置可以自定义
MICROSERVICE-ORDER:
ribbon:
NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RoundRobinRule #com.netflix.loadbalancer.RandomRule 参考:http://ju.outofmemory.cn/entry/253843
# 开启熔断
feign:
hystrix:
enabled: true
client:
config:
default:
connectTimeout: 2000
readTimeout: 2000
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 1000
# 配置hystrix dashboard的url访问
# 开启指标流端点
management:
endpoints:
web:
exposure:
include: '*' #hystrix.stream #如果写'*’,代表是暴露所有的端点我们可以看到更多的服务实例相关信息,开放监控内容
cors:
allowed-origins: "*"
allowed-methods: "*"
endpoint:
health:
show-details: ALWAYS #health endpoint是否必须显示全部细节