Operation Tool
Contents
Operation Tool#
Overview#
OpenMLDB provides an operation tool for user to use & maintain OpenMLDB conveniently. It contains the following ability:
Recover data automatically:
recoverdataBalance partitions when scale-out:
scaleoutMigrate partitions from specified endpoints to others when scale-in:
scaleinPre-upgrade and post-upgrade for tablet upgrade:
pre-upgradeandpost-upgradeCheck op status:
showopstatusCheck table status:
showtablestatus
Usage#
Common parameters#
–openmldb_bin_path: specify openmldb binary path
–zk_cluster: zookeeper address
–zk_root_path: zookeeper path
–cmd: the operation to execute
Operations#
Operation |
Function |
Extra Parameters |
|---|---|---|
|
recover all tables |
- |
|
rebalance partitions among tablets |
- |
|
migrate partitions from specified endpoints to others. If the number of remaining tablets is smaller than the max replicanum, it will fail |
–endpoints: the endpoints that are migrated from, multiple endpoints are delimited by |
|
tablet pre-upgrade, which will migrate all the leader partitions to other tablets to reduce the influence on the online service. If there is only one replica for a partition, we will create an extra one which will be deleted automatically during |
–endpoints: the endpoints that are upgraded, only one endpoint is allowed |
|
tablet post-upgrade, which will revert all the changes recorded in |
–endpoints: the endpoints that are upgraded, only one endpoint is allowed |
|
check the op status |
–filter: only show the records with status |
|
check the table status |
–filter: the required database pattern. Its matching rule is the same as |
Example#
python tools/openmldb_ops.py --openmldb_bin_path=./bin/openmldb --zk_cluster=172.24.4.40:30481 --zk_root_path=/openmldb --cmd=scaleout
Parameter Description#
–endpoints: specified the endpoints to migrate out. If there are two or more endoints, use
,as delimiter. It will execute failed if the leftover tablet number less than replica number of tables
System Requirements#
python >= 3.6
showopstatusandshowtablestatusrequireprettytabledependency