9.17.1. multi_trepctl Options

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

OptionDescription
--by-serviceSort the output by the service name
--fieldsFields to be output during during summary
--host, --hostsHost or hosts on which to limit output
--outputSpecify the output format
--paths, --pathDirectory or directories to check when looking for tools
--role, --rolesRole or roles on which to limit output
--service, --servicesService or services on which to limit output
--skip-headersSkip the headers
--sort-bySort by a specified field

Where:

  • --by-service

    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 |
  • --fields

    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 |
  • --host, --hosts

    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 |
  • --output

    Specify the output format.

    Table 9.29. multi_trepctl--output Option

    Option--output
    DescriptionSpecify the output format
    Value Typestring
    Defaultinfo
    Valid ValuesjsonJSON format
     listList format
     nameName (simplified text) format
     tabTab-delimited format
     yamlYAML 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"
      }
    ]
  • --path, --paths

    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
  • --role, --roles

    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 |
  • --service, --services

    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 |
  • --skip-headers

    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

    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 |