Springcloud常用構成【アプリケーション.yml】
6556 ワード
サービスポート番号:
Spring構成:
MyBatis構成:
Eurekaサービス構成:
zulゲートウェイ構成:
Ribbon負荷分散構成:
Hystrix構成:
server:
port: 8081
Spring構成:
spring:
datasource: #
url: jdbc:mysql://localhost:3306/travel_heima
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
application: #
name: consumer-service
MyBatis構成:
mybatis:
type-aliases-package: cn.xxx.pojo
configuration:
map-underscore-to-camel-case: true #
Eurekaサービス構成:
eureka:
client:
fetch-registry: false #
register-with-eureka: false #
service-url:
defaultZone: http://127.0.0.1:10086/eureka,http://127.0.0.1:10087/eureka #
instance:
ip-address: 127.0.0.1
instance-id: ${eureka.instance.ip-address}:${server.port}
zulゲートウェイ構成:
zuul:
prefix: /api #
routes:
user-service:
path: /user/** #
serviceId: user-service # id
strip-prefix: false #
ignored-services:
- user-service
- consumer-feign
Ribbon負荷分散構成:
ConnectTimeout: 500 # ribbon
ReadTimeout: 2000 # ribbon
MaxAutoRetries: 0 #
MaxAutoRetriesNextServer: 1 #
OkToRetryOnAllOperations: false # , get
Hystrix構成:
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 5000 # :6000ms