feat: 增加通知系统、RabbitMQ集成及Docker一键部署脚本
All checks were successful
test/timeline-server/pipeline/head This commit looks good
All checks were successful
test/timeline-server/pipeline/head This commit looks good
1. 新增通知中心功能,支持好友请求、评论、点赞等多种通知类型的持久化与推送 2. 集成 RabbitMQ 用于异步处理动态日志,解耦动态服务与日志记录逻辑 3. 提供完整的 Docker Compose 部署方案及一键启动/停止脚本(Shell/Bat) 4. 优化文件服务,增加图片上传时的自动压缩处理以节省存储空间 5. 增强动态服务,支持通过 shareId 公开访问动态项及关键词搜索功能 6. 完善代码健壮性,在关键业务 Service 层增加 @Transactional 事务控制
This commit is contained in:
151
deploy/README.md
Normal file
151
deploy/README.md
Normal file
@@ -0,0 +1,151 @@
|
||||
# 部署指南
|
||||
|
||||
本目录包含部署 Timeline 系统所需的所有脚本和配置文件。
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
deploy/
|
||||
├── conf/ # 配置文件目录
|
||||
│ ├── my.cnf # MySQL 配置 (开发环境)
|
||||
│ ├── my-container.cnf # MySQL 配置 (容器化环境)
|
||||
│ ├── redis.conf # Redis 配置 (开发环境)
|
||||
│ ├── redis-container.conf # Redis 配置 (容器化环境)
|
||||
│ └── minio-config/ # MinIO 配置目录
|
||||
├── docker-compose-all.yml # 统一部署文件 (包含所有服务)
|
||||
├── docker-compose.yml # Nacos 单独部署文件
|
||||
├── docker-compose-nacos-shared-db.yml # Nacos 共享数据库部署文件
|
||||
├── deploy-all.sh # Linux/macOS 统一部署脚本
|
||||
├── deploy-all.bat # Windows 统一部署脚本
|
||||
├── stop-all.sh # Linux/macOS 停止服务脚本
|
||||
├── stop-all.bat # Windows 停止服务脚本
|
||||
├── start-mysql.sh # 单独启动 MySQL
|
||||
├── start-minio.sh # 单独启动 MinIO
|
||||
└── start.sh # 单独启动 Redis
|
||||
```
|
||||
|
||||
## 部署选项
|
||||
|
||||
### 1. 完整部署 (推荐)
|
||||
|
||||
完整部署所有服务(MySQL、Redis、MinIO、Nacos 和所有微服务):
|
||||
|
||||
**Linux/macOS:**
|
||||
```bash
|
||||
./deploy-all.sh
|
||||
```
|
||||
|
||||
**Windows:**
|
||||
```cmd
|
||||
deploy-all.bat
|
||||
```
|
||||
|
||||
### 2. 使用共享数据库部署 Nacos
|
||||
|
||||
如果要使用共享数据库部署Nacos(与其它服务使用同一数据库):
|
||||
|
||||
```bash
|
||||
# 启动仅Nacos服务(使用共享数据库)
|
||||
docker-compose -f docker-compose-nacos-shared-db.yml up -d
|
||||
|
||||
# 或者使用项目根目录的部署文件
|
||||
docker-compose -f ../docker-compose-nacos-shared-db.yml up -d
|
||||
```
|
||||
|
||||
### 3. 单独部署 Nacos
|
||||
|
||||
如果只需要部署 Nacos 服务:
|
||||
|
||||
**Linux/macOS:**
|
||||
```bash
|
||||
docker compose -f docker-compose.yml up -d
|
||||
```
|
||||
|
||||
**Windows:**
|
||||
```cmd
|
||||
docker compose -f docker-compose.yml up -d
|
||||
```
|
||||
|
||||
### 4. 单独启动中间件
|
||||
|
||||
如果需要单独启动某个中间件服务:
|
||||
|
||||
**启动 MySQL:**
|
||||
```bash
|
||||
./start-mysql.sh
|
||||
```
|
||||
|
||||
**启动 MinIO:**
|
||||
```bash
|
||||
./start-minio.sh
|
||||
```
|
||||
|
||||
**启动 Redis:**
|
||||
```bash
|
||||
./start.sh
|
||||
```
|
||||
|
||||
## 停止服务
|
||||
|
||||
**Linux/macOS:**
|
||||
```bash
|
||||
./stop-all.sh
|
||||
```
|
||||
|
||||
**Windows:**
|
||||
```cmd
|
||||
stop-all.bat
|
||||
```
|
||||
|
||||
## 服务端口映射
|
||||
|
||||
| 服务 | 端口 | 访问地址 |
|
||||
|------|------|----------|
|
||||
| Nacos | 8848 | http://127.0.0.1:8848/nacos |
|
||||
| Gateway | 30000 | http://127.0.0.1:30000 |
|
||||
| Story Service | 30001 | http://127.0.0.1:30001 |
|
||||
| File Service | 30002 | http://127.0.0.1:30002 |
|
||||
| User Service | 30003 | http://127.0.0.1:30003 |
|
||||
| MySQL | 33306 | 127.0.0.1:33306 |
|
||||
| Redis | 36379 | 127.0.0.1:36379 |
|
||||
| MinIO | 9000 | http://127.0.0.1:9000 |
|
||||
| MinIO Console | 9090 | http://127.0.0.1:9090 |
|
||||
|
||||
## 默认凭据
|
||||
|
||||
| 服务 | 用户名 | 密码 |
|
||||
|------|--------|------|
|
||||
| Nacos | nacos | nacos |
|
||||
| MySQL Root | root | WoCloud@9ol7uj |
|
||||
| Redis | - | 123456 |
|
||||
| MinIO Root | minioadmin | WoCloud@9ol7uj |
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. 确保 Docker 和 Docker Compose 已安装并正在运行
|
||||
2. 确保有足够的系统资源(推荐至少 4GB 内存)
|
||||
3. 确保以下端口未被占用:8848, 30000-30003, 33306, 36379, 9000, 9090
|
||||
4. 首次启动需要等待约 1-2 分钟,等待所有服务完全启动
|
||||
5. 确保MySQL数据库服务器(59.80.22.43:33306)可访问,并且nacos_config数据库已创建
|
||||
|
||||
## 故障排除
|
||||
|
||||
### 服务启动失败
|
||||
- 检查端口是否被占用
|
||||
- 检查 Docker 是否有足够的资源
|
||||
- 查看服务日志:`docker compose -f docker-compose-all.yml logs <service_name>`
|
||||
|
||||
### Nacos 无法启动
|
||||
- 检查MySQL数据库连接:确认数据库服务器可访问,凭据正确,nacos_config数据库存在
|
||||
- 检查 [nacos-config/application.properties](file:///D:/workspaces/timeline-server/nacos-config/application.properties) 配置文件中的数据库连接设置
|
||||
|
||||
### Nacos 无法连接数据库
|
||||
- 确认 MySQL 服务已启动
|
||||
- 检查网络连接是否正常
|
||||
- 确认数据库凭据是否正确
|
||||
- 确认 nacos_config 数据库已创建
|
||||
|
||||
### 微服务无法注册到 Nacos
|
||||
- 确认 Nacos 服务已启动并正常运行
|
||||
- 检查服务间的网络连接
|
||||
- 确认服务配置中的 Nacos 地址是否正确
|
||||
154
deploy/conf/minio-config/config.json
Normal file
154
deploy/conf/minio-config/config.json
Normal file
@@ -0,0 +1,154 @@
|
||||
{
|
||||
"version": "29",
|
||||
"credential": {
|
||||
"accessKey": "minioadmin",
|
||||
"secretKey": "WoCloud@9ol7uj"
|
||||
},
|
||||
"region": "us-east-1",
|
||||
"browser": "on",
|
||||
"worm": "off",
|
||||
"storageclass": {
|
||||
"standard": "",
|
||||
"rrs": ""
|
||||
},
|
||||
"cache": {
|
||||
"drives": [],
|
||||
"expiry": 90,
|
||||
"maxuse": 80,
|
||||
"exclude": []
|
||||
},
|
||||
"kms": {
|
||||
"vault": {
|
||||
"endpoint": "",
|
||||
"auth": {
|
||||
"type": "",
|
||||
"approle": {
|
||||
"id": "",
|
||||
"secret": ""
|
||||
}
|
||||
},
|
||||
"tls": {
|
||||
"ciphers": [],
|
||||
"insecure": true,
|
||||
"certs": {
|
||||
"public": "",
|
||||
"private": "",
|
||||
"ca": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"kes": {
|
||||
"endpoint": "",
|
||||
"key-name": "",
|
||||
"certs": {
|
||||
"public": "",
|
||||
"private": "",
|
||||
"ca": ""
|
||||
},
|
||||
"tls": {
|
||||
"ciphers": [],
|
||||
"insecure": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"notify": {
|
||||
"amqp": {
|
||||
"1": {
|
||||
"enable": false,
|
||||
"url": "",
|
||||
"exchange": "",
|
||||
"routingKey": "",
|
||||
"exchangeType": "",
|
||||
"deliveryMode": 0,
|
||||
"mandatory": false,
|
||||
"immediate": false,
|
||||
"durable": false,
|
||||
"internal": false,
|
||||
"noWait": false,
|
||||
"autoDeleted": false
|
||||
}
|
||||
},
|
||||
"elasticsearch": {
|
||||
"1": {
|
||||
"enable": false,
|
||||
"format": "",
|
||||
"url": "",
|
||||
"index": ""
|
||||
}
|
||||
},
|
||||
"kafka": {
|
||||
"1": {
|
||||
"enable": false,
|
||||
"brokers": null,
|
||||
"topic": ""
|
||||
}
|
||||
},
|
||||
"mqtt": {
|
||||
"1": {
|
||||
"enable": false,
|
||||
"broker": "",
|
||||
"topic": "",
|
||||
"qos": 0,
|
||||
"clientId": "",
|
||||
"username": "",
|
||||
"password": "",
|
||||
"reconnectInterval": 0,
|
||||
"keepAliveInterval": 0
|
||||
}
|
||||
},
|
||||
"mysql": {
|
||||
"1": {
|
||||
"enable": false,
|
||||
"format": "",
|
||||
"dsnString": "",
|
||||
"table": "",
|
||||
"host": "",
|
||||
"port": "",
|
||||
"user": "",
|
||||
"password": "",
|
||||
"database": ""
|
||||
}
|
||||
},
|
||||
"nats": {
|
||||
"1": {
|
||||
"enable": false,
|
||||
"address": "",
|
||||
"subject": "",
|
||||
"username": "",
|
||||
"password": "",
|
||||
"token": "",
|
||||
"secure": false,
|
||||
"pingInterval": 0,
|
||||
"streaming": {
|
||||
"enable": false,
|
||||
"clusterID": "",
|
||||
"clientID": "",
|
||||
"async": false,
|
||||
"maxPubAcksInflight": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"postgresql": {
|
||||
"1": {
|
||||
"enable": false,
|
||||
"format": "",
|
||||
"connectionString": "",
|
||||
"table": "",
|
||||
"host": "",
|
||||
"port": 0,
|
||||
"user": "",
|
||||
"password": "",
|
||||
"database": ""
|
||||
}
|
||||
},
|
||||
"redis": {
|
||||
"1": {
|
||||
"enable": false,
|
||||
"format": "",
|
||||
"address": "",
|
||||
"password": "",
|
||||
"key": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
58
deploy/conf/my-container.cnf
Normal file
58
deploy/conf/my-container.cnf
Normal file
@@ -0,0 +1,58 @@
|
||||
[mysqld]
|
||||
# Basic settings for containerized environment
|
||||
port = 3306
|
||||
bind-address = 0.0.0.0
|
||||
server-id = 1
|
||||
|
||||
# Data directory
|
||||
datadir = /var/lib/mysql
|
||||
|
||||
# Character set
|
||||
character-set-server = utf8mb4
|
||||
collation-server = utf8mb4_unicode_ci
|
||||
|
||||
# Log settings
|
||||
log-error = /var/log/mysql/error.log
|
||||
slow-query-log = 1
|
||||
slow-query-log-file = /var/log/mysql/slow.log
|
||||
long_query_time = 2
|
||||
|
||||
# Connection settings
|
||||
max_connections = 200
|
||||
max_connect_errors = 6000
|
||||
open_files_limit = 65535
|
||||
|
||||
# InnoDB settings optimized for container
|
||||
default-storage-engine = innodb
|
||||
innodb_buffer_pool_size = 256M
|
||||
innodb_log_file_size = 64M
|
||||
innodb_log_buffer_size = 16M
|
||||
innodb_flush_log_at_trx_commit = 2
|
||||
innodb_lock_wait_timeout = 50
|
||||
|
||||
# Security
|
||||
skip-name-resolve
|
||||
|
||||
# Binary log (for replication)
|
||||
log-bin = mysql-bin
|
||||
binlog-format = ROW
|
||||
expire_logs_days = 7
|
||||
|
||||
# Performance settings for container
|
||||
query_cache_size = 32M
|
||||
query_cache_type = 1
|
||||
tmp_table_size = 64M
|
||||
max_heap_table_size = 64M
|
||||
|
||||
# Timeout settings
|
||||
interactive_timeout = 60
|
||||
wait_timeout = 60
|
||||
net_read_timeout = 30
|
||||
net_write_timeout = 60
|
||||
|
||||
# Network settings
|
||||
max_allowed_packet = 64M
|
||||
|
||||
# Container specific settings
|
||||
# Reduce memory usage for container environment
|
||||
innodb_buffer_pool_instances = 1
|
||||
45
deploy/conf/my.cnf
Normal file
45
deploy/conf/my.cnf
Normal file
@@ -0,0 +1,45 @@
|
||||
[mysqld]
|
||||
# Basic settings
|
||||
port = 33306
|
||||
bind-address = 0.0.0.0
|
||||
server-id = 1
|
||||
|
||||
# Data directory
|
||||
datadir = /var/lib/mysql
|
||||
|
||||
# Character set
|
||||
character-set-server = utf8mb4
|
||||
collation-server = utf8mb4_unicode_ci
|
||||
|
||||
# Log settings
|
||||
log-error = /var/log/mysql/error.log
|
||||
slow-query-log = 1
|
||||
slow-query-log-file = /var/log/mysql/slow.log
|
||||
long_query_time = 2
|
||||
|
||||
# Connection settings
|
||||
max_connections = 200
|
||||
max_connect_errors = 6000
|
||||
open_files_limit = 65535
|
||||
|
||||
# InnoDB settings
|
||||
default-storage-engine = innodb
|
||||
innodb_buffer_pool_size = 1G
|
||||
innodb_log_file_size = 256M
|
||||
innodb_log_buffer_size = 64M
|
||||
innodb_flush_log_at_trx_commit = 2
|
||||
innodb_lock_wait_timeout = 50
|
||||
|
||||
# Security
|
||||
skip-name-resolve
|
||||
|
||||
# Binary log (for replication)
|
||||
log-bin = mysql-bin
|
||||
binlog-format = ROW
|
||||
expire_logs_days = 7
|
||||
|
||||
# Performance settings
|
||||
query_cache_size = 64M
|
||||
query_cache_type = 1
|
||||
tmp_table_size = 256M
|
||||
max_heap_table_size = 256M
|
||||
233
deploy/conf/nacos-config/application.properties
Normal file
233
deploy/conf/nacos-config/application.properties
Normal file
@@ -0,0 +1,233 @@
|
||||
# spring
|
||||
server.servlet.contextPath=/nacos
|
||||
server.error.include-message=ALWAYS
|
||||
server.error.include-binding-errors=ALWAYS
|
||||
spring.autoconfigure.exclude=org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration
|
||||
spring.application.name=nacos-server
|
||||
logging.config=classpath:org/springframework/boot/logging/logback/no-xml-config.xml
|
||||
logging.exception-conversion-word=%wEx
|
||||
logging.level.org.springframework.web=DEBUG
|
||||
logging.level.org.springframework.transaction=DEBUG
|
||||
logging.level.org.springframework.transaction.interceptor=DEBUG
|
||||
logging.level.org.springframework.jdbc=DEBUG
|
||||
logging.level.org.springframework.jdbc.core.JdbcTemplate=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.datasource=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.auth=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.env=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.distributed=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.namespace=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.listener=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.remote=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.routing=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.service=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.sys=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.trace=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.utils=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.auth.ldap=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.auth.ram=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.log=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.lookup=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.remote=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.RAFT=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.HASH=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC.SNAPSHOT=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC.SNAPSHOT.SNAPSHOT=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC.SNAPSHOT.SNAPSHOT.SNAPSHOT=DEBUG
|
||||
logging.level.com.alibaba.nacos.core.cluster.server.member.CM.DISTRO.LITE.SYNC.SNAPSHOT.SNAPSHOT.SNAPSHOT.SNAPSHOT=DEBUG
|
||||
|
||||
# nacos
|
||||
nacos.core.auth.system.type=nacos
|
||||
nacos.core.auth.enabled=false
|
||||
nacos.core.auth.caching.enabled=true
|
||||
nacos.core.auth.enable.userAgentAuthWhite=false
|
||||
nacos.core.auth.server.identity.key=nacos
|
||||
nacos.core.auth.server.identity.value=nacos
|
||||
nacos.core.auth.plugin.nacos.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||
nacos.core.auth.plugin.nacos.token.expire.seconds=18000
|
||||
nacos.core.sampling.enabled=true
|
||||
nacos.core.sampling.probability=0.01
|
||||
nacos.core.metrics.enabled=true
|
||||
nacos.core.metrics.dump.enabled=true
|
||||
nacos.core.metrics.dump.period=600
|
||||
nacos.core.metrics.storage=prometheus
|
||||
nacos.core.metrics.log.file=/home/nacos/logs/metrics.log
|
||||
nacos.core.metrics.log.period=60
|
||||
nacos.core.cluster.lookup.type=address-server
|
||||
nacos.core.cluster.address-server.url=https://nacos.io
|
||||
nacos.core.cluster.address-server.endpoint=address-server.nacos.io
|
||||
nacos.core.cluster.address-server.namespace=public
|
||||
nacos.core.cluster.address-server.tenant=public
|
||||
nacos.core.cluster.address-server.is.auth.enabled=false
|
||||
nacos.core.cluster.address-server.username=nacos
|
||||
nacos.core.cluster.address-server.password=nacos
|
||||
nacos.core.cluster.address-server.access.key=
|
||||
nacos.core.cluster.address-server.secret.key=
|
||||
nacos.core.cluster.member.list=
|
||||
nacos.core.env=standalone
|
||||
nacos.core.insert.default.kv=on
|
||||
nacos.core.loadconfig.enable=true
|
||||
nacos.core.loadconfig.retrytime=2
|
||||
nacos.core.loadconfig.retrysleepmillis=1000
|
||||
nacos.core.notify.retrytimes=5
|
||||
nacos.core.notify.retrydelaymillis=1000
|
||||
nacos.core.notify.maxbatchsize=5000
|
||||
nacos.core.notify.maxqueuesize=20000
|
||||
nacos.core.notify.retryqueuecount=2
|
||||
nacos.core.notify.timeout=5000
|
||||
nacos.core.notify.log.enabled=true
|
||||
nacos.core.notify.connection.timeout=2000
|
||||
nacos.core.notify.socket.timeout=60000
|
||||
nacos.core.notify.threads=20
|
||||
nacos.core.notify.thread.keepalive=60
|
||||
nacos.core.notify.request.failed.retrytimes=3
|
||||
nacos.core.notify.distro.protocol=raft
|
||||
nacos.core.notify.distrolist.sync.retrytimes=3
|
||||
nacos.core.notify.distrolist.sync.timeout=5000
|
||||
nacos.core.notify.distrolist.sync.threads=20
|
||||
nacos.core.notify.distrolist.sync.thread.keepalive=60
|
||||
nacos.core.notify.distrolist.sync.maxqueuesize=20000
|
||||
nacos.core.notify.distrolist.sync.retryqueuecount=2
|
||||
nacos.core.notify.distrolist.sync.log.enabled=true
|
||||
nacos.core.notify.distrolist.sync.timeout=5000
|
||||
nacos.core.notify.distrolist.sync.connection.timeout=2000
|
||||
nacos.core.notify.distrolist.sync.socket.timeout=60000
|
||||
nacos.core.notify.distrolist.sync.threads=20
|
||||
nacos.core.notify.distrolist.sync.thread.keepalive=60
|
||||
nacos.core.notify.distrolist.sync.maxqueuesize=20000
|
||||
nacos.core.notify.distrolist.sync.retryqueuecount=2
|
||||
nacos.core.notify.distrolist.sync.log.enabled=true
|
||||
nacos.core.notify.distrolist.sync.timeout=5000
|
||||
nacos.core.notify.distrolist.sync.connection.timeout=2000
|
||||
nacos.core.notify.distrolist.sync.socket.timeout=60000
|
||||
nacos.core.notify.distrolist.sync.threads=20
|
||||
nacos.core.notify.distrolist.sync.thread.keepalive=60
|
||||
nacos.core.notify.distrolist.sync.maxqueuesize=20000
|
||||
nacos.core.notify.distrolist.sync.retryqueuecount=2
|
||||
nacos.core.notify.distrolist.sync.log.enabled=true
|
||||
|
||||
# naming
|
||||
nacos.naming.distro.taskDispatchThreadCount=20
|
||||
nacos.naming.distro.taskDispatchPeriod=200
|
||||
nacos.naming.distro.batchSyncKeyCount=1000
|
||||
nacos.naming.distro.initDataOnly=false
|
||||
nacos.naming.distro.syncRetryDelay=5000
|
||||
nacos.naming.redo.delay=1000
|
||||
nacos.naming.redo.expired=60000
|
||||
nacos.naming.redo.retries=3
|
||||
nacos.naming.cache.concurrent.size=64
|
||||
nacos.naming.cache.expired.time=10000
|
||||
nacos.naming.cache.updateTaskInterval=1000
|
||||
nacos.naming.log.fileName=alipay-jraft.log
|
||||
nacos.naming.log.level=warn
|
||||
nacos.naming.data.warmup=true
|
||||
nacos.naming.empty.service.autoClean=true
|
||||
nacos.naming.empty.service.clean.initial.delay.ms=50000
|
||||
nacos.naming.empty.service.clean.period.time.ms=30000
|
||||
nacos.naming.push.empty.protect=true
|
||||
nacos.naming.push.max.application=6000
|
||||
nacos.naming.push.max.payload.bytes=1048576
|
||||
nacos.naming.push.max.qps=20000
|
||||
nacos.naming.push.dump.qps=10000
|
||||
nacos.naming.push.health.check.fail.timeout=3000
|
||||
nacos.naming.push.verify.enabled=false
|
||||
nacos.naming.health.push.status.check.enabled=true
|
||||
nacos.naming.health.push.status.check.time.delay=5000
|
||||
nacos.naming.push.connection.max.hold.time=300000
|
||||
nacos.naming.service.batch.register.thread.count=1
|
||||
nacos.naming.service.batch.register.thread.work.queue.size=10000
|
||||
nacos.naming.service.batch.register.enabled=false
|
||||
nacos.naming.service.batch.register.interval=1000
|
||||
nacos.naming.service.batch.register.batch.size=1000
|
||||
nacos.naming.service.batch.register.delay=1000
|
||||
nacos.naming.service.batch.register.timeout=30000
|
||||
nacos.naming.service.batch.register.retry.times=3
|
||||
nacos.naming.service.batch.register.retry.delay=1000
|
||||
nacos.naming.service.batch.register.retry.max.delay=5000
|
||||
nacos.naming.service.batch.register.retry.backoff=1.5
|
||||
nacos.naming.service.batch.register.retry.max.attempts=5
|
||||
nacos.naming.service.batch.register.retry.max.delay=30000
|
||||
nacos.naming.service.batch.register.retry.backoff=2.0
|
||||
nacos.naming.service.batch.register.retry.max.attempts=10
|
||||
nacos.naming.service.batch.register.retry.max.delay=60000
|
||||
nacos.naming.service.batch.register.retry.backoff=2.0
|
||||
|
||||
# config
|
||||
nacos.config.log.level=warn
|
||||
nacos.config.dumpTask.delay=30
|
||||
nacos.config.dumpTask.period=300
|
||||
nacos.config.syncTask.timeout=30
|
||||
nacos.config.syncTask.retryTimes=3
|
||||
nacos.config.syncTask.retryDelay=1000
|
||||
nacos.config.notifyTask.timeout=30
|
||||
nacos.config.notifyTask.retryTimes=3
|
||||
nacos.config.notifyTask.retryDelay=1000
|
||||
nacos.config.notifyTask.threadCount=2
|
||||
nacos.config.notifyTask.maxQueueSize=10000
|
||||
nacos.config.notifyTask.log.enabled=true
|
||||
nacos.config.notifyTask.timeout=5000
|
||||
nacos.config.notifyTask.connection.timeout=2000
|
||||
nacos.config.notifyTask.socket.timeout=60000
|
||||
nacos.config.notifyTask.threads=20
|
||||
nacos.config.notifyTask.thread.keepalive=60
|
||||
nacos.config.notifyTask.maxqueuesize=20000
|
||||
nacos.config.notifyTask.retryqueuecount=2
|
||||
nacos.config.notifyTask.log.enabled=true
|
||||
|
||||
# console
|
||||
nacos.core.console.enableYaml=false
|
||||
nacos.core.console.system.defender.enabled=false
|
||||
nacos.core.console.system.defender.rate.limiting.threshold=100
|
||||
nacos.core.console.system.defender.rate.limiting.duration=1
|
||||
nacos.core.console.system.defender.rate.limiting.enabled=false
|
||||
nacos.core.console.system.defender.rate.limiting.window=60
|
||||
nacos.core.console.system.defender.rate.limiting.max=100
|
||||
nacos.core.console.system.defender.rate.limiting.min=10
|
||||
nacos.core.console.system.defender.rate.limiting.factor=1.0
|
||||
nacos.core.console.system.defender.rate.limiting.strategy=fixed
|
||||
nacos.core.console.system.defender.rate.limiting.algorithm=token-bucket
|
||||
nacos.core.console.system.defender.rate.limiting.mode=local
|
||||
nacos.core.console.system.defender.rate.limiting.scope=global
|
||||
nacos.core.console.system.defender.rate.limiting.key=ip
|
||||
nacos.core.console.system.defender.rate.limiting.enabled=false
|
||||
|
||||
# datasource
|
||||
nacos.datasource.platform=mysql
|
||||
nacos.datasource.db.num=1
|
||||
nacos.datasource.db.url.0=jdbc:mysql://59.80.22.43:33306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
|
||||
nacos.datasource.db.user=root
|
||||
nacos.datasource.db.password=WoCloud@9ol7uj
|
||||
nacos.datasource.db.pool.config.connectionTimeout=30000
|
||||
nacos.datasource.db.pool.config.validationTimeout=10000
|
||||
nacos.datasource.db.pool.config.maximumPoolSize=20
|
||||
nacos.datasource.db.pool.config.minimumIdle=2
|
||||
nacos.datasource.db.pool.config.maxWait=3000
|
||||
nacos.datasource.db.pool.config.timeBetweenEvictionRunsMillis=60000
|
||||
nacos.datasource.db.pool.config.minEvictableIdleTimeMillis=300000
|
||||
nacos.datasource.db.pool.config.testWhileIdle=true
|
||||
nacos.datasource.db.pool.config.testOnBorrow=true
|
||||
nacos.datasource.db.pool.config.testOnReturn=false
|
||||
nacos.datasource.db.pool.config.poolName=HikariCP
|
||||
nacos.datasource.db.pool.config.connectionTestQuery=SELECT 1
|
||||
nacos.datasource.db.pool.config.allowPoolSuspension=false
|
||||
nacos.datasource.db.pool.config.autoCommit=true
|
||||
nacos.datasource.db.pool.config.idleTimeout=600000
|
||||
nacos.datasource.db.pool.config.jdbc4ConnectionTest=true
|
||||
nacos.datasource.db.pool.config.useStatementFinalizer=true
|
||||
nacos.datasource.db.pool.config.leakDetectionThreshold=60000
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.cachePrepStmts=true
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.prepStmtCacheSize=250
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.prepStmtCacheSqlLimit=2048
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.useServerPrepStmts=true
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.useLocalSessionState=true
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.rewriteBatchedStatements=true
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.cacheResultSetMetadata=true
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.cacheServerConfiguration=true
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.elideSetters=true
|
||||
nacos.datasource.db.pool.config.dataSourceProperties.maintainTimeStats=false
|
||||
52
deploy/conf/redis-container.conf
Normal file
52
deploy/conf/redis-container.conf
Normal file
@@ -0,0 +1,52 @@
|
||||
# Redis configuration for containerized environment
|
||||
bind 0.0.0.0
|
||||
protected-mode yes
|
||||
port 6379
|
||||
timeout 0
|
||||
tcp-keepalive 300
|
||||
daemonize no
|
||||
pidfile /var/run/redis.pid
|
||||
loglevel notice
|
||||
logfile /var/log/redis/redis-server.log
|
||||
databases 16
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
stop-writes-on-bgsave-error yes
|
||||
rdbcompression yes
|
||||
rdbchecksum yes
|
||||
dbfilename dump.rdb
|
||||
dir /data
|
||||
requirepass 123456
|
||||
masterauth 123456
|
||||
maxmemory 2gb
|
||||
maxmemory-policy allkeys-lru
|
||||
appendonly yes
|
||||
appendfilename "appendonly.aof"
|
||||
appendfsync everysec
|
||||
no-appendfsync-on-rewrite no
|
||||
auto-aof-rewrite-percentage 100
|
||||
auto-aof-rewrite-min-size 64mb
|
||||
lua-time-limit 5000
|
||||
cluster-enabled no
|
||||
cluster-config-file nodes.conf
|
||||
cluster-node-timeout 15000
|
||||
slowlog-log-slower-than 10000
|
||||
slowlog-max-len 128
|
||||
hash-max-ziplist-entries 512
|
||||
hash-max-ziplist-value 64
|
||||
list-max-ziplist-entries 512
|
||||
list-max-ziplist-value 64
|
||||
set-max-intset-entries 512
|
||||
zset-max-ziplist-entries 128
|
||||
zset-max-ziplist-value 64
|
||||
activerehashing yes
|
||||
client-output-buffer-limit normal 0 0 0
|
||||
client-output-buffer-limit slave 256mb 64mb 60
|
||||
client-output-buffer-limit pubsub 32mb 8mb 60
|
||||
hz 10
|
||||
aof-rewrite-incremental-fsync yes
|
||||
|
||||
# Container specific settings
|
||||
# Allow more clients for containerized environment
|
||||
maxclients 10000
|
||||
48
deploy/conf/redis.conf
Normal file
48
deploy/conf/redis.conf
Normal file
@@ -0,0 +1,48 @@
|
||||
# Redis configuration
|
||||
bind 0.0.0.0
|
||||
protected-mode yes
|
||||
port 6379
|
||||
timeout 0
|
||||
tcp-keepalive 300
|
||||
daemonize no
|
||||
pidfile /var/run/redis.pid
|
||||
loglevel notice
|
||||
logfile /var/log/redis/redis-server.log
|
||||
databases 16
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
stop-writes-on-bgsave-error yes
|
||||
rdbcompression yes
|
||||
rdbchecksum yes
|
||||
dbfilename dump.rdb
|
||||
dir /data
|
||||
requirepass 123456
|
||||
masterauth 123456
|
||||
maxmemory 2gb
|
||||
maxmemory-policy allkeys-lru
|
||||
appendonly yes
|
||||
appendfilename "appendonly.aof"
|
||||
appendfsync everysec
|
||||
no-appendfsync-on-rewrite no
|
||||
auto-aof-rewrite-percentage 100
|
||||
auto-aof-rewrite-min-size 64mb
|
||||
lua-time-limit 5000
|
||||
cluster-enabled no
|
||||
cluster-config-file nodes.conf
|
||||
cluster-node-timeout 15000
|
||||
slowlog-log-slower-than 10000
|
||||
slowlog-max-len 128
|
||||
hash-max-ziplist-entries 512
|
||||
hash-max-ziplist-value 64
|
||||
list-max-ziplist-entries 512
|
||||
list-max-ziplist-value 64
|
||||
set-max-intset-entries 512
|
||||
zset-max-ziplist-entries 128
|
||||
zset-max-ziplist-value 64
|
||||
activerehashing yes
|
||||
client-output-buffer-limit normal 0 0 0
|
||||
client-output-buffer-limit slave 256mb 64mb 60
|
||||
client-output-buffer-limit pubsub 32mb 8mb 60
|
||||
hz 10
|
||||
aof-rewrite-incremental-fsync yes
|
||||
50
deploy/deploy-all.bat
Normal file
50
deploy/deploy-all.bat
Normal file
@@ -0,0 +1,50 @@
|
||||
@echo off
|
||||
echo ===========================================
|
||||
echo Starting Timeline System with All Services
|
||||
echo ===========================================
|
||||
|
||||
REM 检查 Docker 是否运行
|
||||
docker version >nul 2>&1
|
||||
if %errorlevel% neq 0 (
|
||||
echo 错误: 未找到 Docker 或 Docker 未运行,请先启动 Docker
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM 检查 Docker Compose 是否可用
|
||||
docker compose version >nul 2>&1
|
||||
if %errorlevel% neq 0 (
|
||||
echo 错误: 未找到 Docker Compose,请先安装 Docker Compose
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo 构建项目...
|
||||
call mvn clean package -DskipTests
|
||||
|
||||
if errorlevel 1 (
|
||||
echo 构建失败!
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo 启动所有服务...
|
||||
docker compose -f docker-compose-all.yml up -d
|
||||
|
||||
echo 等待服务启动...
|
||||
timeout /t 60 /nobreak
|
||||
|
||||
echo 检查服务状态...
|
||||
docker compose -f docker-compose-all.yml ps
|
||||
|
||||
echo ===========================================
|
||||
echo 部署完成!服务访问地址:
|
||||
echo - Nacos: http://127.0.0.1:8848/nacos (用户名: nacos, 密码: nacos)
|
||||
echo - Gateway: http://127.0.0.1:30000
|
||||
echo - Story Service: http://127.0.0.1:30001
|
||||
echo - File Service: http://127.0.0.1:30002
|
||||
echo - User Service: http://127.0.0.1:30003
|
||||
echo - MySQL: http://127.0.0.1:33306
|
||||
echo - Redis: http://127.0.0.1:36379
|
||||
echo - MinIO: http://127.0.0.1:9000 (控制台: http://127.0.0.1:9090)
|
||||
echo ===========================================
|
||||
|
||||
pause
|
||||
46
deploy/deploy-all.sh
Normal file
46
deploy/deploy-all.sh
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "==========================================="
|
||||
echo "Starting Timeline System with All Services"
|
||||
echo "==========================================="
|
||||
|
||||
# 检查 Docker 是否运行
|
||||
if ! docker version > /dev/null 2>&1; then
|
||||
echo "错误: 未找到 Docker 或 Docker 未运行,请先启动 Docker"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 检查 Docker Compose 是否可用
|
||||
if ! docker compose version > /dev/null 2>&1; then
|
||||
echo "错误: 未找到 Docker Compose,请先安装 Docker Compose"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "构建项目..."
|
||||
mvn clean package -DskipTests
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "构建失败!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "启动所有服务..."
|
||||
docker compose -f docker-compose-all.yml up -d
|
||||
|
||||
echo "等待服务启动..."
|
||||
sleep 60
|
||||
|
||||
echo "检查服务状态..."
|
||||
docker compose -f docker-compose-all.yml ps
|
||||
|
||||
echo "==========================================="
|
||||
echo "部署完成!服务访问地址:"
|
||||
echo "- Nacos: http://127.0.0.1:8848/nacos (用户名: nacos, 密码: nacos)"
|
||||
echo "- Gateway: http://127.0.0.1:30000"
|
||||
echo "- Story Service: http://127.0.0.1:30001"
|
||||
echo "- File Service: http://127.0.0.1:30002"
|
||||
echo "- User Service: http://127.0.0.1:30003"
|
||||
echo "- MySQL: http://127.0.0.1:33306"
|
||||
echo "- Redis: http://127.0.0.1:36379"
|
||||
echo "- MinIO: http://127.0.0.1:9000 (控制台: http://127.0.0.1:9090)"
|
||||
echo "==========================================="
|
||||
101
deploy/docker-compose-all.yml
Normal file
101
deploy/docker-compose-all.yml
Normal file
@@ -0,0 +1,101 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0.31
|
||||
container_name: timeline-mysql
|
||||
ports:
|
||||
- "33306:33306"
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: WoCloud@9ol7uj
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
- mysql_log:/var/log/mysql
|
||||
- ./conf/my-container.cnf:/etc/mysql/my.cnf
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||
timeout: 20s
|
||||
retries: 10
|
||||
start_period: 40s
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: timeline-redis
|
||||
ports:
|
||||
- "36379:6379"
|
||||
command: redis-server --requirepass 123456
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
- ./conf/redis-container.conf:/etc/redis/redis.conf
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
|
||||
minio:
|
||||
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
|
||||
container_name: timeline-minio
|
||||
ports:
|
||||
- "9000:9000"
|
||||
- "9090:9090"
|
||||
environment:
|
||||
MINIO_ROOT_USER: minioadmin
|
||||
MINIO_ROOT_PASSWORD: WoCloud@9ol7uj
|
||||
volumes:
|
||||
- minio_data:/data
|
||||
- ./conf/minio-config:/root/.minio
|
||||
command: server /data --console-address ":9090" --address ":9000"
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||||
interval: 30s
|
||||
timeout: 20s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
nacos:
|
||||
image: nacos/nacos-server:v2.3.0
|
||||
container_name: nacos-server
|
||||
environment:
|
||||
- MODE=standalone
|
||||
- SPRING_DATASOURCE_PLATFORM=mysql
|
||||
- MYSQL_SERVICE_HOST=timeline-mysql # 修正:使用正确的容器名
|
||||
- MYSQL_SERVICE_PORT=3306
|
||||
- MYSQL_SERVICE_DB_NAME=nacos_config
|
||||
- MYSQL_SERVICE_USER=root
|
||||
- MYSQL_SERVICE_PASSWORD=WoCloud@9ol7uj
|
||||
- NACOS_SERVER_IP=127.0.0.1
|
||||
- PREFER_HOST_MODE=hostname
|
||||
- JVM_XMS=512m
|
||||
- JVM_XMX=512m
|
||||
- JVM_XMN=256m
|
||||
- SERVER_PORT=8848
|
||||
volumes:
|
||||
- ../nacos-config/application.properties:/home/nacos/conf/application.properties
|
||||
- ../nacos-config/init.d:/home/nacos/init.d
|
||||
- nacos_logs:/home/nacos/logs
|
||||
- nacos_data:/home/nacos/data
|
||||
ports:
|
||||
- "8848:8848"
|
||||
- "9848:9848"
|
||||
restart: always
|
||||
depends_on:
|
||||
- mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8848/nacos/v1/ns/operator/metrics"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
mysql_log:
|
||||
redis_data:
|
||||
minio_data:
|
||||
nacos_logs:
|
||||
nacos_data:
|
||||
28
deploy/docker-compose.yaml
Normal file
28
deploy/docker-compose.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
services:
|
||||
server:
|
||||
image: docker.gitea.com/gitea:nightly
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
- GITEA__database__DB_TYPE=mysql
|
||||
- GITEA__database__HOST=59.80.22.43:33306
|
||||
- GITEA__database__NAME=gitea
|
||||
- GITEA__database__USER=gitea
|
||||
- GITEA__database__PASSWD=your-password
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "30000:3000"
|
||||
- "32222:22"
|
||||
29
deploy/docker-compose.yml
Normal file
29
deploy/docker-compose.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
nacos:
|
||||
image: nacos/nacos-server:v2.3.0
|
||||
container_name: nacos-standalone
|
||||
environment:
|
||||
- MODE=standalone
|
||||
- SPRING_DATASOURCE_PLATFORM=mysql
|
||||
- MYSQL_SERVICE_HOST=localhost
|
||||
- MYSQL_SERVICE_PORT=33306
|
||||
- MYSQL_SERVICE_DB_NAME=nacos_config
|
||||
- MYSQL_SERVICE_USER=root
|
||||
- MYSQL_SERVICE_PASSWORD=WoCloud@9ol7uj
|
||||
- NACOS_SERVER_IP=127.0.0.1
|
||||
volumes:
|
||||
- ../nacos-config/application.properties:/home/nacos/conf/application.properties
|
||||
- nacos_logs:/home/nacos/logs
|
||||
- nacos_data:/home/nacos/data
|
||||
ports:
|
||||
- "8848:8848"
|
||||
- "9848:9848"
|
||||
- "9888:9888"
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8848/nacos/v1/ns/operator/metrics"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
3
deploy/env-prod.conf
Normal file
3
deploy/env-prod.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
# 环境变量配置文件 - 生产环境
|
||||
# Nacos服务器地址 - 生产环境
|
||||
export NACOS_SERVER_ADDR=nacos-server:8848
|
||||
10
deploy/start-minio.sh
Normal file
10
deploy/start-minio.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
docker run \
|
||||
--name minio \
|
||||
-p 9000:9000 \
|
||||
-p 9090:9090 \
|
||||
-d \
|
||||
-e "MINIO_ROOT_USER=minioadmin" \
|
||||
-e "MINIO_ROOT_PASSWORD=WoCloud@9ol7uj" \
|
||||
-v /mnt/sdc/workspace/minio-data:/data \
|
||||
-v /usr/local/minio-config:/root/.minio \
|
||||
minio/minio:RELEASE.2025-04-22T22-12-26Z server /data --console-address ":9090" --address ":9000"
|
||||
9
deploy/start-mysql.sh
Normal file
9
deploy/start-mysql.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
docker run -p 33306:3306 \
|
||||
--restart=always \
|
||||
--name mysql \
|
||||
--privileged=true \
|
||||
-v /mnt/sdc/workspace/mysql/log:/var/log/mysql \
|
||||
-v /mnt/sdc/workspace/mysql/data:/var/lib/mysql \
|
||||
-v /mnt/sdc/workspace/mysql/conf/my.cnf:/etc/mysql/my.cnf \
|
||||
-e MYSQL_ROOT_PASSWORD=WoCloud@9ol7uj \
|
||||
-d mysql:8.0.31
|
||||
10
deploy/start.sh
Normal file
10
deploy/start.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
docker run -d \
|
||||
--name redis \
|
||||
-p 36379:6379 \
|
||||
-v ./conf/redis.conf:/etc/redis/redis.conf \
|
||||
-v ./data:/data \
|
||||
--restart=always \
|
||||
redis:latest \
|
||||
redis-server /etc/redis/redis.conf \
|
||||
--appendonly yes \
|
||||
--requirepass 123456
|
||||
20
deploy/stop-all.bat
Normal file
20
deploy/stop-all.bat
Normal file
@@ -0,0 +1,20 @@
|
||||
@echo off
|
||||
echo ===========================================
|
||||
echo Stopping Timeline System
|
||||
echo ===========================================
|
||||
|
||||
REM 检查 Docker 是否运行
|
||||
docker version >nul 2>&1
|
||||
if %errorlevel% neq 0 (
|
||||
echo 错误: 未找到 Docker 或 Docker 未运行
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo 停止所有服务...
|
||||
docker compose -f docker-compose-all.yml down
|
||||
|
||||
echo ===========================================
|
||||
echo 所有服务已停止
|
||||
echo ===========================================
|
||||
|
||||
pause
|
||||
18
deploy/stop-all.sh
Normal file
18
deploy/stop-all.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "==========================================="
|
||||
echo "Stopping Timeline System"
|
||||
echo "==========================================="
|
||||
|
||||
# 检查 Docker 是否运行
|
||||
if ! docker version > /dev/null 2>&1; then
|
||||
echo "错误: 未找到 Docker 或 Docker 未运行"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "停止所有服务..."
|
||||
docker compose -f docker-compose-all.yml down
|
||||
|
||||
echo "==========================================="
|
||||
echo "所有服务已停止"
|
||||
echo "==========================================="
|
||||
Reference in New Issue
Block a user