eureka:
instance:
prefer-ip-address:true #配置eureka.instance.prefer-ip-address = true 就可以将IP注册到Eureka Server上,而如果不配置就是机器的主机名
client:
service-url:
defaultZone:http://{用户名}:{密码}@路径:端口号/eureka/
spring:
application:
name: x-user #模块名,也就是注册到eureka上显示的
http:
multipart:
maxFileSize: 10MB #限定单个文件最大上传大小
maxRequestSize: 10MB #限定总上传的数据最大上传大小
profiles:
active: test #加载resourse下的application-test.yml
include: no-liquibase,swagger #配置swagger,如果不需要使用liqubase,就加上no-liquibase,否则不加
jackson:
seriallization.indent_output: true #springboot默认配置json转换工具jackson格式化输出
datasource:
type: com.zaxxer.hikari.HikariDataSource #数据源
url: jdbc:oracle:thin:@{路径}:{端口}:{库名} #以链接Oracle数据库为例
username: {用户名}
password: {密码}
hikari:
data-source-properties:
cachePrepStmts: true #是否自定义配置,为true时下面两个参数才生效
prepStmtCacheSize: 250 #连接池大小默认25,官方推荐250-500
prepStmtCacheSqlLimit: 2048 #单条语句最大长度默认256,官方推荐2048
useServerPrepStmts: true #新版本MySQL支持服务器端准备,开启能够得到显著性能提升 true 或者 false
maxinum-pool-size: 20 #数据库最大连接池大小
connection-test-query: SELECt 1 FROM DUAL #用于测试连接是否可用的查询语句
idle-timeout: 10000 #允许连接在连接池中空闲的最长时间(以毫秒为单位)
connection-timeout: 30000 #客户端等待连接池连接的最大毫秒数
redis:
database: 0 #redis使用的数据库(0-15)
host: xx.xx.xx.xxx #redis服务器IP
port: 6379 #redis服务器端口
password: xxxxxxxx #redis密码
pool:
max-active: 20 #在给定的时间,连接池中分配的最大连接数
max-wait: 20000 #链接阻塞最大等待时间(以毫秒为单位),连接池耗尽时抛出异常。使用负值无限期地阻塞
min-idle:1 #连接池最小的空闲连接数
timeout: 60000 #链接超时时间(以毫秒为单位)
cache: #配置Spring Cache
type: redis #缓存类型
cloud:
config:
fail-fast: true #失败快速响应
retry: #配置重试,默认是重试6次,最初是延迟1s再次重试,如果再失败,则延迟1.1*1s、1.1*1.1*1s、… 。可以使用这个配置
initial-interval: 1000 #最多重试次数
max-interval: 2000 #最大重试间隔
max-attempts: 100 #最多重试次数
url: http://{用户名}:{密码}@{路径}:{端口}/config
name: x-user #模块名
profile: dev #获取配置的策略,如果不设置此值,则系统设置此值为 spring.profiles.active
label: master #获取配置文件的分支,默认是master
server:
port: 9083 #端口号
tomcat:
max-threads: 200 #tomcat 启动的最大线程数
jhipster:
http:
vsrsion: V_1_1 #要使用HTTP/2协议,需要SSL支持(请参阅上面的“server.SSL”配置)
cors: #CORS(跨域请求共享)仅在默认情况下通过“dev”配置文件启用,因此BrowserSync可以访问API
allowed-origins: #允许跨域的域名,可以用"*"表示都可以
allowed-methods: GET, PUT, POST, DELETE, OPTIONS #允许方法
allowed-headers: "*" #允许请求头
exposed-headers: #控制API请求可以读取的返回的header
allow-credentials: true #带上cookie信息
max-age: 1800 #在1800秒内,不需要再发送预检验请求,可以缓存该结果