本文为您介绍 OceanBase 迁移服务(OceanBase Migration Service,OMS)Store 组件缓存时间的修改方法和修改示例。
适用版本
仅适用于 OMS V1.4.x。
适用场景
在 OMS 增量同步中,Oracle Store 增量数据默认缓存 10 天,OceanBase Store 增量数据默认缓存 1 天。考虑到存储空间及容错等因素,需要调整 Store 增量数据默认缓存时间。
修改方法
Store 缓存保留时间需要在 Topic 级别修改,修改后的缓存保留时间对于新建的 Store 生效。示例如下:
curl http://xxx.xxx.xxx.xxx:8088/topic/update -d 'topic=$topic&store.clearer.outdated=1296000'
其中需要修改的参数为 update,xxx.xxx.xxx.xxx 为组件启动时所在机器的 IP,请根据实际情况替换 IP 值。修改后新启动一个 Store,修改的缓存保留时间对该 Store 生效。
启动 OceanBase Store。
curl http://xxx.xxx.xxx.xxx:8088/crawler/start -d "topic=${SUB_TOPIC_NAME}&checkpoint=::::1602687985:&role=master"启动 Oracle Store。
启动 Oracle Store 时,需要多指定一个
type参数。curl http://xxx.xxx.xxx.xxx:8088/crawler/start -d "topic=${SUB_TOPIC_NAME}&checkpoint=::::1602687985:&role=master&type=DELIVER2STORE"
修改示例
您可以通过修改 OceanBase 数据库 Topic 中的 update 参数,调整 OceanBase Store 的缓存保留时间。
curl http://xxx.xxx.xxx.xxx:8088/topic/update -d 'topic=oms_dest_topic_1000102_RATING-000-0&key=exCfg&value=store.clearer.outdated=864000'
修改完成后,启动一个新的 OceanBase Store,使修改后的 OceanBase Store 的缓存保留时间生效。
curl http://xxx.xxx.xxx.xxx:8088/crawler/start -d "topic=oms_dest_topic_1000102_RATING-000-0&checkpoint=::::1605087038:&role=master"