The multi_trepctl tool provides a number of options that control the information and detail output when the command is executed.
Table 9.28. multi_trepctl Command-line Options
Option | Description |
---|---|
--by-service | Sort the output by the service name |
--fields | Fields to be output during during summary |
--host , --hosts | Host or hosts on which to limit output |
--output | Specify the output format |
--paths , --path | Directory or directories to check when looking for tools |
--role , --roles | Role or roles on which to limit output |
--service , --services | Service or services on which to limit output |
--skip-headers | Skip the headers |
--sort-by | Sort by a specified field |
Where:
Order the output according to the service name and role within the service:
shell> multi_trepctl --by-service
| host | servicename | role | state | appliedlastseqno | appliedLatency |
| east1 | east | master | ONLINE | 64 | 59.380 |
| west1 | east | slave | ONLINE | 64 | 60.889 |
| west2 | east | slave | ONLINE | 64 | 60.970 |
| west3 | east | slave | ONLINE | 64 | 61.097 |
| west1 | west | master | ONLINE | 294328 | 0.319 |
| west2 | west | master | ONLINE | 231595 | 0.316 |
| east1 | west | slave | OFFLINE:ERROR | -1 | -1.000 |
| west3 | west | slave | ONLINE | 231595 | 22.895 |
Limited the output to the specified list of fields from the output of
fields output by trepctl. For example, to limit the
output to the host, role, and appliedLatency
:
shell> multi_trepctl --fields=host,role,appliedlatency
| host | role | appliedlatency |
| tr-ms1 | master | 0.524 |
| tr-ms2 | slave | 0.000 |
| tr-ms3 | slave | -1.000 |
Limit the output to the host, or a comma-separated list of hosts specified. For example:
shell> multi_trepctl --hosts=tr-ms1,tr-ms3
| host | servicename | role | state | appliedlastseqno | appliedlatency |
| tr-ms1 | alpha | master | ONLINE | 2322 | 0.524 |
| tr-ms3 | alpha | slave | OFFLINE:ERROR | -1 | -1.000 |
Specify the output format.
Table 9.29. multi_trepctl--output
Option
Option | --output | |
Description | Specify the output format | |
Value Type | string | |
Default | info | |
Valid Values | json | JSON format |
list | List format | |
name | Name (simplified text) format | |
tab | Tab-delimited format | |
yaml | YAML format |
For example, to output the current status in JSON format:
shell> multi_trepctl --output json
[
{
"appliedlastseqno": 2322,
"appliedlatency": 0.524,
"host": "tr-ms1",
"role": "master",
"servicename": "alpha",
"state": "ONLINE"
},
{
"appliedlastseqno": 2322,
"appliedlatency": 0.0,
"host": "tr-ms2",
"role": "slave",
"servicename": "alpha",
"state": "ONLINE"
},
{
"appliedlastseqno": -1,
"appliedlatency": -1.0,
"host": "tr-ms3",
"role": "slave",
"servicename": "alpha",
"state": "OFFLINE:ERROR"
}
]
Limit the search for trepctl to the specified path or comma-separated list of paths. On a deployment with multiple services, the output will be limited by the services installed within the specified directories:
shell> multi_trepctl --path /opt/replicator
| host | servicename | role | state | appliedlastseqno | appliedlatency |
| db1 | west | slave | ONLINE | 3 | 0.450 |
| db2 | west | slave | ONLINE | 3 | 0.481 |
| db3 | west | slave | ONLINE | 3 | 0.484 |
| db4 | east | slave | ONLINE | 4 | 0.460 |
| db5 | east | slave | ONLINE | 4 | 0.451 |
| db6 | east | slave | ONLINE | 4 | 0.496 |
This is also useful when control of cross-site replicators is desired in MSMM topologies prior to v6.0.0.
For example, take all cross-site replicators offline:
shell> multi_trepctl --path /opt/replicator offline
To bring all cross-site replicators online:
shell> multi_trepctl --path /opt/replicator online
Limit the output to show only the specified role or comma-separated list of roles:
shell> multi_trepctl --roles=slave
| host | servicename | role | state | appliedlastseqno | appliedlatency |
| tr-ms2 | alpha | slave | ONLINE | 2322 | 0.000 |
| tr-ms3 | alpha | slave | OFFLINE:ERROR | -1 | -1.000 |
Limit the output to the specified service or comma-separated list of services:
shell> multi_trepctl --service=east
| host | servicename | role | state | appliedlastseqno | appliedlatency |
| east1 | east | master | ONLINE | 53 | 0.000 |
| west1 | east | slave | ONLINE | 53 | 119.834 |
| west2 | east | slave | ONLINE | 53 | 181.128 |
| west3 | east | slave | ONLINE | 53 | 204.790 |
Prevents the generation of the headers when generating the list output format:
shell> multi_trepctl --skip-headers
| tr-ms1 | alpha | master | ONLINE | 2322 | 0.524 |
| tr-ms2 | alpha | slave | ONLINE | 2322 | 0.000 |
| tr-ms3 | alpha | slave | OFFLINE:ERROR | -1 | -1.000 |
Sort by the specified fieldname. For example, to sort the output by the latency:
shell> multi_trepctl --sort-by appliedlatency
| host | servicename | role | state | appliedlastseqno | appliedlatency |
| tr-ms3 | alpha | slave | OFFLINE:ERROR | -1 | -1.000 |
| tr-ms2 | alpha | slave | ONLINE | 2322 | 0.000 |
| tr-ms1 | alpha | master | ONLINE | 2322 | 0.524 |