Mr.qian 1 vecka sedan
förälder
incheckning
248ba6adab
2 ändrade filer med 119 tillägg och 1 borttagningar
  1. 7 0
      cif-service/pom.xml
  2. 112 1
      cif-service/src/main/resources/bootstrap.properties

+ 7 - 0
cif-service/pom.xml

@@ -322,6 +322,13 @@
             <version>2.2.5</version>
         </dependency>
 
+        <!-- ShardingSphere -->
+        <dependency>
+            <groupId>org.apache.shardingsphere</groupId>
+            <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
+            <version>4.1.1</version>
+        </dependency>
+
     </dependencies>
 
 

+ 112 - 1
cif-service/src/main/resources/bootstrap.properties

@@ -34,7 +34,7 @@ springfox.documentation.enabled=false
 #spring.cloud.nacos.config.ext-config[3].refresh=true
 spring.cloud.nacos.config.extension-configs[0]=mq-${spring.profiles.active}.properties
 spring.cloud.nacos.config.extension-configs[1]=redis-${spring.profiles.active}.properties
-spring.cloud.nacos.config.extension-configs[2]=${spring.application.name}-${spring.profiles.active}.properties
+#spring.cloud.nacos.config.extension-configs[2]=${spring.application.name}-${spring.profiles.active}.properties
 
 #spring.cloud.nacos.config.ext-config[5].data-id=rconsult-${spring.profiles.active}.properties
 #spring.cloud.nacos.config.ext-config[5].refresh=true
@@ -121,3 +121,114 @@ yp.ali.appid=2021003182699876
 yp.wx.appid=wxf85cf793dbaa8a61
 
 logging.level.com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.grpc.netty.NettyClientHandler=off
+
+signature=false
+login.check=false
+#spring.zipkin.base-url=http://192.168.1.10:5595
+#spring.datasource.url=jdbc:mysql://124.222.152.234:3306/cif?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
+#spring.datasource.username=root
+#spring.datasource.password=hy123456
+#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+#hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=100000
+#hystrix.threadpool.default.coreSize=10000
+#hystrix.threadpool.default.maximumSize=100000
+
+
+jbs.url=http://vip.cellocation.com/cell/fdhbyshf.php
+spring.datasource.type=com.zaxxer.hikari.HikariDataSource
+spring.datasource.hikari.connection-timeout=30000
+spring.datasource.hikari.minimum-idle=4
+#spring.datasource.hikari.maximum-pool-size=15
+spring.datasource.hikari.auto-commit=true
+spring.datasource.hikari.idle-timeout=60000
+spring.datasource.hikari.pool-name=DatebookHikariCP
+spring.datasource.hikari.max-lifetime=28740000
+spring.datasource.hikari.connection-test-query=SELECT 1
+
+#logging.level.com.txz=info
+#logging.level.com.txz.cif.dao=debug
+#logging.level.com.alibaba.nacos.client.naming=error
+
+
+
+spring.datasource.hikari.read-only=false
+#spring.datasource.hikari.connection-timeout=60000
+#spring.datasource.hikari.idle-timeout=60000
+spring.datasource.hikari.validation-timeout=3000
+#spring.datasource.hikari.max-lifetime=60000
+spring.datasource.hikari.login-timeout=5
+spring.datasource.hikari.maximum-pool-size=60
+#spring.datasource.hikari.minimum-idle=10
+
+
+multipart.maxFileSize=50Mb
+server.undertow.max-http-post-size=83886080
+#spring.servlet.multipart.enabled=true
+# ???????????
+#spring.servlet.multipart.max-file-size=100MB
+# ?????????????
+#spring.servlet.multipart.max-request-size=1000MB
+# dubbo?????????, ??8388608  8M, ??80M
+dubbo.protocol.dubbo.payload=83886080
+
+# tfpay
+#tfpay.key=Jh6jMvIsyBGyYwqpVSUvUFssH4chH02U
+#tfpay.notifyurl=http://qian.free.idcfengye.com/cif/notify/pay/tfpay
+tfpay.callbackurl=https://www.google.com
+#tfpay.memberid=260875
+tfpay.paymenturl=https://api.tfpay.org
+tfpay.withdrawurl=https://apiot.tfpay.org
+
+
+# Sharding-JDBC??
+spring.shardingsphere.datasource.names=ds0,ds1,ds-default
+
+# ???0??
+spring.shardingsphere.datasource.ds0.type=com.zaxxer.hikari.HikariDataSource
+spring.shardingsphere.datasource.ds0.driver-class-name=com.mysql.jdbc.Driver
+spring.shardingsphere.datasource.ds0.jdbc-url=jdbc:mysql://124.222.152.234:3306/cif_0?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
+spring.shardingsphere.datasource.ds0.username=root
+spring.shardingsphere.datasource.ds0.password=hy123456
+
+# ???1??
+spring.shardingsphere.datasource.ds1.type=com.zaxxer.hikari.HikariDataSource
+spring.shardingsphere.datasource.ds1.driver-class-name=com.mysql.jdbc.Driver
+spring.shardingsphere.datasource.ds1.jdbc-url=jdbc:mysql://124.222.152.234:3306/cif_1?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
+spring.shardingsphere.datasource.ds1.username=root
+spring.shardingsphere.datasource.ds1.password=hy123456
+
+# ???????
+spring.shardingsphere.datasource.ds-default.type=com.zaxxer.hikari.HikariDataSource
+spring.shardingsphere.datasource.ds-default.driver-class-name=com.mysql.jdbc.Driver
+spring.shardingsphere.datasource.ds-default.jdbc-url=jdbc:mysql://124.222.152.234:3306/cif?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
+spring.shardingsphere.datasource.ds-default.username=root
+spring.shardingsphere.datasource.ds-default.password=hy123456
+
+# c_account_flow??????
+spring.shardingsphere.sharding.tables.c_account_flow.actual-data-nodes=ds$->{0..1}.c_account_flow_$->{0..1}
+spring.shardingsphere.sharding.tables.c_account_flow.database-strategy.inline.sharding-column=user_id
+spring.shardingsphere.sharding.tables.c_account_flow.database-strategy.inline.algorithm-expression=ds$->{user_id % 2}
+spring.shardingsphere.sharding.tables.c_account_flow.table-strategy.inline.sharding-column=id
+spring.shardingsphere.sharding.tables.c_account_flow.table-strategy.inline.algorithm-expression=c_account_flow_$->{id % 2}
+
+
+# c_flow??????
+spring.shardingsphere.sharding.tables.c_flow.actual-data-nodes=ds$->{0..1}.c_flow_$->{0..1}
+spring.shardingsphere.sharding.tables.c_flow.database-strategy.inline.sharding-column=user_id
+spring.shardingsphere.sharding.tables.c_flow.database-strategy.inline.algorithm-expression=ds$->{user_id % 2}
+spring.shardingsphere.sharding.tables.c_flow.table-strategy.inline.sharding-column=id
+spring.shardingsphere.sharding.tables.c_flow.table-strategy.inline.algorithm-expression=c_flow_$->{id % 2}
+
+# c_red_envelope??????
+spring.shardingsphere.sharding.tables.c_red_envelope.actual-data-nodes=ds$->{0..1}.c_red_envelope_$->{0..1}
+spring.shardingsphere.sharding.tables.c_red_envelope.database-strategy.inline.sharding-column=user_id
+spring.shardingsphere.sharding.tables.c_red_envelope.database-strategy.inline.algorithm-expression=ds$->{user_id % 2}
+spring.shardingsphere.sharding.tables.c_red_envelope.table-strategy.inline.sharding-column=id
+spring.shardingsphere.sharding.tables.c_red_envelope.table-strategy.inline.algorithm-expression=c_red_envelope_$->{id % 2}
+
+# ?????
+spring.shardingsphere.sharding.default-data-source-name=ds-default
+
+spring.shardingsphere.props.sql.show=true
+
+management.health.db.enabled=false