fix(config): Correct Redis high availability deployment

This commit is contained in:
2026-03-17 11:19:59 +08:00
parent e57881f489
commit 14202e1bea
10 changed files with 846 additions and 28 deletions
@@ -0,0 +1,132 @@
server:
port: 9005
spring:
application:
name: video-recommend
cloud:
nacos:
discovery:
server-addr: ${NACOS_SERVERS:192.168.1.101:8848,192.168.1.102:8848,192.168.1.103:8848}
namespace: ${NACOS_NAMESPACE:public}
group: ${NACOS_GROUP:DEFAULT_GROUP}
username: nacos
password: nacos
ip: ${RECOMMEND_IP:}
config:
server-addr: ${spring.cloud.nacos.discovery.server-addr}
namespace: ${spring.cloud.nacos.discovery.namespace}
group: ${spring.cloud.nacos.discovery.group}
file-extension: yaml
username: nacos
password: nacos
sentinel:
transport:
dashboard: ${SENTINEL_HOST:sentinel}:${SENTINEL_PORT:8080}
port: 8725
client-ip: ${RECOMMEND_IP:}
eager: true
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/video_recommend?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
password: ${MYSQL_ROOT_PASSWORD:root123456}
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
max-lifetime: 58000
idle-timeout: 300000
connection-timeout: 20000
connection-test-query: SELECT 1
keepalive-time: 60000
validation-timeout: 3000
minimum-idle: 5
maximum-pool-size: 20
data:
redis:
password: ${REDIS_PASSWORD:redis_HA_Cluster_2024}
database: 4
timeout: 10000
sentinel:
master: mymaster
nodes: ${REDIS_SENTINEL_NODES:192.168.1.101:26379,192.168.1.102:26379,192.168.1.103:26379}
password: ${REDIS_PASSWORD:redis_HA_Cluster_2024}
lettuce:
pool:
max-active: 200
max-wait: -1
max-idle: 10
min-idle: 0
mybatis-plus:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.nuaa.video.recommend.entity
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
id-type: auto
logic-delete-field: is_deleted
logic-delete-value: 1
logic-not-delete-value: 0
recommend:
hot:
default-size: 20
refresh-interval: 60
weights:
view: 1
like: 3
favorite: 5
coin: 5
comment: 2
share: 3
similarity:
tag-weight: 0.5
category-weight: 0.3
behavior-weight: 0.2
personalized:
default-size: 30
behavior-weights:
view: 1
like: 3
favorite: 5
coin: 5
comment: 2
share: 3
complete-watch: 4
jwt:
secret: video-platform-secret-key-2024-nuaa-ha
expiration: 86400
token-header: Authorization
token-prefix: "Bearer "
auth:
ignore-urls:
- /recommend/hot/**
- /recommend/tag/**
- /actuator/**
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-details: always
feign:
client:
config:
default:
connectTimeout: 5000
readTimeout: 5000
circuitbreaker:
enabled: true
logging:
level:
com.nuaa.video: info
org.springframework.security: info