Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

业务拓扑缓存调整,需要删除缓存数据,具体的清理方法 #5471

Closed
breezelxp opened this issue Jul 12, 2021 · 0 comments · Fixed by #5421
Closed

业务拓扑缓存调整,需要删除缓存数据,具体的清理方法 #5471

breezelxp opened this issue Jul 12, 2021 · 0 comments · Fixed by #5421

Comments

@breezelxp
Copy link
Member

breezelxp commented Jul 12, 2021

由于形态调整,原有的业务拓扑缓存数据不在使用,需要把原来的缓存数据删除。
删除操作可利用bin目录下的cmdb_ctl或者tool_ctl进行删除。

在升级完版本后,请执行以下命令以删除相关缓存数据:

## redis的配置参数请根据自己的实际情况填写,确保参数准确。
## 该redis为redis.yaml中的公共redis配置信息
## 特别是--redis-addr一定要配置全,确定删除的数据是redis master节点的数据。该工具支持setinal模式,自动操作主节点。
redisParam='--redis-addr=127.0.0.1:6379 --redis-mastername= --redis-pwd= --redis-sentinelpwd='

## 删除业务相关数据
./tool_ctl redis scan-del ${redisParam} --match cc:v3:biz:*:listdone
./tool_ctl redis scan-del ${redisParam} --match cc:v3:biz:*_list:*
./tool_ctl redis scan-del ${redisParam} --match cc:v3:biz:*_detail:*
./tool_ctl redis scan-del ${redisParam} --match cc:v3:biz:oid*

## 删除业务自定义层级相关的数据
./tool_ctl redis scan-del ${redisParam} --match  cc:v3:biz:custom:listdone:*
./tool_ctl redis scan-del ${redisParam} --match  cc:v3:biz:custom:topology:expire*
./tool_ctl redis scan-del ${redisParam} --match  cc:v3:biz:custom:*_list:*
./tool_ctl redis scan-del ${redisParam} --match  cc:v3:biz:custom:*_detail:*
./tool_ctl redis scan-del ${redisParam} --match  cc:v3:biz:custom:oid*
./tool_ctl redis scan-del ${redisParam} --match  cc:v3:biz:custom:<mainlineTopologyListDoneKey>*

## 删除事件订阅相关的数据
./tool_ctl redis scan-del ${redisParam} --match  cc:v3:event:*
./tool_ctl redis scan-del ${redisParam} --match  cc:v3:ident:inst_*

如果缓存数据量太大,可以在每个命令执行之间sleep 15或者更长时间。

@breezelxp breezelxp added this to the Iteration 3.10 milestone Jul 12, 2021
@breezelxp breezelxp linked a pull request Jul 12, 2021 that will close this issue
@breezelxp breezelxp changed the title 业务拓扑缓存调整,需要删除的key 业务拓扑缓存调整,需要删除缓存数据,具体的清理方法 Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant