不读不写oss配置下线
不读不写oss配置下线
1. 背景
将 OSS 从 Cassandra 升级到 MongoDB,OSS-MongoDB 双跑阶段,发现 MongoDB 中的 3 个数据库没有数据写入:matchstory、cusmatch、anchorlib。
anchorlib 数据库对应的业务比较特殊,只有年表存在数据,且数据是一次性初始化的。
因此接下来只对 matchstory、cusmatch 两个数据库进行梳理。
2. 目标
梳理 OSS 到 Store 的业务配置,查看对应的 CMA 监控,判断 matchstory、cusmatch 两个数据库对应的业务是否有读取、写入量。
确定上述两个数据库对应的业务配置没有读写后,将这两个业务涉及到的所有配置下线。
观察一段时间,若没有问题, matchstory、cusmatch 两个数据库以后就不在 MongoDB 中创建。
3. 配置梳理
3.1 OSS 与 Store 的配置
| matchstory | cusmatch | |
|---|---|---|
| OSS - description | 比赛对局 | 自建比赛 |
| OSS - groupid | 4 | 7 |
| OSS - last_modify_time | 2018/6/4 16:12:36 | 2018/7/23 15:37:22 |
| Store - id | 202 | 208 |
| Store - description | matchstory | 208_cusmatch.json |
| Store - last_modify_time | 2018/6/4 16:14:52 | 2018/8/15 10:19:41 |
| Store - content - “genrule” - “hid” | 8004 | 2081、2082 |
| Store - content - “genrule” - “searchdomain” | “matchstory” | “cusmatch”、”matchplayer” |
3.2 GSS 配置
上述 2 个配置涉及到 3 个 GSS 中的配置。
经验证,此 3 个 GSS 配置只被用于上述两个 Store 配置。
这 3 个 GSS 配置的基本信息如下所示:
| matchstory | cusmatch | matchplayer | |
|---|---|---|---|
| id | 1 | 11 | 12 |
| description | 原来存在HistoryDB 中的matchstory,后缀xml |
自建比赛成绩单 | 自建比赛用户参与过的比赛 |
| last_modify_time | 2018-06-04 16:15:30 | 2018-08-02 15:24:54 | 2018-08-15 10:18:14 |
| storagename | mysql | redis | redis |
| model - “keepday” | 180 | 0 | 0 |
4. 检查 GSS 配置是否存在
4.1 mysql
matchstory 为 mysql 的配置,目标 db 为 “HIS_match”,在堡垒机 7-90 上查看该数据库,发现为空,证明该配置的索引至少已经 180 天没有写入。
4.2 redis
cusmatch 、matchplayer 为 redis 的配置,这两个配置详细如下:
| cusmatch | matchplayer | |
|---|---|---|
| “type” | only | list |
| “tablename” | ZJBS | ZJBSU |
| “keyfields” | {...: "M", ...: "S"}, |
—[空]— |
| “partitionfield” | —[空]— | —[空]— |
| redis-key 模糊匹配 | ZJBS:M*S* |
ZJBSU:P[0-9]*[0-9] |
| redis中的数据个数 | 189 | 405 |
| ttl | No Limit | No Limit |
| 抽查oid中的时间戳 | 2018-09-15 22:56:17、2020-02-03 00:26:35 | —[空]— |
5. CMA 监控查看
上述两项 Store 配置对应的 CMA 监控项如下:
- matchstory:querycnt_8004、querycnt_202、upcnt_202、savecnt_202
- cusmatch:hisstoreStatic.savecnt_208、hisstoreqps.getcontentcondcnt_2081、hisstoreqps.savecnt208、hisstoreqps.getcontentcondcnt_2082
经查看,上述 CMA 监控最近 3 个月内的值均为 0 。
6. 处理结果
6.1 配置下线
对上述配置进行总结,要下线的配置涉及到 Store、GSS、OSS 三张表。如下所示:
| 下线配置个数 | 下线配置id | |
|---|---|---|
| define_hisstore | 2 | 202、208 |
| define_hisgss | 3 | 1、11、12 |
| define_hisoss | 2 | 4、7 |
2024-10-22 13:55:18 下线了上述配置(status 置为 -77)。
6.2 后续操作
观察一段时间,若没有问题,执行以下操作:
- 删除 redis 中的 cusmatch、matchplayer 的所有索引记录。
- MongoDB 中不再创建 matchstory、cusmatch 这两个数据库。
- 梳理 HIS 的其它配置,是否存在 “只写不读” 的记录,该类型的配置评估后同样可以下线。
本文由作者按照
CC BY 4.0
进行授权