迁移控制台命令参考
迁移控制台命令遵循以下语法:console [component] [action]
。组件包括 clusters
、backfill
、snapshot
、metadata
和 replay
。控制台配置了已部署服务的注册表以及源集群和目标集群,这些配置是从 cdk.context.json
值生成的。
常用命令
具体使用的命令将很大程度上取决于用例和目标,但以下是一些常用命令及其简要说明。
检查连接
报告源集群和目标集群是否均可访问,并提供它们的版本。
console clusters connection-check
运行 cat-indices
在集群上运行 cat-indices
API。
console clusters cat-indices
创建快照
创建源集群的快照,并将其存储在预配置的 Amazon Simple Storage Service (Amazon S3) 存储桶中。
console snapshot create
检查快照状态
对快照创建状态进行详细检查,包括预计完成时间
console snapshot status --deep-check
评估元数据
执行元数据迁移的空运行,显示哪些索引、模板和其他对象将被迁移到目标集群。
console metadata evaluate
迁移元数据
将元数据从源集群迁移到目标集群。
console metadata migrate
启动回填
如果启用了 Reindex-From-Snapshot
(RFS),此命令将启动该服务的一个实例,以开始将文档移动到目标集群
有类似的 scale UNITS
和 stop
命令,用于更改 RFS 的活动实例数量。
console backfill start
检查回填状态
获取回填迁移的当前状态,包括正在运行的实例数量和分片的进度。
启动流量重放器
如果启用了流量重放器,此命令将启动流量重放器的一个实例,以开始对目标集群重放流量。stop
命令会停止所有活动实例。
console replay start
读取日志
读取运行流量重放器时存在的任何日志。在路径上使用 tab 补全来填充可用的 NODE_IDs
,以及(如果适用)日志文件名。元组日志会在达到一定大小阈值时滚动,因此可能会有许多以时间戳命名的文件。jq
命令在将元组输出的每一行写入文件之前会进行美观打印。
console tuples show --in /shared-logs-output/traffic-replayer-default/[NODE_ID]/tuples/console.log | jq > readable_tuples.json
帮助选项
所有命令和选项都可以在工具内部通过使用 --help
选项进行探索,无论是针对整个 console
应用程序还是针对单个组件(例如,console backfill --help
)。例如
$ console --help
Usage: console [OPTIONS] COMMAND [ARGS]...
Options:
--config-file TEXT Path to config file
--json
-v, --verbose Verbosity level. Default is warn, -v is info, -vv is
debug.
--help Show this message and exit.
Commands:
backfill Commands related to controlling the configured backfill...
clusters Commands to interact with source and target clusters
completion Generate shell completion script and instructions for setup.
kafka All actions related to Kafka operations
metadata Commands related to migrating metadata to the target cluster.
metrics Commands related to checking metrics emitted by the capture...
replay Commands related to controlling the replayer.
snapshot Commands to create and check status of snapshots of the...
tuples All commands related to tuples.