-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
276 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
server: | ||
port: 8003 | ||
compression: | ||
enabled: true | ||
mime-types: application/json,application/xml,text/html,text/xml,text/plain | ||
|
||
spring: | ||
application: | ||
name: light-reading-cloud-account | ||
# 数据源配置 | ||
datasource: | ||
account-center: | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
url: jdbc:mysql://localhost:3306/reading_cloud_account?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8 | ||
username: root | ||
password: 'pass123' | ||
initial-size: 5 | ||
min-idle: 5 | ||
max-active: 30 | ||
max-wait: 6000 | ||
test-while-idle: true | ||
validation-query: 'select 1 from dual' | ||
connect-timeout: 1500 | ||
|
||
# 线程池配置 | ||
thread-pool: | ||
# 公用线程池 | ||
common: | ||
corePoolSize: 1 | ||
maximumPoolSize: 5 | ||
keepAliveTime: 0 | ||
queueCapacity: 20480 | ||
# 书架线程池 | ||
bookshelf: | ||
corePoolSize: 1 | ||
maximumPoolSize: 3 | ||
keepAliveTime: 0 | ||
queueCapacity: 10240 | ||
|
||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: http://localhost:1001/eureka/ | ||
|
||
feign: | ||
okhttp: | ||
enabled: true | ||
hystrix: | ||
enabled: true | ||
compression: | ||
request: | ||
enabled: true | ||
mime-type: text/html,application/xml,application/json | ||
min-request-size: 1024 | ||
response: | ||
enabled: true | ||
|
||
from: dev-environment-1.0... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
server: | ||
port: 8001 | ||
|
||
spring: | ||
application: | ||
# 服务逻辑名称 | ||
name: light-reading-cloud-book | ||
datasource: | ||
book-center: | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
url: jdbc:mysql://rm-m5e52b35wx8shto17125010.mysql.rds.aliyuncs.com:3306/reading_cloud_resource?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8 | ||
username: reading_cloud | ||
password: 'withyou2020' | ||
initial-size: 5 | ||
min-idle: 5 | ||
max-active: 30 | ||
max-wait: 6000 | ||
test-while-idle: true | ||
validation-query: 'select 1 from dual' | ||
connect-timeout: 1500 | ||
|
||
#---- redis配置 ----# | ||
redis: | ||
database: 0 | ||
host: localhost | ||
port: 6379 | ||
password: | ||
jedis: | ||
pool: | ||
#最大连接数据库连接数,设 0 为没有限制 | ||
max-active: 30 | ||
#最大等待连接中的数量,设 0 为没有限制 | ||
max-idle: 10 | ||
#最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。 | ||
max-wait: -1ms | ||
#最小等待连接中的数量,设 0 为没有限制 | ||
min-idle: 0 | ||
lettuce: | ||
pool: | ||
max-active: 10 | ||
max-idle: 5 | ||
max-wait: -1ms | ||
min-idle: 0 | ||
shutdown-timeout: 100ms | ||
eureka: | ||
instance: | ||
# 注册服务的IP,而不是逻辑名称 | ||
prefer-ip-address: true | ||
client: | ||
service-url: | ||
defaultZone: http://localhost:1001/eureka/ | ||
register-with-eureka: true | ||
fetch-registry: true | ||
|
||
hystrix: | ||
threadpool: | ||
default: | ||
coreSize: 20 #并发执行的最大线程数,默认10 | ||
maxQueueSize: 1000 #BlockingQueue的最大队列数,默认值-1 | ||
queueSizeRejectionThreshold: 400 | ||
|
||
from: dev-environment-1.0... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
server: | ||
port: 8010 | ||
|
||
spring: | ||
application: | ||
# 服务逻辑名称 | ||
name: light-reading-cloud-gateway | ||
cloud: | ||
gateway: | ||
discovery: | ||
locator: | ||
enabled: true | ||
lowerCaseServiceId: true | ||
routes: | ||
- id: book-center-rpc | ||
uri: lb://light-reading-cloud-book | ||
predicates: | ||
- Path=/book/** | ||
- Method=GET | ||
filters: | ||
# 降级配置 | ||
- name: Hystrix | ||
args: | ||
name: fallbackcmd | ||
fallbackUri: forward:/fallback | ||
# 限流配置 | ||
- name: RequestRateLimiter | ||
args: | ||
redis-rate-limiter.replenishRate: 3 # 每秒允许处理的请求数量 | ||
redis-rate-limiter.burstCapacity: 5 # 每秒最大处理的请求数量 | ||
key-resolver: "#{@ipKeyResolver}" # 限流策略,对应策略的Bean | ||
|
||
|
||
- id: homepage-rpc | ||
uri: lb://light-reading-cloud-homepage | ||
predicates: | ||
- Path=/index/** | ||
filters: | ||
# 降级配置 | ||
- name: Hystrix | ||
args: | ||
name: fallbackcmd | ||
fallbackUri: forward:/fallback | ||
# 限流配置 | ||
- name: RequestRateLimiter | ||
args: | ||
redis-rate-limiter.replenishRate: 3 | ||
redis-rate-limiter.burstCapacity: 5 | ||
key-resolver: "#{@ipKeyResolver}" | ||
|
||
- id: account-center-rpc | ||
uri: lb://light-reading-cloud-account | ||
predicates: | ||
- Path=/account/** | ||
filters: | ||
# 降级配置 | ||
- name: Hystrix | ||
args: | ||
name: fallbackcmd | ||
fallbackUri: forward:/fallback | ||
# 限流配置 | ||
- name: RequestRateLimiter | ||
args: | ||
redis-rate-limiter.replenishRate: 3 | ||
redis-rate-limiter.burstCapacity: 5 | ||
key-resolver: "#{@ipKeyResolver}" | ||
|
||
eureka: | ||
instance: | ||
# 注册服务的IP,而不是逻辑名称 | ||
prefer-ip-address: true | ||
client: | ||
service-url: | ||
defaultZone: http://localhost:1001/eureka/ | ||
register-with-eureka: true | ||
fetch-registry: true | ||
|
||
hystrix: | ||
threadpool: | ||
default: | ||
coreSize: 20 #并发执行的最大线程数,默认10 | ||
maxQueueSize: 1000 #BlockingQueue的最大队列数,默认值-1 | ||
queueSizeRejectionThreshold: 400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
server: | ||
port: 8002 | ||
compression: | ||
enabled: true | ||
mime-types: application/json,application/xml,text/html,text/xml,text/plain | ||
|
||
spring: | ||
application: | ||
name: light-reading-cloud-homepage | ||
datasource: | ||
book-center: | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
url: jdbc:mysql://localhost:3306/reading_cloud_resource?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8 | ||
username: root | ||
password: 'pass123' | ||
initial-size: 5 | ||
min-idle: 5 | ||
max-active: 30 | ||
max-wait: 6000 | ||
test-while-idle: true | ||
validation-query: 'select 1 from dual' | ||
connect-timeout: 1500 | ||
|
||
#---- ElasticSearch 配置 ----# | ||
es: | ||
indexType: book | ||
aliasName: books | ||
servers: http://47.104.241.41:9200 | ||
|
||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: http://localhost:1001/eureka/ | ||
|
||
feign: | ||
okhttp: | ||
enabled: true | ||
hystrix: | ||
enabled: true | ||
compression: | ||
request: | ||
enabled: true | ||
mime-type: text/html,application/xml,application/json | ||
min-request-size: 1024 | ||
response: | ||
enabled: true | ||
|
||
logging: | ||
level: | ||
cn: | ||
zealon: | ||
cn.zealon.readingcloud.book.feign.client: debug | ||
|
||
from: dev-environment-1.0... | ||
debug: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 项目配置说明 | ||
|
||
由于系统内容不足,经常导致Nacos宕机,所以这里存放每个项目的配置文件 bootstrap.yml | ||
|
||
调试时可以不使用Nacos注册发现,用静态配置文件和Eureka进行服务发现哈 | ||
|
||
| 项目 | 配置文件 | | ||
| ---------------------- | -------------------------- | | ||
| reading-cloud-account | reading-cloud-account.yml | | ||
| reading-cloud-book | reading-cloud-book.yml | | ||
| reading-cloud-gateway | reading-cloud-gateway.yml | | ||
| reading-cloud-homepage | reading-cloud-homepage.yml | | ||
|