mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 20:22:12 +08:00
通过 spring.profiles.active 指定配置来选择后端不同数据库的配置。
This commit is contained in:
32
web/src/main/resources/application-mysql.yml
Normal file
32
web/src/main/resources/application-mysql.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
server:
|
||||
port: 8080
|
||||
tomcat:
|
||||
accept-count: 100
|
||||
max-connections: 1000
|
||||
max-threads: 20
|
||||
min-spare-threads: 20
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: kafkamanager
|
||||
datasource:
|
||||
kafka-manager:
|
||||
driver-class-name: org.mariadb.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://localhost:3306/kafka_manager?characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
username: admin
|
||||
password: admin
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
profiles:
|
||||
active: dev
|
||||
|
||||
logging:
|
||||
config: classpath:logback-spring.xml
|
||||
|
||||
# kafka监控
|
||||
kafka-monitor:
|
||||
enabled: true
|
||||
notify-kafka:
|
||||
cluster-id: 95
|
||||
topic-name: kmo_monitor
|
||||
36
web/src/main/resources/application-pg.yml
Normal file
36
web/src/main/resources/application-pg.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
server:
|
||||
port: 8080
|
||||
tomcat:
|
||||
accept-count: 100
|
||||
max-connections: 1000
|
||||
max-threads: 20
|
||||
min-spare-threads: 20
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: kafkamanager
|
||||
datasource:
|
||||
kafka-manager:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
jdbc-url: jdbc:postgresql://localhost:5432/kafka_manager?reWriteBatchedInserts=true
|
||||
username: admin
|
||||
password: admin
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
hikari:
|
||||
connection-init-sql: "SET TIME ZONE 'Asia/Chongqing';SET CLIENT_ENCODING TO 'UTF-8';"
|
||||
connection-test-query: "select 1;"
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
profiles:
|
||||
active: dev
|
||||
|
||||
logging:
|
||||
config: classpath:logback-spring.xml
|
||||
|
||||
# kafka监控
|
||||
kafka-monitor:
|
||||
enabled: true
|
||||
notify-kafka:
|
||||
cluster-id: 95
|
||||
topic-name: kmo_monitor
|
||||
@@ -1,39 +1,3 @@
|
||||
server:
|
||||
port: 8080
|
||||
tomcat:
|
||||
accept-count: 100
|
||||
max-connections: 1000
|
||||
max-threads: 20
|
||||
min-spare-threads: 20
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: kafkamanager
|
||||
datasource:
|
||||
kafka-manager:
|
||||
#driver-class-name: org.postgresql.Driver
|
||||
#jdbc-url: jdbc:postgresql://localhost:5432/kafka_manager?reWriteBatchedInserts=true
|
||||
driver-class-name: org.mariadb.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://localhost:3306/kafka_manager?characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
username: admin
|
||||
password: admin
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
hikari:
|
||||
# PostgreSQL 使用
|
||||
#connection-init-sql: "SET TIME ZONE 'Asia/Chongqing';SET CLIENT_ENCODING TO 'UTF-8';"
|
||||
connection-test-query: "select 1;"
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
profiles:
|
||||
active: dev
|
||||
|
||||
logging:
|
||||
config: classpath:logback-spring.xml
|
||||
|
||||
# kafka监控
|
||||
kafka-monitor:
|
||||
enabled: true
|
||||
notify-kafka:
|
||||
cluster-id: 95
|
||||
topic-name: kmo_monitor
|
||||
active: mysql
|
||||
Reference in New Issue
Block a user