添加Spring Cloud Config配置中心支持
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
druid:
|
||||
initial-size: 5 #连接池初始化大小
|
||||
min-idle: 10 #最小空闲连接数
|
||||
max-active: 20 #最大连接数
|
||||
web-stat-filter:
|
||||
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" #不统计这些请求数据
|
||||
stat-view-servlet: #访问监控网页的登录用户名和密码
|
||||
login-username: druid
|
||||
login-password: druid
|
||||
data:
|
||||
elasticsearch:
|
||||
repositories:
|
||||
enabled: true
|
||||
cluster-nodes: 127.0.0.1:9300
|
||||
eureka:
|
||||
client:
|
||||
register-with-eureka: true
|
||||
fetch-registry: true
|
||||
service-url:
|
||||
defaultZone: http://localhost:8001/eureka/
|
||||
management: #开启SpringBoot Admin的监控
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
@@ -1,23 +0,0 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://db:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: reader
|
||||
password: 123456
|
||||
druid:
|
||||
initial-size: 5 #连接池初始化大小
|
||||
min-idle: 10 #最小空闲连接数
|
||||
max-active: 20 #最大连接数
|
||||
web-stat-filter:
|
||||
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" #不统计这些请求数据
|
||||
stat-view-servlet: #访问监控网页的登录用户名和密码
|
||||
login-username: druid
|
||||
login-password: druid
|
||||
|
||||
data:
|
||||
elasticsearch:
|
||||
repositories:
|
||||
enabled: true
|
||||
cluster-nodes: es:9300
|
||||
|
||||
logging:
|
||||
path: /var/logs #配置日志生成路径
|
||||
@@ -1,21 +1,37 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: dev #默认为开发环境
|
||||
application:
|
||||
name: mall-search
|
||||
|
||||
server:
|
||||
port: 8081
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
druid:
|
||||
initial-size: 5 #连接池初始化大小
|
||||
min-idle: 10 #最小空闲连接数
|
||||
max-active: 20 #最大连接数
|
||||
web-stat-filter:
|
||||
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" #不统计这些请求数据
|
||||
stat-view-servlet: #访问监控网页的登录用户名和密码
|
||||
login-username: druid
|
||||
login-password: druid
|
||||
data:
|
||||
elasticsearch:
|
||||
repositories:
|
||||
enabled: true
|
||||
cluster-nodes: 127.0.0.1:9300
|
||||
cluster-name: elasticsearch
|
||||
mybatis:
|
||||
mapper-locations:
|
||||
- classpath:dao/*.xml
|
||||
- classpath*:com/**/mapper/*.xml
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: info
|
||||
com.macro.mall: debug
|
||||
management: #开启SpringBoot Admin的监控
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
|
||||
|
||||
|
||||
|
||||
13
mall-search/src/main/resources/bootstrap-dev.yml
Normal file
13
mall-search/src/main/resources/bootstrap-dev.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
spring:
|
||||
cloud:
|
||||
config:
|
||||
profile: dev #启用环境名称
|
||||
label: master #分支名称
|
||||
name: search #配置文件名称
|
||||
discovery:
|
||||
enabled: true
|
||||
service-id: mall-config
|
||||
eureka:
|
||||
client:
|
||||
service-url:
|
||||
defaultZone: http://localhost:8001/eureka/
|
||||
13
mall-search/src/main/resources/bootstrap-prod.yml
Normal file
13
mall-search/src/main/resources/bootstrap-prod.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
spring:
|
||||
cloud:
|
||||
config:
|
||||
profile: prod #启用环境名称
|
||||
label: master #分支名称
|
||||
name: search #配置文件名称
|
||||
discovery:
|
||||
enabled: true
|
||||
service-id: mall-config
|
||||
eureka:
|
||||
client:
|
||||
service-url:
|
||||
defaultZone: http://localhost:8001/eureka/
|
||||
5
mall-search/src/main/resources/bootstrap.yml
Normal file
5
mall-search/src/main/resources/bootstrap.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
application:
|
||||
name: mall-search
|
||||
Reference in New Issue
Block a user