mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
增加生产环境配置
This commit is contained in:
parent
755300db3c
commit
20469bd669
@ -2,20 +2,18 @@ package com.java2nb;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
//关闭SpringSecurity的功能
|
||||
@EnableAutoConfiguration(exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
|
||||
@EnableTransactionManagement
|
||||
@ServletComponentScan
|
||||
@MapperScan("com.java2nb.*.dao")
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication(exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
@EnableCaching
|
||||
public class AdminApplication {
|
||||
public static void main(String[] args) {
|
||||
|
@ -9,8 +9,8 @@ logging:
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
#password:
|
||||
|
@ -1,16 +1,19 @@
|
||||
java2nb:
|
||||
uploadPath: /var/java2nb/uploaded_files/
|
||||
uploadPath: /var/pic/
|
||||
username: admin
|
||||
password: 111111
|
||||
logging:
|
||||
level:
|
||||
root: error
|
||||
com.java2nb: info
|
||||
com.java2nb: error
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/java2nb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: java2nb
|
||||
password: java2nb1019
|
||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
#password:
|
||||
initialSize: 1
|
||||
minIdle: 3
|
||||
maxActive: 20
|
||||
@ -34,18 +37,18 @@ spring:
|
||||
# 合并多个DruidDataSource的监控数据
|
||||
#useGlobalDataSourceStat: true
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
# 连接超时时间(毫秒)
|
||||
timeout: 10000
|
||||
jedis:
|
||||
pool:
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 10
|
||||
# 连接池最大连接数(使用负值表示没有限制)
|
||||
max-active: 100
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: test
|
||||
# 连接超时时间(毫秒)
|
||||
timeout: 10000
|
||||
jedis:
|
||||
pool:
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 10
|
||||
# 连接池最大连接数(使用负值表示没有限制)
|
||||
max-active: 100
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1
|
@ -71,8 +71,3 @@ sharding:
|
||||
|
||||
|
||||
|
||||
pic:
|
||||
save:
|
||||
type: 2 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
||||
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
||||
path: /var/pic #图片保存路径
|
82
novel-common/src/main/resources/application-common-prod.yml
Normal file
82
novel-common/src/main/resources/application-common-prod.yml
Normal file
@ -0,0 +1,82 @@
|
||||
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:
|
||||
url: jdbc:mysql://127.0.0.1:3306/novel_biz?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
|
||||
####使用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: com.mysql.cj.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
# 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}
|
||||
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: error
|
||||
com.java2nb: error
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common]
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/novel_biz?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
|
||||
pic:
|
||||
save:
|
||||
type: 2 #图片保存方式, 1不保存,使用网络图片 ,2本地保存
|
||||
path: /var/pic #图片保存路径
|
||||
|
||||
|
||||
|
3
novel-crawl/src/main/resources/application-prod.yml
Normal file
3
novel-crawl/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,3 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common-prod]
|
@ -1,3 +1,10 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common-dev]
|
||||
profiles:
|
||||
include: [common-dev]
|
||||
|
||||
|
||||
pic:
|
||||
save:
|
||||
type: 1 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
||||
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
||||
path: /var/pic #图片保存路径
|
21
novel-front/src/main/resources/application-prod.yml
Normal file
21
novel-front/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,21 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common-prod]
|
||||
|
||||
#thymeleaf模版路径配置
|
||||
thymeleaf:
|
||||
prefix: file:${user.dir}/templates/${templates.name}/html/
|
||||
suffix: .html
|
||||
|
||||
#模版配置
|
||||
templates:
|
||||
name: orange
|
||||
|
||||
|
||||
pic:
|
||||
save:
|
||||
type: 2 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
||||
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
||||
path: /var/pic #图片保存路径
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common-test]
|
@ -25,10 +25,7 @@ spring:
|
||||
jest:
|
||||
uris: http://192.168.0.105:9200
|
||||
|
||||
#thymeleaf模版路径配置
|
||||
thymeleaf:
|
||||
prefix: file:${user.dir}/templates/${templates.name}/html/
|
||||
suffix: .html
|
||||
|
||||
#静态文件路径配置
|
||||
resources:
|
||||
static-locations: file:${user.dir}/templates/${templates.name}/static/
|
||||
@ -76,9 +73,7 @@ book:
|
||||
|
||||
|
||||
|
||||
#模版配置
|
||||
templates:
|
||||
name: orange
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user