完善生产Redis双中心架构文档
This commit is contained in:
@@ -1309,3 +1309,11 @@ rtk node -e "const fs=require('fs');const path=require('path');let n=0;function
|
||||
- 已完成:已备份并修复 `mysql02` 运行时 3306 规则顺序,写回 `/etc/sysconfig/iptables`;`codex-iptables-restore.service` 为 enabled。
|
||||
- 已验证:三台 Core、三台 Nacos、三台 MessageHub 到 `mysql02:3306` 均连通;Core 3/3、Nacos 3/3、MessageHub 3/3 均恢复健康;公网健康检查和店铺列表接口均返回 HTTP 200。
|
||||
- 当前注意:`mysql01` 和 `mysql03` 复制 IO/SQL 线程均为 `Yes`,但仍在追历史延迟;后续巡检需要继续观察复制延迟归零。
|
||||
|
||||
## 2026-08-24 生产 Redis Sentinel 双中心当前状态
|
||||
|
||||
- 已完成:中心1 `prod-redis01-03` 和中心2 `prod-redis04` 已形成 Redis 1 Master + 3 Slave;阿里云 newapi 节点 `10.66.0.4` 仅作为 Sentinel 仲裁。
|
||||
- 已完成:中心2新节点已从 DHCP `192.168.20.206` 固定为 `192.168.20.13/24`,主机名为 `prod-redis04`,默认网关为 `192.168.20.1`。
|
||||
- 当前可验证状态:`prod-redis01 / 192.168.10.17` 为 Master,Master 显示 `connected_slaves=3`;`prod-redis02`、`prod-redis03`、`prod-redis04` 均显示 `master_link_status:up`。
|
||||
- Sentinel 状态:`192.168.10.17:26379`、`192.168.10.18:26379`、`192.168.10.19:26379`、`192.168.20.13:26379`、`10.66.0.4:26379` 均可用,`ckquorum mymaster` 返回 5 usable Sentinels。
|
||||
- 后续关注:应用侧 Redis Sentinel 配置如需切换到新集群,应单独安排 Nacos 配置变更窗口,先脱敏回读当前 `middleware.yaml`,再更新 Sentinel 列表并滚动验证 Core/Gateway。
|
||||
|
||||
+8
-4
@@ -80,13 +80,17 @@ Gateway systemd 服务名为 `jayu-cloud-gateway`,默认远端目录为 `/opt/
|
||||
|
||||
## Redis
|
||||
|
||||
Redis 使用 Sentinel,生产 master 名称为 `mymaster`。主从角色会随故障转移变化,操作前以 Sentinel 查询结果为准。
|
||||
Redis 使用 Sentinel,生产 master 名称为 `mymaster`。当前为 1 Master + 3 Slave + 5 Sentinel 的双中心高可用架构;主从角色会随故障转移变化,操作前以 Sentinel 查询结果为准。
|
||||
|
||||
| 节点 | IP | 中心 | 端口 | 角色 | 校验命令 | 凭据条目 |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| redis01 | `192.168.5.104` | 中心1 | `6379,26379` | Redis 数据节点 + Sentinel | `SENTINEL get-master-addr-by-name mymaster` | `redis:redis01` |
|
||||
| redis02 | `192.168.5.105` | 中心1 | `6379,26379` | Redis 数据节点 + Sentinel | `SENTINEL get-master-addr-by-name mymaster` | `redis:redis02` |
|
||||
| redis03 | `192.168.10.176` | 中心2 | `6379,26379` | Redis 数据节点 + Sentinel / 中心2降级节点 | `SENTINEL get-master-addr-by-name mymaster` | `redis:redis03` |
|
||||
| prod-redis01 | `192.168.10.17` | 中心1 | `6379,26379` | Redis 数据节点 + Sentinel;当前 Master | `SENTINEL get-master-addr-by-name mymaster`、`INFO replication` | `redis:prod-redis01` |
|
||||
| prod-redis02 | `192.168.10.18` | 中心1 | `6379,26379` | Redis 数据节点 + Sentinel;当前 Slave | `SENTINEL get-master-addr-by-name mymaster`、`INFO replication` | `redis:prod-redis02` |
|
||||
| prod-redis03 | `192.168.10.19` | 中心1 | `6379,26379` | Redis 数据节点 + Sentinel;当前 Slave | `SENTINEL get-master-addr-by-name mymaster`、`INFO replication` | `redis:prod-redis03` |
|
||||
| prod-redis04 | `192.168.20.13` | 中心2 | `6379,26379` | Redis 数据节点 + Sentinel;当前异地 Slave,`replica-priority=200` | `SENTINEL get-master-addr-by-name mymaster`、`INFO replication` | `redis:prod-redis04` |
|
||||
| aliyun-newapi-sentinel | `10.66.0.4` | 阿里云 | `26379` | Sentinel 仲裁节点,不承载 Redis 数据 | `SENTINEL ckquorum mymaster` | `ssh:api.yunail.art` |
|
||||
|
||||
当前验证基线:`prod-redis01` 为 Master,`connected_slaves=3`;5 个 Sentinel 均返回 `OK 5 usable Sentinels. Quorum and failover authorization can be reached`。Redis 认证和应用侧连接配置只记录在 Nacos 或本机私有敏感连接总表,不写入仓库文档。
|
||||
|
||||
## RabbitMQ
|
||||
|
||||
|
||||
@@ -870,6 +870,14 @@ messagehub:
|
||||
- 当前维护机源地址 `192.168.5.163` 已加入 `mysql02` 的 3306 allow 白名单,规则位于 3306 deny 规则之前并已持久化。
|
||||
- 后续新增维护机时只记录源地址、目标主机、端口和验证结果;账号、密码和完整连接命令仍只存放在本机私有敏感总表或 Nacos,不写入仓库文档。
|
||||
|
||||
### 2026-08-24 生产 Redis Sentinel 双中心架构
|
||||
|
||||
- 生产 Redis 已调整为 1 Master + 3 Slave + 5 Sentinel:中心1 `192.168.10.17`、`192.168.10.18`、`192.168.10.19` 为 Redis 数据节点并运行 Sentinel;中心2 `192.168.20.13` 为异地 Redis Slave 并运行 Sentinel;阿里云 newapi 节点 `10.66.0.4` 仅作为 Sentinel 仲裁。
|
||||
- 当前 Redis master 名称为 `mymaster`,当前 Master 为 `192.168.10.17:6379`;中心2 `prod-redis04` 设置 `replica-priority=200`,中心1从库优先参与同中心故障切换,中心1整体不可用时仍保留中心2提升能力。
|
||||
- Redis 开启 AOF,策略为 `appendonly yes`、`appendfsync everysec`;主要用于缓存、Session、Token 和分布式状态,仍按可接受极少量异步复制丢失的缓存类组件管理。
|
||||
- 阿里云 newapi 节点的 Redis Sentinel 使用 `redis-server /etc/redis/sentinel.conf --sentinel` 启动;部分发行包没有独立 `redis-sentinel` 可执行文件,后续重建服务前先检查实际可执行路径。
|
||||
- 验证方式:任一 Sentinel 执行 `SENTINEL get-master-addr-by-name mymaster` 应返回当前 Master;`SENTINEL ckquorum mymaster` 应返回 `OK 5 usable Sentinels`;当前 Master 的 `INFO replication` 应显示 `connected_slaves=3`。
|
||||
|
||||
### 生产 Nacos 命名空间清理与对象存储 bucket 状态
|
||||
|
||||
- 生产运行 namespace 只保留并使用 `jayu-cloud`;旧 `JayuCloud` / `jayuCloud` 不再作为生产配置入口。
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# JayuCloud 项目变更记录
|
||||
|
||||
## 2026-08-24 生产 Redis Sentinel 双中心架构完善
|
||||
|
||||
- 变更原因:补齐 Redis 双中心高可用架构中的中心2异地从库与 Sentinel 仲裁能力,使 Redis 从中心1本地高可用扩展为 1 Master + 3 Slave + 5 Sentinel。
|
||||
- 处理方式:将新装中心2服务器从 DHCP `192.168.20.206` 固定为 `192.168.20.13/24`,主机名设为 `prod-redis04`;部署 Redis 数据节点和 Sentinel,作为 `192.168.10.17` 的异地 Slave;保留阿里云 newapi 节点 `10.66.0.4` 为 Sentinel 仲裁节点,不承载 Redis 数据。
|
||||
- 当前拓扑:`prod-redis01 / 192.168.10.17` 为当前 Master;`prod-redis02 / 192.168.10.18`、`prod-redis03 / 192.168.10.19`、`prod-redis04 / 192.168.20.13` 为 Slave;Sentinel 节点为上述四个 Redis 节点加 `10.66.0.4:26379`。
|
||||
- 影响范围:仅影响 Redis/Sentinel 基础设施和脱敏生产文档;不修改业务代码、数据库结构、Nacos 配置、Nginx、RabbitMQ 或对象存储。
|
||||
- 验证方式:5 个 Sentinel 均返回 `SENTINEL get-master-addr-by-name mymaster = 192.168.10.17:6379`;`SENTINEL ckquorum mymaster` 返回 `OK 5 usable Sentinels. Quorum and failover authorization can be reached`;Master `INFO replication` 显示 `connected_slaves=3`,三个 Slave 均为 `master_link_status:up`。
|
||||
|
||||
## 2026-07-23 生产 NGINX 新增 minio.yunail.art 公网入口代理
|
||||
|
||||
- 变更原因:用户新建 `minio.yunail.art`,需要通过生产 NGINX 将 HTTP/HTTPS 请求统一转发到 `wcy111.top:9000`。
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
## 当前任务已完成 - 已完成效果稿并获得用户确认。 - 已提交设计说明 `docs/superpowers/specs/2026-07-23-店铺设置展示与编辑设计.md`。 - `pages/shop-settings/` 已改为店铺档案、标签、营业安排摘要展示。 - 新增 `pages/shop-profile-edit/` 店铺档案二级编辑页。 - 新增 `pages/shop-tags/` 标签二级管理页。 - 排班与特殊日期合并为主页面底部弹层表单。 - 三个页面 JS 语法检查、JSON 解析和 `git diff --check` 已通过。
|
||||
## 当前阻塞点 - 无功能性阻塞。微信开发者工具自动化连接健康,已完成主页面、档案二级页、标签二级页和营业安排弹层的数据/路由断言;截图通道偶发超时,健康检查显示 `needsRecovery=false`,暂不重复重连。
|
||||
## 下一步 - 保持本次需求相关提交不混入工作区已有的无关改动。 - 用户可在微信开发者工具中继续进行视觉验收。
|
||||
## 2026-08-24 生产 Redis Sentinel 双中心完善
|
||||
|
||||
- 已完成:中心2新 Redis 节点从 `192.168.20.206` 固定为 `192.168.20.13`,主机名 `prod-redis04`。
|
||||
- 已完成:`prod-redis04` 已部署为 `192.168.10.17` 的 Redis Slave,同时运行 Sentinel;阿里云 newapi `10.66.0.4` 保持 Sentinel 仲裁。
|
||||
- 已验证:当前 Redis 为 1 Master + 3 Slave + 5 Sentinel;5 个 Sentinel `ckquorum mymaster` 均 OK,Master 显示 `connected_slaves=3`。
|
||||
- 下一步:如需让生产应用实际切到新 Redis Sentinel 列表,需另行执行 Nacos `middleware.yaml` 脱敏读取、配置变更和 Core/Gateway 滚动验证。
|
||||
|
||||
## 已完成 - 已读取项目规则、轻量记忆和错误记忆相关条目。 - 已按用户最新反馈放弃继续修补自定义 `picker-view` 视觉。 - 已将预约时间字段改为原生 `picker mode="time"`,范围 `00:00-23:59`,确认后再复用原可约性校验。 - 已删除旧时间底部弹窗、自定义小时/分钟滚轮模板和相关样式。 - 已完成 JS 语法检查、旧引用检索、`git diff --check` 和 GitNexus staged 检测,检测结果为低风险、影响流程 0。 - 已补充 `docs/项目变更记录.md`。 - 已按用户确认调整预约日期和预约时间选择入口:数字略放大,背景改为主题一致的浅绿色。
|
||||
## 下一步 - 运行本次样式改动检查、GitNexus staged 变更检测并提交。
|
||||
## 当前阻塞点 - 微信开发者工具当前路由断言通过,但元素查询通道超时;`mp_healthCheck` 显示连接正常、`needsRecovery=false`,不建议重连。
|
||||
|
||||
Reference in New Issue
Block a user