application-common-dev.yml
spring:
profiles:
include: [common]
main:
allow-bean-definition-overriding: true
#Redis服務器IP
redis:
host: 127.0.0.1
#Redis服務器連接端口
port: 6379
#Redis服務器連接密碼
password: test
jedis:
pool:
#連接池最大連接數(使用負值表示沒有限制)
max-active: 8
#連接池最大阻塞等待時間(使用負值表示沒有限制)
max-wait: 1
#連接池最大阻塞等待時間(使用負值表示沒有限制)
max-idle: 8
#連接池中的最小空閒連接
min-idle: 0
#連接超時時間(毫秒)
timeout: 30000
datasource:
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:@//FP-DB-USCAN.wfh.local:1521/fp_uat
username: SZSW
password: 5z5w0RAR0
####使用shardingJdbc時,
####所有的jdbcType都不能是LONGVARCHAR,否則會導致java.io.NotSerializableException: java.io.StringReader錯誤
##### 應該替換所有的 LONGVARCHAR 類型爲VARCHAR
sharding:
jdbc:
datasource:
names: ds0 #,ds1
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: oracle.jdbc.OracleDriver
jdbc-url: jdbc:oracle:thin:@//FP-DB-USCAN.wfh.local:1521/fp_uat
username: SZSW
password: 5z5w0RAR0
# ds1:
# type: com.alibaba.druid.pool.DruidDataSource
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://localhost:3306/novel_plus2
# username: root
# password: test123456
config:
sharding:
props:
sql.show: true
tables:
book_content: #book_content表
key-generator-column-name: id #主鍵
actual-data-nodes: ds${0}.book_content${0..9} #數據節點
# database-strategy: #分庫策略
# inline:
# sharding-column: book_id
# algorithm-expression: ds${book_id % 10}
table-strategy: #分表策略
inline:
shardingColumn: index_id
algorithm-expression: book_content${index_id % 10}
content:
save:
storage: db #存儲介質,db:數據庫,file:txt文本
path: /Users/xiongxiaoyang/books #txt小說文本保存路徑
<!--oracle驅動--> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>6.0</version> <type>jar</type> </dependency>