LS-CTRL (LogService Control) is a command-line tool for LogService. It communicates with LM/LN nodes over HTTP and provides capabilities such as cluster initialization, node management, status querying, and parameter changes.
Commands
The publicly stable commands are as follows:
Command |
Description |
|---|---|
| bootstrap | Initializes a LogService cluster. |
| show | Queries information about AZs, log nodes (LNs), internal tables, access points (APs), parameters, and virtual tables in the cluster. |
| add ln | Adds an LN to a specified AZ. |
| delete ln | Deletes a specified LN from the LogService cluster. |
| set param | Sets cluster-level or node-level parameters. |
| check | Performs a health check on a cluster, a specified AZ, or a specified stream. |
| upgrade | Performs the cluster upgrade process. |
| fetch | Pulls clog data of a specified stream from object storage to the local node. |
| migrate replica | Migrates replicas of a specified stream from the source LN to the target LN. |
| rotate-ak | Rotates the access key (AK) and secret key (SK) used for object storage. |
| param-version-status | Queries the current parameter version of the cluster and the synchronization status of each LN for that version. |
For the detailed syntax, parameters, and examples of each command, see the corresponding command document.
Working principle
LS-CTRL consists of a client and a server, which interact as follows:
- Client: LS-CTRL is a client tool that communicates with LM/LN nodes over HTTP. When executing a command, LS-CTRL automatically routes the request to the LM leader node, which performs the actual operation.
- Server: Each LN node starts its own HTTP server to respond to management requests from LS-CTRL.
Command structure
ls_ctrl -H <HOST_ADDRESS> <COMMAND>
Where:
-H, --host <HOST_ADDRESS>: Required. Specifies the HTTP address (host:port) of any node in LogService, for example,127.0.0.1:8080. This tool automatically forwards requests to the cluster leader, so you only need to provide the HTTP address of one node.<COMMAND>: Required. Specifies the specific operation command (for example,add,delete,show, etc.). Each command may have corresponding subcommands and options; details are provided in the respective command documentation.
Common parameters
The common parameters applicable to all subcommands are as follows:
Parameter |
Description |
Default value |
|---|---|---|
-H, --host <HOST_ADDRESS> |
The address of the target node (host:port). |
None (required) |
-p, --pretty |
Pretty-prints the JSON output. | false |
-d, --debug |
Enables debug mode (with more detailed logs). | false |
Output format
To facilitate consumption by external tools, whether it succeeds or fails, the command's stdout always consists of two parts:
- First line: The status line (for example,
200 OKor500 Internal Server Error). - Second line: A JSON object or array.
Exit code
0: Successful.- Non-zero: Failure (for the specific meaning, see the stderr output).