Tablet metadata management tool
To facilitate the maintenance of these metadata, we provide an online HTTP interface and an offline meta tool to complete related management operations.
The HTTP interface is only used to view tablet metadata online, and can be used when the BE process is running.
However, meta tool is only used for off-line metadata management operations. BE must be stopped before it can be used.
The meta tool tool is stored in the Lib / directory of BE.
Operation
Viewing Tablet Meta information can be divided into online and offline methods
Online
Access BE’s HTTP interface to obtain the corresponding Tablet Meta information:
api:
Give an example:
http://be_host:8040/api/meta/header/14156/2458238340
If the final query is successful, the Tablet Meta will be returned as json.
Offline
Get Tablet Meta on a disk based on the meta\ tool tool.
Command:
root_path: The corresponding root_path path path configured in be.conf.
The result is also a presentation of Tablet Meta in JSON format.
The function of loading header is provided to realize manual migration of tablet. This function is based on Tablet Meta in JSON format, so if changes in the shard field and version information are involved, they can be changed directly in the JSON content of Tablet Meta. Then use the following commands to load.
Command:
./lib/meta_tool --operation=load_meta --root_path=/path/to/root_path --json_meta_path=path
Single delete:
Batch delete:
Each line in tablet_file.txt
represents the information of a tablet. The format is:
root_path,tablet_id,schema_hash
Each column are separated by comma.
example:
Batch delete will skip the line with incorrect tablet information format in tablet_file
. And after the execution is completed, the number of successful deletions and the number of errors are displayed.
This command is to view the old file-based management PB format Tablet Meta, and to display Tablet Meta in JSON format.
Command:
This command is to view the PB format segment meta, and to display segment meta in JSON format.