|
| 1 | +.. _tt-replicaset: |
| 2 | + |
| 3 | +Working with replicasets |
| 4 | +========================= |
| 5 | + |
| 6 | +.. code-block:: console |
| 7 | +
|
| 8 | + $ tt replicaset COMMAND {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...] |
| 9 | + # or |
| 10 | + $ tt rs COMMAND {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...] |
| 11 | +
|
| 12 | +``tt replicaset`` (or ``tt rs``) manages a Tarantool replica set. |
| 13 | + |
| 14 | +``COMMAND`` is one of the following: |
| 15 | + |
| 16 | +* :ref:`status <tt-replicaset-status>` |
| 17 | +* :ref:`promote <tt-replicaset-promote>` |
| 18 | +* :ref:`demote <tt-replicaset-demote>` |
| 19 | + |
| 20 | + |
| 21 | +.. _tt-replicaset-status: |
| 22 | + |
| 23 | +status |
| 24 | +------ |
| 25 | + |
| 26 | +.. code-block:: console |
| 27 | +
|
| 28 | + $ tt replicaset status {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...] |
| 29 | + # or |
| 30 | + $ tt rs status {APPLICATION[:APP_INSTANCE] | URI} [OPTIONS ...] |
| 31 | +
|
| 32 | +``tt replicaset status`` (``tt rs status``) shows the current status of a replica set. |
| 33 | + |
| 34 | + |
| 35 | +.. _tt-replicaset-status-application: |
| 36 | + |
| 37 | +Displaying status of all replica sets |
| 38 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 39 | + |
| 40 | +To view the status of all replica sets of an application in the current ``tt`` |
| 41 | +environment, run ``tt replicaset status`` with the application name: |
| 42 | + |
| 43 | +.. code-block:: console |
| 44 | +
|
| 45 | + $ tt replicaset status myapp |
| 46 | +
|
| 47 | +.. _tt-replicaset-status-instance: |
| 48 | + |
| 49 | +Displaying status of a single replica set |
| 50 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 51 | + |
| 52 | +To view the status of a single replica set of an application, run ``tt replicaset status`` |
| 53 | +with a name or a URI of an instance from this replica set: |
| 54 | + |
| 55 | +.. code-block:: console |
| 56 | +
|
| 57 | + $ tt replicaset status myapp:storage-001-a |
| 58 | +
|
| 59 | +For a replica outside the current ``tt`` environment, specify its URI and access credentials: |
| 60 | + |
| 61 | +.. code-block:: console |
| 62 | +
|
| 63 | + $ tt replicaset status 192.168.10.10:3301 -u myuser -p p4$$w0rD |
| 64 | +
|
| 65 | +Learn about other ways to provide user credentials in :ref:`tt-replicaset-status-authentication`. |
| 66 | + |
| 67 | +.. _tt-replicaset-status-authentication: |
| 68 | + |
| 69 | +Authentication |
| 70 | +~~~~~~~~~~~~~~ |
| 71 | + |
| 72 | +Use one of the following ways to pass the credentials of a Tarantool user when |
| 73 | +connecting to the instance: |
| 74 | + |
| 75 | +* The ``-u`` (``--username``) and ``-p`` (``--password``) options: |
| 76 | + |
| 77 | + .. code-block:: console |
| 78 | +
|
| 79 | + $ tt replicaset status 192.168.10.10:3301 -u myuser -p p4$$w0rD |
| 80 | +
|
| 81 | +* The connection string: |
| 82 | + |
| 83 | + .. code-block:: console |
| 84 | +
|
| 85 | + $ tt replicaset status myuser:p4$$w0rD@192.168.10.10:3301 |
| 86 | +
|
| 87 | +* Environment variables ``TT_CLI_USERNAME`` and ``TT_CLI_PASSWORD``: |
| 88 | + |
| 89 | + .. code-block:: console |
| 90 | +
|
| 91 | + $ export TT_CLI_USERNAME=myuser |
| 92 | + $ export TT_CLI_PASSWORD=p4$$w0rD |
| 93 | + $ tt replicaset status 192.168.10.10:3301 |
| 94 | +
|
| 95 | +.. _tt-replicaset-status-force: |
| 96 | + |
| 97 | +Selecting the application orchestrator manually |
| 98 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 99 | + |
| 100 | +You can specify the orchestrator to use for the application using the following options: |
| 101 | + |
| 102 | +* ``--config`` for applications that use YAML cluster configuration (Tarantool 3.x or later). |
| 103 | +* ``--cartridge`` for Cartridge applications (Tarantool 2.x). |
| 104 | +* ``--custom`` for any other orchestrators used on Tarantool 2.x clusters. |
| 105 | + |
| 106 | +.. code-block:: console |
| 107 | +
|
| 108 | + $ tt replicaset status myapp --config |
| 109 | + $ tt replicaset status my-cartridge-app --cartridge |
| 110 | +
|
| 111 | +If an actual orchestrator that the application uses does not match the specified |
| 112 | +option, an error is raised. |
| 113 | + |
| 114 | + |
| 115 | +.. _tt-replicaset-status-options: |
| 116 | + |
| 117 | +Options |
| 118 | +~~~~~~~ |
| 119 | + |
| 120 | +.. option:: --cartridge |
| 121 | + |
| 122 | + Force the Cartridge orchestrator for Tarantool 2.x clusters. |
| 123 | + |
| 124 | +.. option:: --config |
| 125 | + |
| 126 | + Force the YAML configuration orchestrator for Tarantool 3.0 or later clusters. |
| 127 | + |
| 128 | +.. option:: --custom |
| 129 | + |
| 130 | + Force a custom orchestrator for Tarantool 2.x clusters. |
| 131 | + |
| 132 | +.. option:: -u USERNAME, --username USERNAME |
| 133 | + |
| 134 | + A Tarantool user for connecting to the instance. |
| 135 | + |
| 136 | +.. option:: -p PASSWORD, --password PASSWORD |
| 137 | + |
| 138 | + The user's password. |
| 139 | + |
| 140 | +.. option:: --sslcertfile FILEPATH |
| 141 | + |
| 142 | + The path to an SSL certificate file for encrypted connections. |
| 143 | + |
| 144 | +.. option:: --sslkeyfile FILEPATH |
| 145 | + |
| 146 | + The path to a private SSL key file for encrypted connections. |
| 147 | + |
| 148 | +.. option:: --sslcafile FILEPATH |
| 149 | + |
| 150 | + The path to a trusted certificate authorities (CA) file for encrypted connections. |
| 151 | + |
| 152 | +.. option:: --sslciphers STRING |
| 153 | + |
| 154 | + The list of SSL cipher suites used for encrypted connections, separated by colons (``:``). |
| 155 | + |
| 156 | +.. _tt-replicaset-promote: |
| 157 | + |
| 158 | +promote |
| 159 | +------- |
| 160 | + |
| 161 | +``tt replicaset promote`` (``tt rs promote``) promotes an instance. |
| 162 | + |
| 163 | +.. _tt-replicaset-demote: |
| 164 | + |
| 165 | +demote |
| 166 | +------ |
| 167 | + |
| 168 | +``tt replicaset demote`` (``tt rs demote``) demotes an instance. |
| 169 | + |
| 170 | + |
| 171 | + |
0 commit comments