Commit 3b58d8ae authored by tangtuo's avatar tangtuo

新增生产环境配置

parent 5d88ea49
......@@ -3,33 +3,29 @@ server:
spring:
main:
allow-bean-definition-overriding: true
shardingsphere:
datasource:
names:
write,read
# 主数据源
write:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.135:3306/joying_dev?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
# 从数据源
read:
platform: mysql
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.136:3306/joying_dev?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
masterslave:
# 读写分离配置
load-balance-algorithm-type: round_robin
# 最终的数据源名称
name: dataSource
# 主库数据源名称
master-data-source-name: write
# 从库数据源名称列表,多个逗号分隔
slave-data-source-names: read
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
filters: stat ,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
useGlobalDataSourceStat: true
redis:
host: 172.16.101.135
port: 6379
......
......@@ -3,33 +3,29 @@ server:
spring:
main:
allow-bean-definition-overriding: true
shardingsphere:
datasource:
names:
write,read
# 主数据源
write:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.135:3306/joying_dev?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
# 从数据源
read:
platform: mysql
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.136:3306/joying_dev?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
masterslave:
# 读写分离配置
load-balance-algorithm-type: round_robin
# 最终的数据源名称
name: dataSource
# 主库数据源名称
master-data-source-name: write
# 从库数据源名称列表,多个逗号分隔
slave-data-source-names: read
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
filters: stat ,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
useGlobalDataSourceStat: true
redis:
host: 172.16.101.135
......
server:
port: 8002
spring:
main:
allow-bean-definition-overriding: true
datasource:
url: jdbc:mysql://rm-uf65dutlz01018ctc33150.mysql.rds.aliyuncs.com:3306/joying?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: inmvochain
password: db$95872!com@inmvo
platform: mysql
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
filters: stat ,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
useGlobalDataSourceStat: true
redis:
host: r-uf65vh5nip6yjfgtcn.redis.rds.aliyuncs.com
port: 6379
password: db$95872!com@inmvo
lettuce:
pool:
# 连接池最大连接数(使用负值表示没有限制) 默认 8
max-active: 100
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
max-wait: -1
# 连接池中的最大空闲连接 默认 8
max-idle: 8
# 连接池中的最小空闲连接 默认 0
min-idle: 0
cache:
# 整合SpringCache,redis作为缓存类型
type: redis
redis:
# 缓存失效时间
time-to-live: 86400000
swagger:
title: 乐映影视后台管理系统
description: 乐映影视后台管理系统RESTFUL API
version: 1.0.0
base-package: com.fzm.admin.controller
base-path: /**
enabled: false
globalOperationParameters:
- description: Authorization
modelRef: string
name: Authorization
parameterType: header
required: false
contact:
name: tangtuo
email: ttuo@33.com
chain:
para:
rpc-url: http://47.243.127.76:8901
withhold-addr: 1Ae6FfgdYJn6LLaqDoRjwga3j4TTmMq3t7
withhold-key: a4c49dcb35e0032dc8db5891dc81481943b68fc558ce93ce74d0382c1d104934
title: user.p.FilmChain
admin: 16naUoLwjNUgMhGVRmL3xTVpCso2DJp8JZ
admin-key: 8cd19e9bf39055f95e3e33cc1e08b9f9fc2e9be48a5b3a4d401e64041c97aec7
contract-name: user.evm.0xd996a3a866c577596df260844a045a068ec5accd8d71ccaa3d578c9617ec5490
contract-address: 1iDWTHZQxPES4hLveZRcwJH6AMaMfZfZZ
aliyun:
oss:
app-key: LTAI5tAAXBCtnQ2ytwagazjt
app-secret: x0T6hyJvRFLtPjZYrNo5egEc4kShlU
end-point: oss-cn-shanghai.aliyuncs.com
simple-bucket: joying-file
encrypt-bucket: joying-nft
......@@ -3,33 +3,29 @@ server:
spring:
main:
allow-bean-definition-overriding: true
shardingsphere:
datasource:
names:
write,read
# 主数据源
write:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.135:3306/joying_test?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
# 从数据源
read:
platform: mysql
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.136:3306/joying_test?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
masterslave:
# 读写分离配置
load-balance-algorithm-type: round_robin
# 最终的数据源名称
name: dataSource
# 主库数据源名称
master-data-source-name: write
# 从库数据源名称列表,多个逗号分隔
slave-data-source-names: read
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
filters: stat ,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
useGlobalDataSourceStat: true
redis:
host: 172.16.101.136
port: 6379
......
......@@ -58,6 +58,10 @@
<appender-ref ref="CONSOLE"/>
<appender-ref ref="INFO_FILE"/>
</springProfile>
<springProfile name="prod">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="INFO_FILE"/>
</springProfile>
</root>
</configuration>
\ No newline at end of file
......@@ -80,11 +80,6 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
</dependency>
......
package com.fzm.common.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
/**
* @author tangtuo
* @date 2021/7/19 10:25
* <p>
* 集群版redisson客户端配置
* </p>
*/
@Profile({"prod"})
@Configuration
public class RedissonClusterConfig {
}
......@@ -17,9 +17,8 @@ import javax.annotation.Resource;
* 单机版redisson客户端配置
* </p>
*/
@Profile({"dev", "local", "test"})
@Configuration
public class RedissonSingleConfig {
public class RedissonConfig {
@Resource
RedisProperties redisProperties;
......
......@@ -287,7 +287,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
throw GlobalException.newException(ResultCode.DATA_ERROR, "没找到此类目");
}
int code = RandomUtil.randomInt(1000, 10000);
return String.format("YIMU-%s-%s%s", category.getEnglishName(), System.currentTimeMillis(), code);
return String.format("INMVO-%s-%s%s", category.getEnglishName(), System.currentTimeMillis(), code);
}
@Override
......
......@@ -187,20 +187,21 @@ public class OssUtil {
public static void main(String[] args) {
String endpoint = "oss-cn-hangzhou.aliyuncs.com";
String endpoint = "oss-cn-shanghai.aliyuncs.com";
// 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录RAM控制台创建RAM账号。
String accessKeyId = "LTAI5tHGn7cVJdEtihTFLSeB";
String accessKeySecret = "XYmfBSbLaZoblGXZwIXkbhfBD7a1eg";
String accessKeyId = "LTAI5tAAXBCtnQ2ytwagazjt";
String accessKeySecret = "x0T6hyJvRFLtPjZYrNo5egEc4kShlU";
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
// 创建存储空间。
String bucket = "test-nft-2";
if (!ossClient.doesBucketExist(bucket)) {
String bucket2 = "joying-nft";
if (ossClient.doesBucketExist(bucket2)) {
// 设置Bucket加密。
ServerSideEncryptionByDefault applyServerSideEncryptionByDefault = new ServerSideEncryptionByDefault(SSEAlgorithm.AES256);
ServerSideEncryptionConfiguration sseConfig = new ServerSideEncryptionConfiguration();
sseConfig.setApplyServerSideEncryptionByDefault(applyServerSideEncryptionByDefault);
SetBucketEncryptionRequest request = new SetBucketEncryptionRequest(bucket, sseConfig);
SetBucketEncryptionRequest request = new SetBucketEncryptionRequest(bucket2, sseConfig);
ossClient.setBucketEncryption(request);
ossClient.shutdown();
}
......
......@@ -3,33 +3,29 @@ server:
spring:
main:
allow-bean-definition-overriding: true
shardingsphere:
datasource:
names:
write,read
# 主数据源
write:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.135:3306/joying_dev?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
# 从数据源
read:
platform: mysql
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.136:3306/joying_dev?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
masterslave:
# 读写分离配置
load-balance-algorithm-type: round_robin
# 最终的数据源名称
name: dataSource
# 主库数据源名称
master-data-source-name: write
# 从库数据源名称列表,多个逗号分隔
slave-data-source-names: read
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
filters: stat ,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
useGlobalDataSourceStat: true
redis:
host: 172.16.101.135
port: 6379
......
......@@ -3,33 +3,29 @@ server:
spring:
main:
allow-bean-definition-overriding: true
shardingsphere:
datasource:
names:
write,read
# 主数据源
write:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.135:3306/joying_dev?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
# 从数据源
read:
platform: mysql
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.136:3306/joying_dev?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
masterslave:
# 读写分离配置
load-balance-algorithm-type: round_robin
# 最终的数据源名称
name: dataSource
# 主库数据源名称
master-data-source-name: write
# 从库数据源名称列表,多个逗号分隔
slave-data-source-names: read
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
filters: stat ,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
useGlobalDataSourceStat: true
redis:
host: localhost
port: 6379
......
server:
port: 8001
spring:
main:
allow-bean-definition-overriding: true
datasource:
url: jdbc:mysql://rm-uf65dutlz01018ctc33150.mysql.rds.aliyuncs.com:3306/joying?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: inmvochain
password: db$95872!com@inmvo
platform: mysql
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
filters: stat ,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
useGlobalDataSourceStat: true
redis:
host: r-uf65vh5nip6yjfgtcn.redis.rds.aliyuncs.com
port: 6379
password: db$95872!com@inmvo
lettuce:
pool:
# 连接池最大连接数(使用负值表示没有限制) 默认 8
max-active: 100
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
max-wait: -1
# 连接池中的最大空闲连接 默认 8
max-idle: 8
# 连接池中的最小空闲连接 默认 0
min-idle: 0
cache:
# 整合SpringCache,redis作为缓存类型
type: redis
redis:
time-to-live: 86400000
swagger:
title: 乐映影视门户系统
description: 乐映影视门户系统RESTFUL API
version: 1.0.0
base-package: com.fzm.portal.controller
base-path: /**
enabled: false
globalOperationParameters:
- description: Authorization
modelRef: string
name: Authorization
parameterType: header
required: false
contact:
name: tangtuo
email: ttuo@33.com
sms:
app-key: Yiru
app-secret: mx5oaR^RY8!(ziHn
login-message-codetype: quick
login-email-codetype: quick
login-voice-codetype: quick
send-sms-url: http://118.31.52.32/send/sms2
validate-code-url: http://118.31.52.32/validate/code
transfer-nft-message-codetype: notice_transfer
transfer-nft-email-codetype: notice_transfer
transfer-nft-voice-codetype: notice_transfer
chain:
para:
rpc-url: http://47.243.127.76:8901
withhold-addr: 1Ae6FfgdYJn6LLaqDoRjwga3j4TTmMq3t7
withhold-key: a4c49dcb35e0032dc8db5891dc81481943b68fc558ce93ce74d0382c1d104934
title: user.p.FilmChain
admin: 16naUoLwjNUgMhGVRmL3xTVpCso2DJp8JZ
admin-key: 8cd19e9bf39055f95e3e33cc1e08b9f9fc2e9be48a5b3a4d401e64041c97aec7
contract-name: user.evm.0xd996a3a866c577596df260844a045a068ec5accd8d71ccaa3d578c9617ec5490
contract-address: 1iDWTHZQxPES4hLveZRcwJH6AMaMfZfZZ
aliyun:
oss:
app-key: LTAI5tAAXBCtnQ2ytwagazjt
app-secret: x0T6hyJvRFLtPjZYrNo5egEc4kShlU
end-point: oss-cn-shanghai.aliyuncs.com
simple-bucket: joying-file
encrypt-bucket: joying-nft
......@@ -3,33 +3,29 @@ server:
spring:
main:
allow-bean-definition-overriding: true
shardingsphere:
datasource:
names:
write,read
# 主数据源
write:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.135:3306/joying_test?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
# 从数据源
read:
platform: mysql
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.101.136:3306/joying_test?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
username: root
password: Joying@123456
masterslave:
# 读写分离配置
load-balance-algorithm-type: round_robin
# 最终的数据源名称
name: dataSource
# 主库数据源名称
master-data-source-name: write
# 从库数据源名称列表,多个逗号分隔
slave-data-source-names: read
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
filters: stat ,wall
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
useGlobalDataSourceStat: true
redis:
host: 172.16.101.136
port: 6379
......
......@@ -58,6 +58,10 @@
<appender-ref ref="CONSOLE"/>
<appender-ref ref="INFO_FILE"/>
</springProfile>
<springProfile name="prod">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="INFO_FILE"/>
</springProfile>
</root>
</configuration>
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment