diff --git a/doc/reference/tooling/tt_cli/arguments.rst b/doc/reference/tooling/tt_cli/arguments.rst deleted file mode 100644 index 4ba26254bd..0000000000 --- a/doc/reference/tooling/tt_cli/arguments.rst +++ /dev/null @@ -1,33 +0,0 @@ -Arguments -========= - -``tt`` has the following arguments: - -.. container:: table - - .. list-table:: - :widths: 40 60 - :header-rows: 0 - - * - ``--cfg=FILE`` - - ``-c=FILE`` - - Path to the :ref:`configuration file `. - * - ``--internal`` - - ``-I`` - - Force the use of an internal module even if there is an :doc:`external module ` with the same name. - * - ``--local=DIRECTORY`` - - ``-L=DIRECTORY`` - - Use the ``tt`` environment from the specified directory. - Learn more about the :ref:`local launch mode `. - * - ``--system`` - - ``-S`` - - Use the ``tt`` environment installed in the system. - Learn more about the :ref:`system launch mode `. - * - ``--help`` - - ``-h`` - - Display help. \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/binaries.rst b/doc/reference/tooling/tt_cli/binaries.rst index 47ed957a33..5dd103709f 100644 --- a/doc/reference/tooling/tt_cli/binaries.rst +++ b/doc/reference/tooling/tt_cli/binaries.rst @@ -3,9 +3,9 @@ Showing a list of installed binaries ==================================== -.. code-block:: bash +.. code-block:: console - tt binaries + $ tt binaries ``tt binaries`` shows a list of installed binaries and their versions. @@ -14,9 +14,9 @@ Examples Show a list of installed Tarantool versions: -.. code-block:: bash +.. code-block:: console - user@sample-server:~/test-env$ tt binaries + $ tt binaries List of installed binaries: • tarantool: 2.11.1 [active] diff --git a/doc/reference/tooling/tt_cli/build.rst b/doc/reference/tooling/tt_cli/build.rst index 40e5c321ed..03a101225e 100644 --- a/doc/reference/tooling/tt_cli/build.rst +++ b/doc/reference/tooling/tt_cli/build.rst @@ -3,25 +3,19 @@ Building an application ======================= -.. code-block:: bash +.. code-block:: console - tt build [PATH] [flags] + $ tt build [PATH] [--spec SPEC_FILE_PATH] ``tt build`` builds a Tarantool application locally. -Flags ------ - -.. container:: table - - .. list-table:: - :widths: 30 70 - :header-rows: 0 +Options +------- - * - ``--spec`` - - Path to a ``.rockspec`` file to use for the current build +.. option:: --spec SPEC_FILE_PATH + Path to a ``.rockspec`` file to use for the current build Details ------- @@ -68,18 +62,18 @@ Examples * Build the application ``app1`` from its directory: - .. code-block:: bash + .. code-block:: console - tt build + $ tt build * Build the application ``app1`` from the ``simple_app`` directory inside the current directory: - .. code-block:: bash + .. code-block:: console - tt build simple_app + $ tt build simple_app * Build the application ``app1`` from its directory explicitly specifying the rockspec file to use: - .. code-block:: bash + .. code-block:: console - tt build --spec app1-scm-1.rockspec \ No newline at end of file + $ tt build --spec app1-scm-1.rockspec \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/cartridge.rst b/doc/reference/tooling/tt_cli/cartridge.rst index 800b22482f..101bb07b7d 100644 --- a/doc/reference/tooling/tt_cli/cartridge.rst +++ b/doc/reference/tooling/tt_cli/cartridge.rst @@ -3,9 +3,9 @@ Managing a Cartridge application ================================ -.. code-block:: bash +.. code-block:: console - tt cartridge COMMAND [command options] + $ tt cartridge COMMAND {[OPTION ...]|SUBCOMMAND} ``tt cartridge`` manages a Cartridge application. ``COMMAND`` is one of the following: @@ -22,9 +22,9 @@ Managing a Cartridge application admin ----- -.. code-block:: bash +.. code-block:: console - tt cartridge admin ADMIN_FUNC_NAME [options] + $ tt cartridge admin ADMIN_FUNC_NAME [ADMIN_OPTION ...] ``tt cartridge admin`` calls `admin functions `_ provided by the application. @@ -56,14 +56,14 @@ Options .. _tt_cartridge_admin_examples: -Example -~~~~~~~ +Examples +~~~~~~~~ Get a list of the available admin functions: -.. code-block:: bash +.. code-block:: console - tt cartridge admin --name APPNAME --list + $ tt cartridge admin --name APPNAME --list • Available admin functions: @@ -71,9 +71,9 @@ Get a list of the available admin functions: Get help for a specific function: -.. code-block:: bash +.. code-block:: console - tt cartridge admin --name APPNAME probe --help + $ tt cartridge admin --name APPNAME probe --help • Admin function "probe" usage: @@ -84,9 +84,9 @@ Get help for a specific function: Call a function with an argument: -.. code-block:: bash +.. code-block:: console - tt cartridge admin --name APPNAME probe --uri localhost:3301 + $ tt cartridge admin --name APPNAME probe --uri localhost:3301 • Probe "localhost:3301": OK @@ -97,9 +97,9 @@ Call a function with an argument: bench ----- -.. code-block:: bash +.. code-block:: console - tt cartridge bench [options] + $ tt cartridge bench [BENCH_OPTION ...] ``tt cartridge bench`` runs benchmarks for Tarantool. @@ -162,81 +162,84 @@ Options failover -------- -.. code-block:: bash +.. code-block:: console - tt cartridge failover COMMAND [command options] + $ tt cartridge failover COMMAND [COMMAND_OPTION ...] ``tt cartridge failover`` manages an application failover. +The following commands are available: + +* ``set`` +* ``setup`` +* ``status`` +* ``disable`` -.. _tt_cartridge_failover_commands: +.. _tt_cartridge_failover_set: -Subcommands -~~~~~~~~~~~ +failover set +~~~~~~~~~~~~ -.. container:: table +.. code-block:: console - .. list-table:: - :widths: 25 75 - :header-rows: 0 + $ tt cartridge failover set MODE [FAILOVER_SET_OPTION ...] - * - ``set`` - - Setup failover in the specified mode: +Setup failover in the specified mode: - * ``stateful`` - * ``eventual`` - * ``disabled`` +* ``stateful`` +* ``eventual`` +* ``disabled`` - Usage: +Options: - .. code-block:: bash +* ``--state-provider STRING``: A failover's state provider. Can be ``stateboard`` or ``etcd2``. Used only in the ``stateful`` mode. +* ``--params STRING``: Failover parameters specified in a JSON-formatted string, for example, ``"{'fencing_timeout': 10', 'fencing_enabled': true}"``. +* ``--provider-params STRING``: Failover provider parameters specified in a JSON-formatted string, for example, ``"{'lock_delay': 14}"``. - tt cartridge failover set MODE [options] +.. _tt_cartridge_failover_setup: - Options: +failover setup +~~~~~~~~~~~~~~ - * ``--state-provider STRING``: A failover's state provider. Can be ``stateboard`` or ``etcd2``. Used only in the ``stateful`` mode. - * ``--params STRING``: Failover parameters specified in a JSON-formatted string, for example, ``"{'fencing_timeout': 10', 'fencing_enabled': true}"``. - * ``--provider-params STRING``: Failover provider parameters specified in a JSON-formatted string, for example, ``"{'lock_delay': 14}"``. +.. code-block:: console - * - ``setup`` - - Setup failover with parameters described in a file. - The failover configuration file defaults to ``failover.yml``. + $ tt cartridge failover setup --file STRING - Usage: +Setup failover with parameters described in a file. +The failover configuration file defaults to ``failover.yml``. - .. code-block:: bash +The ``failover.yml`` file might look as follows: - tt cartridge failover setup --file STRING - The ``failover.yml`` file might look as follows: +.. code-block:: yaml - .. code-block:: yaml + mode: stateful + state_provider: stateboard + stateboard_params: + uri: localhost:4401 + password: passwd + failover_timeout: 15 - mode: stateful - state_provider: stateboard - stateboard_params: - uri: localhost:4401 - password: passwd - failover_timeout: 15 +.. _tt_cartridge_failover_status: - * - ``status`` - - Get the current failover status. +failover status +~~~~~~~~~~~~~~~ - Usage: +.. code-block:: console - .. code-block:: bash + $ tt cartridge failover status - tt cartridge failover status +Get the current failover status. - * - ``disable`` - - Disable failover. +.. _tt_cartridge_failover_disable: - Usage: +failover disable +~~~~~~~~~~~~~~~~ - .. code-block:: bash +.. code-block:: console - tt cartridge failover disable + $ tt cartridge failover disable +Disable failover. .. _tt_cartridge_failover_options: @@ -257,63 +260,65 @@ Options repair ------ -.. code-block:: bash +.. code-block:: console - tt cartridge repair COMMAND [command options] + $ tt cartridge repair COMMAND [REPAIR_OPTION ...] ``tt cartridge repair`` repairs a running application. +The following commands are available: -.. _tt_cartridge_repair_commands: +* ``list-topology`` +* ``remove-instance`` +* ``set-advertise-uri`` +* ``set-leader`` -Subcommands -~~~~~~~~~~~ +.. _tt_cartridge_repair_list-topology: -.. container:: table +repair list-topology +~~~~~~~~~~~~~~~~~~~~ - .. list-table:: - :widths: 25 75 - :header-rows: 0 +.. code-block:: console - * - ``list-topology`` - - Get a summary of the current cluster topology. + $ tt cartridge repair list-topology [REPAIR_OPTION ...] - Usage: +Get a summary of the current cluster topology. - .. code-block:: bash +.. _tt_cartridge_repair_remove-instance: - tt cartridge repair list-topology [options] +repair remove-instance +~~~~~~~~~~~~~~~~~~~~~~ - * - ``remove-instance`` - - Remove the instance with the specified UUID from the cluster. If the instance isn't found, raise an error. +.. code-block:: console - Usage: + $ tt cartridge repair remove-instance UUID [REPAIR_OPTION ...] - .. code-block:: bash +Remove the instance with the specified UUID from the cluster. If the instance isn't found, raise an error. - tt cartridge repair remove-instance UUID [options] +.. _tt_cartridge_repair_set-advertise-uri: - * - ``set-advertise-uri`` - - Change the instance's advertise URI. Raise an error if the instance isn't found or is expelled. +repair set-advertise-uri +~~~~~~~~~~~~~~~~~~~~~~~~ - Usage: +.. code-block:: console - .. code-block:: bash + $ tt cartridge repair set-advertise-uri INSTANCE-UUID NEW-URI [REPAIR_OPTION ...] - tt cartridge repair set-advertise-uri INSTANCE-UUID NEW-URI [options] +Change the instance's advertise URI. Raise an error if the instance isn't found or is expelled. - * - ``set-leader`` - - Set the instance as the leader of the replica set. Raise an error in the following cases: +.. _tt_cartridge_set-leader: - * There is no replica set or instance with that UUID. - * The instance doesn't belong to the replica set. - * The instance has been disabled or expelled. +repair set-leader +~~~~~~~~~~~~~~~~~ - Usage: +.. code-block:: console - .. code-block:: bash + $ tt cartridge repair set-leader REPLICASET-UUID INSTANCE-UUID [REPAIR_OPTION ...] - tt cartridge repair set-leader REPLICASET-UUID INSTANCE-UUID [options] +Set the instance as the leader of the replica set. Raise an error in the following cases: +* There is no replica set or instance with that UUID. +* The instance doesn't belong to the replica set. +* The instance has been disabled or expelled. .. _tt_cartridge_repair_options: @@ -344,171 +349,196 @@ The following options work with any ``repair`` command, except ``list-topology`` Enable instance configuration to reload after the patch. - - .. _tt_cartridge_replicasets: replicasets ----------- -.. code-block:: bash +.. code-block:: console - tt cartridge replicasets COMMAND [command options] + $ tt cartridge replicasets COMMAND [COMMAND_OPTION ...] ``tt cartridge replicasets`` manages an application's replica sets. +The following commands are available: + +* ``setup`` +* ``save`` +* ``list`` +* ``join`` +* ``list-roles`` +* ``list-vshard-groups`` +* ``add-roles`` +* ``remove-roles`` +* ``set-weight`` +* ``set-failover-priority`` +* ``bootstrap-vshard`` +* ``expel`` + +.. _tt_cartridge_replicasets_setup: + +replicasets setup +~~~~~~~~~~~~~~~~~ + +.. code-block:: console + + $ tt cartridge replicasets setup [--file FILEPATH] [--bootstrap-vshard] + +Setup replica sets using a file. + +Options: + +* ``--file``: A file with a replica set configuration. Defaults to ``replicasets.yml``. +* ``--bootstrap-vshard``: Bootstrap vshard upon setup. + +.. _tt_cartridge_replicasets_save: +replicasets save +~~~~~~~~~~~~~~~~ -.. _tt_cartridge_replicasets_commands: +.. code-block:: console -Subcommands -~~~~~~~~~~~ + $ tt cartridge replicasets save [--file FILEPATH] -.. container:: table +Save the current replica set configuration to a file. - .. list-table:: - :widths: 25 75 - :header-rows: 0 +Options: - * - ``setup`` - - Setup replica sets using a file. +* ``--file``: A file to save the configuration to. Defaults to ``replicasets.yml``. - Usage: - .. code-block:: bash +.. _tt_cartridge_replicasets_list: - tt cartridge replicasets setup [options] +replicasets list +~~~~~~~~~~~~~~~~ - Options: +.. code-block:: console - * ``--file``: A file with a replica set configuration. Defaults to ``replicasets.yml``. - * ``--bootstrap-vshard``: Bootstrap vshard upon setup. + $ tt cartridge replicasets list [--replicaset STRING] - * - ``save`` - - Save the current replica set configuration to a file. +List the current cluster topology. - Usage: +Options: - .. code-block:: bash +* ``--replicaset STRING``: A replica set name. - tt cartridge replicasets save [options] +.. _tt_cartridge_replicasets_join: - Options: +replicasets join +~~~~~~~~~~~~~~~~ - * ``--file``: A file to save the configuration to. Defaults to ``replicasets.yml``. +.. code-block:: console - * - ``list`` - - List the current cluster topology. + $ tt cartridge replicasets join INSTANCE_NAME ... [--replicaset STRING] - Usage: +Join the instance to a cluster. +If a replica set with the specified alias isn't found in the cluster, it is created. +Otherwise, instances are joined to an existing replica set. - .. code-block:: bash +Options: - tt cartridge replicasets list [options] +* ``--replicaset STRING``: A replica set name. - Options: +.. _tt_cartridge_replicasets_list-roles: - * ``--replicaset STRING``: A replica set name. +replicasets list-roles +~~~~~~~~~~~~~~~~~~~~~~ - * - ``join`` - - Join the instance to a cluster. - If a replica set with the specified alias isn't found in cluster, it is created. - Otherwise, instances are joined to an existing replica set. +.. code-block:: console - Usage: + $ tt cartridge replicasets list-roles - .. code-block:: bash +List the available roles. - tt cartridge replicasets join INSTANCE_NAME... [options] +.. _tt_cartridge_replicasets_list-vshard-groups: - Options: +replicasets list-vshard-groups +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * ``--replicaset STRING``: A replica set name. +.. code-block:: console - * - ``list-roles`` - - List the available roles. + $ tt cartridge replicasets list-vshard-groups - Usage: +List the available vshard groups. - .. code-block:: bash +.. _tt_cartridge_replicasets_add-roles: - tt cartridge replicasets list-roles [options] +replicasets add-roles +~~~~~~~~~~~~~~~~~~~~~ - * - ``list-vshard-groups`` - - List the available vshard groups. +.. code-block:: console - Usage: + $ tt cartridge replicasets add-roles ROLE_NAME ... [--replicaset STRING] [--vshard-group STRING] - .. code-block:: bash +Add roles to the replica set. - tt cartridge replicasets list-vshard-groups [options] +Options: - * - ``add-roles`` - - Add roles to the replica set. +* ``--replicaset STRING``: A replica set name. +* ``--vshard-group STRING``: A vshard group for ``vshard-storage`` replica sets. - Usage: +.. _tt_cartridge_replicasets_remove-roles: - .. code-block:: bash +replicasets remove-roles +~~~~~~~~~~~~~~~~~~~~~~~~ - tt cartridge replicasets add-roles ROLE_NAME... [options] +.. code-block:: console - Options: + $ tt cartridge replicasets remove-roles ROLE_NAME ... [--replicaset STRING] - * ``--replicaset STRING``: A replica set name. - * ``--vshard-group STRING``: A vshard group for ``vshard-storage`` replica sets. +Remove roles from the replica set. - * - ``remove-roles`` - - Remove roles from the replica set. +Options: - Usage: +* ``--replicaset STRING``: A replica set name. - .. code-block:: bash +.. _tt_cartridge_replicasets_set-weight: - tt cartridge replicasets remove-roles ROLE_NAME... [options] +replicasets set-weight +~~~~~~~~~~~~~~~~~~~~~~ - Options: +.. code-block:: console - * ``--replicaset STRING``: A replica set name. + $ tt cartridge replicasets set-weight WEIGHT [--replicaset STRING] - * - ``set-weight`` - - Specify replica set weight. +Specify replica set weight. - Usage: +Options: - .. code-block:: bash +* ``--replicaset STRING``: A replica set name. - tt cartridge replicasets set-weight WEIGHT [options] +.. _tt_cartridge_replicasets_set-failover-priority: - Options: +replicasets set-failover-priority +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * ``--replicaset STRING``: A replica set name. +.. code-block:: console - * - ``set-failover-priority`` - - Configure replica set failover priority. + $ tt cartridge replicasets set-failover-priority INSTANCE_NAME ... [--replicaset STRING] - Usage: +Configure replica set failover priority. - .. code-block:: bash +Options: - tt cartridge replicasets set-failover-priority INSTANCE_NAME... [options] +* ``--replicaset STRING``: A replica set name. - Options: +.. _tt_cartridge_replicasets_bootstrap-vshard: - * ``--replicaset STRING``: A replica set name. +replicasets bootstrap-vshard +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - ``bootstrap-vshard`` - - Bootstrap vshard. +.. code-block:: console - Usage: + $ tt cartridge replicasets bootstrap-vshard - .. code-block:: bash +Bootstrap vshard. - tt cartridge replicasets bootstrap-vshard [options] +.. _tt_cartridge_replicasets_expel: - * - ``expel`` - - Expel one or more instances from the cluster. +replicasets expel +~~~~~~~~~~~~~~~~~ - Usage: +.. code-block:: console - .. code-block:: bash + $ tt cartridge replicasets expel INSTANCE_NAME ... - tt cartridge replicasets expel INSTANCE_NAME... [options] +Expel one or more instances from the cluster. \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/cat.rst b/doc/reference/tooling/tt_cli/cat.rst index d79e8b71a7..bde21c256a 100644 --- a/doc/reference/tooling/tt_cli/cat.rst +++ b/doc/reference/tooling/tt_cli/cat.rst @@ -3,71 +3,73 @@ Printing the contents of .snap and .xlog files ============================================== -.. code-block:: bash +.. code-block:: console - tt cat FILE .. [flags] + $ tt cat FILE ... [OPTION ...] ``tt cat`` prints the contents of :ref:`snapshot ` (``.snap``) and :ref:`WAL ` (``.xlog``) files to stdout. A single call of ``tt cat`` can print the contents of multiple files. -Flags ------ +Options +------- -.. container:: table +.. option:: --format FORMAT - .. list-table:: - :widths: 20 80 - :header-rows: 0 + Output format: ``yaml`` (default), ``json``, or ``lua``. - * - ``--format`` - - Output format: ``yaml`` (default), ``json``, or ``lua`` - * - ``--from`` - - Show operations starting from the given LSN - * - ``--to`` - - Show operations up to the given LSN. Default: 18446744073709551615 - * - ``--replica`` - - Filter the output by replica ID. Can be passed more than once - * - ``--space`` - - Filter the output by space ID. Can be passed more than once - * - ``--show-system`` - - Show the contents of system spaces +.. option:: --from LSN -Details -------- + Show operations starting from the given LSN. + +.. option:: --to LSN + + Show operations up to the given LSN. Default: ``18446744073709551615``. + +.. option:: --replica ID + + Filter the output by replica ID. Can be passed more than once. + + When calling ``tt cat`` with filters by LSN (``--from`` and ``--to`` flags) and + replica ID (``--replica``), remember that LSNs differ across replicas. + Thus, if you pass more than one replica ID via ``--from`` or ``--to``, + the result may not reflect the actual sequence of operations. + +.. option:: --space ID + + Filter the output by space ID. Can be passed more than once. + +.. option:: --show-system -When calling ``tt cat`` with filters by LSN (``--from`` and ``--to`` flags) and -replica ID (``--replica``), remember that LSNs differ across replicas. -Thus, if you pass more than one replica ID via ``--from`` or ``--to``, -the result may not reflect the actual sequence of operations. + Show the contents of system spaces. Examples -------- * Output contents of ``00000000000000000000.xlog`` WAL file in the YAML format: - .. code-block:: bash + .. code-block:: console - tt cat 00000000000000000000.xlog + $ tt cat 00000000000000000000.xlog * Output operations on spaces with ``space_id`` 512 and 513 from the ``00000000000000000012.snap`` snapshot file in the JSON format: - .. code-block:: bash + .. code-block:: console - tt cat 00000000000000000012.snap --space 512 --space 513 --format json + $ tt cat 00000000000000000012.snap --space 512 --space 513 --format json * Output operations on all spaces, including system spaces, from the ``00000000000000000000.xlog`` WAL file: - .. code-block:: bash + .. code-block:: console - tt cat 00000000000000000000.xlog --show-system + $ tt cat 00000000000000000000.xlog --show-system * Output operations with LSNs between 100 and 500 on replica 1 from the ``00000000000000000000.xlog`` WAL file: - .. code-block:: bash + .. code-block:: console - tt cat 00000000000000000000.xlog --from 100 --to 500 --replica 1 + $ tt cat 00000000000000000000.xlog --from 100 --to 500 --replica 1 diff --git a/doc/reference/tooling/tt_cli/cfg.rst b/doc/reference/tooling/tt_cli/cfg.rst index ef39b545d4..e24ae98eac 100644 --- a/doc/reference/tooling/tt_cli/cfg.rst +++ b/doc/reference/tooling/tt_cli/cfg.rst @@ -1,9 +1,9 @@ Environment configuration ========================= -.. code-block:: bash +.. code-block:: console - tt cfg COMMAND [command flags] + $ tt cfg COMMAND [OPTION ...] ``tt cfg`` manages a ``tt`` environment :ref:`configuration `. @@ -20,7 +20,7 @@ Commands * - ``dump`` - Print a ``tt`` environment configuration. - Flags: + Options: * ``-r``, ``--raw``: Print a raw content of the ``tt.yaml`` configuration file. @@ -28,8 +28,8 @@ Commands Examples -------- -The following command prints a ``tt`` environment configuration: +Print the current ``tt`` environment configuration: -.. code-block:: bash +.. code-block:: console - tt cfg dump + $ tt cfg dump diff --git a/doc/reference/tooling/tt_cli/check.rst b/doc/reference/tooling/tt_cli/check.rst index a911963e5f..ddbac81583 100644 --- a/doc/reference/tooling/tt_cli/check.rst +++ b/doc/reference/tooling/tt_cli/check.rst @@ -3,11 +3,11 @@ Checking an application file ============================ -.. code-block:: bash +.. code-block:: console - tt check APP_FILE + $ tt check {INSTANCE | APPLICATION[:APP_INSTANCE]} -``tt check`` checks the specified Tarantool application file for syntax errors. +``tt check`` checks the specified Tarantool application or instance for syntax errors. Details ------- @@ -22,15 +22,35 @@ specified in the :ref:`tt configuration file `. ``APP_FILE`` Examples -------- +Single instance +~~~~~~~~~~~~~~~ + * Check the syntax of the ``app.lua`` file from the ``instances_enabled`` directory: - .. code-block:: bash + .. code-block:: console - tt check app + $ tt check app * Check the syntax of the ``init.lua`` file from the ``instance1/`` directory inside ``instances_enabled``: - .. code-block:: bash + .. code-block:: console + + $ tt check instance1 + +Multiple instances +~~~~~~~~~~~~~~~~~~ + +* Check all source files of the application stored in the ``app/`` directory inside + ``instances_enabled`` in accordance with the :ref:`instances configuration `: + + .. code-block:: console + + $ tt check app + +* Check the source of the ``master`` instance of the application stored in the + ``app/`` directory inside ``instances_enabled``: + + .. code-block:: console - tt check instance1 \ No newline at end of file + $ tt check app:master \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/clean.rst b/doc/reference/tooling/tt_cli/clean.rst index e39b21f65f..c35860b26f 100644 --- a/doc/reference/tooling/tt_cli/clean.rst +++ b/doc/reference/tooling/tt_cli/clean.rst @@ -3,27 +3,20 @@ Cleaning instance files ======================= -.. code-block:: bash +.. code-block:: console - tt clean INSTANCE|APPLICATION [flags] + $ tt clean {INSTANCE | APPLICATION[:APP_INSTANCE]} [OPTION ...] ``tt clean`` cleans stored files of Tarantool instances: logs, snapshots, and other files. To avoid accidental deletion of files, ``tt clean`` shows the files it is going to delete and asks for confirmation. -Flags ------ +Options +------- -.. container:: table +.. option:: -f, --force - .. list-table:: - :widths: 30 70 - :header-rows: 0 - - * - ``-f`` - - ``--force`` - - Clean files without confirmation + Clean files without confirmation. Examples @@ -34,21 +27,21 @@ Single instance * Clean the files of the ``app`` instance: - .. code-block:: bash + .. code-block:: console - tt clean app + $ tt clean app Multiple instances ~~~~~~~~~~~~~~~~~~ * Clean the files of all instances of the ``app`` application: - .. code-block:: bash + .. code-block:: console - tt clean app + $ tt clean app * Clean the files of the ``master`` instance of the ``app`` application: - .. code-block:: bash + .. code-block:: console - tt clean app:master \ No newline at end of file + $ tt clean app:master \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/completion.rst b/doc/reference/tooling/tt_cli/completion.rst index 13a0ba8c53..36f7373292 100644 --- a/doc/reference/tooling/tt_cli/completion.rst +++ b/doc/reference/tooling/tt_cli/completion.rst @@ -3,9 +3,9 @@ Generating completion for tt ============================ -.. code-block:: bash +.. code-block:: console - tt completion SHELL + $ tt completion SHELL ``tt completion`` generates tab-based completion for ``tt`` commands in the specified shell: ``bash`` or ``zsh``. @@ -16,9 +16,9 @@ Examples Generate ``tt`` completion for the current ``bash`` terminal: -.. code-block:: bash +.. code-block:: console - . <(tt completion bash) + $ . <(tt completion bash) .. note:: diff --git a/doc/reference/tooling/tt_cli/configuration.rst b/doc/reference/tooling/tt_cli/configuration.rst index cd9b5aaa6b..6548b5aec6 100644 --- a/doc/reference/tooling/tt_cli/configuration.rst +++ b/doc/reference/tooling/tt_cli/configuration.rst @@ -14,7 +14,7 @@ execution is its configuration file. By default, the configuration file is called ``tt.yaml``. The location where ``tt`` searches for it depends on the :ref:`launch mode `. You can also pass the configuration file explicitly in the ``--cfg`` -:doc:`argument `. +:ref:`option `. The ``tt`` configuration file is a YAML file with the following content: diff --git a/doc/reference/tooling/tt_cli/connect.rst b/doc/reference/tooling/tt_cli/connect.rst index 877757dee7..9f842aab76 100644 --- a/doc/reference/tooling/tt_cli/connect.rst +++ b/doc/reference/tooling/tt_cli/connect.rst @@ -3,37 +3,30 @@ Connecting to a Tarantool instance ================================== -.. code-block:: bash +.. code-block:: console - tt connect URI|INSTANCE_NAME [flags] + $ tt connect {URI|INSTANCE} [OPTION ...] ``tt connect`` connects to a Tarantool instance by its URI or name specified during its startup (``tt start``). -Flags ------ +Options +------- -.. container:: table +.. option:: -u USERNAME, --username USERNAME - .. list-table:: - :widths: 30 70 - :header-rows: 0 + Username - * - ``-u`` +.. option:: -p PASSWORD, --password PASSWORD - ``--username`` - - Username - * - ``-p`` + Password - ``--password`` - - Password - * - ``-f`` +.. option:: -f FILEPATH, --file FILEPATH - ``--file`` - - Connect and evaluate the script from a file. + Connect and evaluate the script from a file. - ``-`` – read the script from stdin. + ``-`` – read the script from stdin. Details ------- @@ -59,31 +52,31 @@ Examples * Connect to the ``app`` instance in the same environment: - .. code-block:: bash + .. code-block:: console - tt connect app + $ tt connect app * Connect to the ``master`` instance of the ``app`` application in the same environment: - .. code-block:: bash + .. code-block:: console - tt connect app:master + $ tt connect app:master * Connect to the ``192.168.10.10`` host on port ``3301`` with authentication: - .. code-block:: bash + .. code-block:: console - tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD + $ tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD * Connect to the ``app`` instance and evaluate the code from the ``test.lua`` file: - .. code-block:: bash + .. code-block:: console - tt connect app -f test.lua + $ tt connect app -f test.lua * Connect to the ``app`` instance and evaluate the code from stdin: - .. code-block:: bash + .. code-block:: console - echo "function test() return 1 end" | tt connect app -f - # Create the test() function - echo "test()" | tt connect app -f - # Call this function \ No newline at end of file + $ echo "function test() return 1 end" | tt connect app -f - # Create the test() function + $ echo "test()" | tt connect app -f - # Call this function \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/coredump.rst b/doc/reference/tooling/tt_cli/coredump.rst index 1c9be46a6a..598386c9cb 100644 --- a/doc/reference/tooling/tt_cli/coredump.rst +++ b/doc/reference/tooling/tt_cli/coredump.rst @@ -3,71 +3,86 @@ Manipulating Tarantool core dumps ================================= -.. code-block:: bash +.. code-block:: console - tt coredump COMMAND [ARGUMENT] + $ tt coredump COMMAND [COMMAND_OPTION ...] ``tt coredump`` provides commands for manipulating Tarantool core dumps. -.. note:: +To be able to investigate Tarantool crashes, make sure that core dumps are enabled +on the host. Here is the :ref:`instruction on enabling core dumps on Unix systems `. + +.. important:: ``tt coredump`` does not support macOS. Commands -------- -.. container:: table - - .. list-table:: - :widths: 20 80 - :header-rows: 0 - - * - ``pack`` - - Pack a Tarantool core dump and supporting data into a ``tar.gz`` archive - * - ``unpack`` - - Unpack a Tarantool core dump archive - * - ``inspect`` - - Inspect a Tarantool core dump directory with the - `GNU debugger `__ (``gdb``) +pack +~~~~ +.. code-block:: console -Details -------- + $ tt coredump pack COREDUMP_FILE -To be able to investigate Tarantool crashes, make sure that core dumps are enabled -on the host. Here is the :ref:`instruction on enabling core dumps on Unix systems `. - -``tt coredump pack`` packs the given core dump together with files and data -that can help the crash investigation. This includes: +Pack a Tarantool core dump and supporting data into a ``tar.gz`` archive. +It includes: -* Tarantool executable +* the Tarantool executable * Tarantool version information * OS information * Shared libraries -``tt coredump inspect`` requires ``gdb`` installed on the host. +Option: a path to a core dump file. + +unpack +~~~~~~ + +.. code-block:: console + + $ tt coredump unpack ARCHIVE + +Unpack a Tarantool core dump created with ``tt coredump pack`` into a new directory. + +Option: a path to a ``tar.gz`` archive packed by ``tt coredump pack``. + +inspect +~~~~~~~ + +.. code-block:: console + + $ tt coredump inspect DIRECTORY + +Inspect a Tarantool core dump directory with the `GNU debugger `__ (``gdb``) The directory being inspected must have the same structure as the core dump archive created by ``tt coredump pack``. +.. note:: + + ``tt coredump inspect`` requires ``gdb`` installed on the host. + +Option: a path to a directory with an unpacked core dump archive. + Examples -------- * Pack a ``tar.gz`` file with a Tarantool core dump and supporting data: - .. code-block:: bash + .. code-block:: console - tt coredump pack name.core + $ tt coredump pack name.core * Unpack a ``tar.gz`` archive packed by ``tt coredump pack``: - .. code-block:: bash + .. code-block:: console - tt coredump unpack tarantool-core-dump.tar.gz + $ tt coredump unpack tarantool-core-dump.tar.gz * Inspect the unpacked core dump with ``gdb``: - .. code-block:: bash + .. code-block:: console - tt coredump inspect tarantool-core-dump \ No newline at end of file + $ tt coredump inspect tarantool-core-dump \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/create.rst b/doc/reference/tooling/tt_cli/create.rst index 46d1041ee8..fdf94974a4 100644 --- a/doc/reference/tooling/tt_cli/create.rst +++ b/doc/reference/tooling/tt_cli/create.rst @@ -3,42 +3,39 @@ Creating an application from a template ======================================= -.. code-block:: bash +.. code-block:: console - tt create TEMPLATE_NAME [flags] + $ tt create TEMPLATE_NAME [OPTION ...] ``tt create`` creates a new Tarantool application from a template. -Flags ------ +Options +------- + +.. option:: -d PATH, --dst PATH + + Path to the directory where the application will be created. + +.. option:: -f, --force + + Force rewrite the application directory if it already exists. + +.. option:: --name NAME -.. container:: table + Application name. - .. list-table:: - :widths: 30 70 - :header-rows: 0 +.. option:: -s, --non-interactive - * - ``-d`` + Non-interactive mode. - ``--dst`` - - Path to the directory where the application will be created - * - ``-f`` +.. option:: --var [VAR=VALUE ...] - ``--force`` - - Force rewrite the application directory if it already exists - * - ``-n`` + Variable definition. Usage: ``--var var_name=value``. - ``--name`` - - Application name - * - ``-s`` +.. option:: --vars-file FILEPATH - ``--non-interactive`` - - Non-interactive mode - * - ``--var`` - - Variable definition. Usage: ``--var var_name=value`` - * - ``--vars-file`` - - Path to the file with variable definitions + Path to the file with variable definitions. Details ------- @@ -159,16 +156,16 @@ flag to disable the interactive input. In this case, the values are searched in * In the ``--var`` flag. Pass a string of the ``var=value`` format after the ``--var`` flag. You can pass multiple variables, each after a separate ``--var`` flag: - .. code-block:: bash + .. code-block:: console - tt create template app --var user_name=admin + $ tt create template app --var user_name=admin * In a file. Specify ``var=value`` pairs in a plain text file, each on a new line, and pass it as the value of the ``--vars-file`` flag: - .. code-block:: bash + .. code-block:: console - tt create template app --vars-file variables.txt + $ tt create template app --vars-file variables.txt ``variables.txt`` can look like this: @@ -196,15 +193,15 @@ Examples * Create the application ``app1`` from the ``simple_app`` template in the current directory: - .. code-block:: bash + .. code-block:: console - tt create simple_app --name app1 + $ tt create simple_app --name app1 * Create the ``app1`` application in ``/opt/tt/apps/``, set the ``user_name`` variable to ``admin``, force rewrite the application directory if it already exists. User interaction is disabled. - .. code-block:: bash + .. code-block:: console - tt create cartridge --name app1 --var user_name=admin -f --non-interactive -dst /opt/tt/apps/ + $ tt create cartridge --name app1 --var user_name=admin -f --non-interactive -dst /opt/tt/apps/ diff --git a/doc/reference/tooling/tt_cli/external_modules.rst b/doc/reference/tooling/tt_cli/external_modules.rst index 8772ba3d67..ef2710aa1e 100644 --- a/doc/reference/tooling/tt_cli/external_modules.rst +++ b/doc/reference/tooling/tt_cli/external_modules.rst @@ -65,7 +65,7 @@ you need. The ``tt version`` call will execute this module instead of the built- tt version # Calls the external module if it's available You can force the use of the internal module by running ``tt`` with the ``--internal`` or ``-I`` -:doc:`argument `. The following call will execute the built-in ``version`` +:ref:`option `. The following call will execute the built-in ``version`` even if there is an external module with the same name: .. code-block:: bash diff --git a/doc/reference/tooling/tt_cli/global_options.rst b/doc/reference/tooling/tt_cli/global_options.rst new file mode 100644 index 0000000000..3d108033f3 --- /dev/null +++ b/doc/reference/tooling/tt_cli/global_options.rst @@ -0,0 +1,33 @@ +.. _tt-global-options: + +Global options +============== + +``tt`` has the following global options: + +.. option:: -c=FILE, --cfg=FILE + + Path to the :ref:`configuration file `. + +.. option:: -h, --help + + Display help. + +.. option:: -I, --internal + + Force the use of an internal module even if there is an + :doc:`external module ` with the same name. + +.. option:: -L=DIRECTORY, --local=DIRECTORY + + Use the ``tt`` environment from the specified directory. + Learn more about the :ref:`local launch mode `. + +.. option:: -S, --system + + Use the ``tt`` environment installed in the system. + Learn more about the :ref:`system launch mode `. + +.. option:: -V, --verbose + + Display detailed processing information (verbose mode). diff --git a/doc/reference/tooling/tt_cli/help.rst b/doc/reference/tooling/tt_cli/help.rst index 80fdeb5abd..662e421feb 100644 --- a/doc/reference/tooling/tt_cli/help.rst +++ b/doc/reference/tooling/tt_cli/help.rst @@ -3,9 +3,9 @@ Displaying help for tt and its commands ======================================= -.. code-block:: bash +.. code-block:: console - tt help [COMMAND] + $ tt help [COMMAND] ``tt help`` displays help: @@ -17,12 +17,12 @@ Examples * Display ``tt`` help - .. code-block:: bash + .. code-block:: console - tt help + $ tt help * Display help for the ``start`` command: - .. code-block:: bash + .. code-block:: console - tt help start \ No newline at end of file + $ tt help start \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/index.rst b/doc/reference/tooling/tt_cli/index.rst index d5ca5c6742..0396f99048 100644 --- a/doc/reference/tooling/tt_cli/index.rst +++ b/doc/reference/tooling/tt_cli/index.rst @@ -19,7 +19,7 @@ concept explanation, and the ``tt`` command reference. installation configuration - arguments + global_options commands external_modules diff --git a/doc/reference/tooling/tt_cli/init.rst b/doc/reference/tooling/tt_cli/init.rst index f845a39075..a4a9cee48c 100644 --- a/doc/reference/tooling/tt_cli/init.rst +++ b/doc/reference/tooling/tt_cli/init.rst @@ -3,9 +3,9 @@ Creating a tt environment ========================= -.. code-block:: bash +.. code-block:: console - tt init + $ tt init ``tt init`` creates a ``tt`` environment in the current directory. This includes: @@ -47,6 +47,6 @@ Example Create a ``tt`` environment in the current directory: -.. code-block:: bash +.. code-block:: console - tt init \ No newline at end of file + $ tt init \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/install.rst b/doc/reference/tooling/tt_cli/install.rst index 861419cb48..e8b2e7e829 100644 --- a/doc/reference/tooling/tt_cli/install.rst +++ b/doc/reference/tooling/tt_cli/install.rst @@ -3,9 +3,9 @@ Installing Tarantool software ============================= -.. code-block:: bash +.. code-block:: console - tt install PROGRAM_NAME [version] [flags] + $ tt install PROGRAM_NAME [VERSION] [OPTION ...] ``tt install`` installs the latest or an explicitly specified version of Tarantool or ``tt``. The possible values of ``PROGRAM_NAME`` are: @@ -21,31 +21,37 @@ or ``tt``. The possible values of ``PROGRAM_NAME`` are: (see the :ref:`ee section ` of the configuration file) or provide them interactively. -Flags ------ +Options +------- + +.. option:: --dynamic + + **Applicable to:** ``tarantool``, ``tarantool-ee`` + + Use dynamic linking for building Tarantool. + +.. option:: -f, --force + + Skip dependency check before installation. + +.. option:: --local-repo + + Install a program from the local repository, which is specified in the + :ref:`repo section ` of the ``tt`` configuration file. + +.. option:: --no-clean + + Don't delete temporary files. + +.. option:: --reinstall -.. container:: table + Reinstall a previously installed program. - .. list-table:: - :widths: 20 80 - :header-rows: 0 +.. option:: --use-docker - * - ``--dynamic`` - - (``tarantool`` and ``tarantool-ee``) Use dynamic linking for building Tarantool - * - ``-f`` + **Applicable to:** ``tarantool``, ``tarantool-ee`` - ``--force`` - - Skip dependency check before installation - * - ``--local-repo`` - - Install a program from the local repository, which is specified - in the :ref:`repo section ` of the ``tt`` - configuration file - * - ``--no-clean`` - - Don't delete temporary files - * - ``--reinstall`` - - Reinstall a previously installed program - * - ``--use-docker`` - - (``tarantool`` and ``tarantool-ee``) Build Tarantool in an Ubuntu 18.04 Docker container + Build Tarantool in an Ubuntu 18.04 Docker container. Details ------- @@ -71,24 +77,24 @@ Example * Install the latest available version of Tarantool: - .. code-block:: bash + .. code-block:: console - tt install tarantool + $ tt install tarantool * Install Tarantool 2.11.1 from the local repository: - .. code-block:: bash + .. code-block:: console - tt install tarantool 2.11.1 --local-repo + $ tt install tarantool 2.11.1 --local-repo * Reinstall Tarantool 2.10.8: - .. code-block:: bash + .. code-block:: console - tt install tarantool 2.10.8 --reinstall + $ tt install tarantool 2.10.8 --reinstall * Install Tarantool :ref:`built from sources `: - .. code-block:: bash + .. code-block:: console - tt install tarantool-dev ~/src/tarantool/build + $ tt install tarantool-dev ~/src/tarantool/build diff --git a/doc/reference/tooling/tt_cli/instances.rst b/doc/reference/tooling/tt_cli/instances.rst index a71e110ab1..e188cfc768 100644 --- a/doc/reference/tooling/tt_cli/instances.rst +++ b/doc/reference/tooling/tt_cli/instances.rst @@ -3,9 +3,9 @@ Listing enabled applications ============================ -.. code-block:: bash +.. code-block:: console - tt instances + $ tt instances ``tt instances`` shows the list of enabled applications. @@ -21,6 +21,6 @@ Example * Show the list of enabled applications: - .. code-block:: bash + .. code-block:: console - tt instances \ No newline at end of file + $ tt instances \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/logrotate.rst b/doc/reference/tooling/tt_cli/logrotate.rst index 62ad8b9907..bfb7a68bf0 100644 --- a/doc/reference/tooling/tt_cli/logrotate.rst +++ b/doc/reference/tooling/tt_cli/logrotate.rst @@ -3,9 +3,9 @@ Rotating instance logs ====================== -.. code-block:: bash +.. code-block:: console - tt logrotate INSTANCE + $ tt logrotate {INSTANCE | APPLICATION[:APP_INSTANCE]} ``tt logrotate`` rotates logs of a specified Tarantool instance. Learn more about :ref:`rotating logs `. @@ -15,6 +15,6 @@ Examples Rotate logs of the ``app`` instance: -.. code-block:: bash +.. code-block:: console - tt logrotate app \ No newline at end of file + $ tt logrotate app \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/pack.rst b/doc/reference/tooling/tt_cli/pack.rst index 6f07b2ba45..8d1b62b705 100644 --- a/doc/reference/tooling/tt_cli/pack.rst +++ b/doc/reference/tooling/tt_cli/pack.rst @@ -3,9 +3,9 @@ Packaging the application ========================= -.. code-block:: bash +.. code-block:: console - tt pack TYPE [options] .. + $ tt pack TYPE [OPTION ...] .. ``tt pack`` packages an application into a distributable bundle of the specified ``TYPE``: @@ -17,7 +17,7 @@ The command below creates a DEB package for an application: .. code-block:: console - tt pack deb + $ tt pack deb This command generates a ``.deb`` file whose name depends on the environment directory name and the operating system architecture, for example, ``test-env_0.1.0.0-1_x86_64.deb``. You can also pass various :ref:`options ` to the ``tt pack`` command to adjust generation properties, for example, customize a bundle name, choose which artifacts should be included, specify the required application dependencies. @@ -41,7 +41,7 @@ Options .. code-block:: console - tt pack tgz --app-list app1,app3 + $ tt pack tgz --app-list app1,app3 .. option:: --cartridge-compat @@ -59,7 +59,7 @@ Options .. code-block:: console - tt pack deb --deps 'wget,make>0.1.0,unzip>1,unzip<=7' + $ tt pack deb --deps 'wget,make>0.1.0,unzip>1,unzip<=7' .. option:: --deps-file STRING @@ -78,7 +78,7 @@ Options .. code-block:: console - tt pack deb --deps-file package-deps.txt + $ tt pack deb --deps-file package-deps.txt .. option:: --filename @@ -88,7 +88,7 @@ Options .. code-block:: console - tt pack tgz --filename sample-app.tar.gz + $ tt pack tgz --filename sample-app.tar.gz .. option:: --name PACKAGE_NAME @@ -98,7 +98,7 @@ Options .. code-block:: console - tt pack tgz --name sample-app --version 1.0.1 + $ tt pack tgz --name sample-app --version 1.0.1 .. option:: --preinst @@ -110,7 +110,7 @@ Options .. code-block:: console - tt pack deb --preinst pre.sh + $ tt pack deb --preinst pre.sh .. option:: --postinst @@ -122,7 +122,7 @@ Options .. code-block:: console - tt pack deb --postinst post.sh + $ tt pack deb --postinst post.sh .. option:: --use-docker @@ -137,7 +137,7 @@ Options .. code-block:: console - tt pack tgz --name sample-app --version 1.0.1 + $ tt pack tgz --name sample-app --version 1.0.1 .. option:: --with-binaries diff --git a/doc/reference/tooling/tt_cli/play.rst b/doc/reference/tooling/tt_cli/play.rst index e04bbb3768..273697c358 100644 --- a/doc/reference/tooling/tt_cli/play.rst +++ b/doc/reference/tooling/tt_cli/play.rst @@ -3,33 +3,41 @@ Playing the contents of .snap and .xlog files to a Tarantool instance ===================================================================== -.. code-block:: bash +.. code-block:: console - tt play URI FILE .. [flags] + $ tt play URI FILE ... [OPTION ...] ``tt play`` plays the contents of :ref:`snapshot ` (``.snap``) and :ref:`WAL ` (``.xlog``) files to another Tarantool instance. A single call of ``tt play`` can play multiple files. -Flags ------ +Options +------- + +.. option:: --from LSN + + Play operations starting from the given LSN. + +.. option:: --to LSN + + Play operations up to the given LSN. Default: ``18446744073709551615``. + +.. option:: --replica ID -.. container:: table + Filter the operations by replica ID. Can be passed more than once. - .. list-table:: - :widths: 20 80 - :header-rows: 0 + When calling ``tt cat`` with filters by LSN (``--from`` and ``--to`` flags) and + replica ID (``--replica``), remember that LSNs differ across replicas. + Thus, if you pass more than one replica ID via ``--from`` or ``--to``, + the result may not reflect the actual sequence of operations. - * - ``--from`` - - Play operations starting from the given LSN - * - ``--to`` - - Play operations up to the given LSN. Default: 18446744073709551615 - * - ``--replica`` - - Filter the operations by replica id. Can be passed more than once - * - ``--space`` - - Filter the operations by space id. Can be passed more than once - * - ``--show-system`` - - Play the operations on system spaces +.. option:: --space ID + + Filter the output by space ID. Can be passed more than once. + +.. option:: --show-system + + Show the operations on system spaces. Details ------- @@ -49,31 +57,25 @@ on this instance. This means that: * Replica IDs will change in accordance with the destination instance configuration. - -When calling ``tt play`` with filters by LSN (``--from`` and ``--to`` flags) and -replica ID (``--replica``), remember that LSNs differ across replicas. -Thus, if you pass more than one replica ID via ``--from`` or ``--to``, -the result may not reflect the actual sequence of operations. - Examples -------- * Play the contents of ``00000000000000000000.xlog`` to the instance on ``192.168.10.10:3301``: - .. code-block:: bash + .. code-block:: console - tt play 192.168.10.10:3301 00000000000000000000.xlog + $ tt play 192.168.10.10:3301 00000000000000000000.xlog * Play operations on spaces with ``space_id`` 512 and 513 from the ``00000000000000000012.snap`` snapshot file: - .. code-block:: bash + .. code-block:: console - tt play 192.168.10.10:3301 00000000000000000012.snap --space 512 --space 513 + $ tt play 192.168.10.10:3301 00000000000000000012.snap --space 512 --space 513 * Play the contents of ``00000000000000000000.xlog`` including operations on system spaces: - .. code-block:: bash + .. code-block:: console - tt play 192.168.10.10:3301 00000000000000000000.xlog --show-system + $ tt play 192.168.10.10:3301 00000000000000000000.xlog --show-system diff --git a/doc/reference/tooling/tt_cli/restart.rst b/doc/reference/tooling/tt_cli/restart.rst index 418958bf5f..8b46b98840 100644 --- a/doc/reference/tooling/tt_cli/restart.rst +++ b/doc/reference/tooling/tt_cli/restart.rst @@ -3,9 +3,9 @@ Restarting a Tarantool instance =============================== -.. code-block:: bash +.. code-block:: console - tt restart INSTANCE + $ tt restart {INSTANCE | APPLICATION[:APP_INSTANCE]} [OPTION ...] ``tt restart`` restarts the specified running Tarantool instance. A ``tt restart`` call is equivalent to consecutive calls of @@ -21,9 +21,27 @@ Options Examples -------- +Single instance +~~~~~~~~~~~~~~~ + Restart the ``app`` instance with automatic confirmation: -.. code-block:: bash +.. code-block:: console + + $ tt restart app -y + +Multiple instances +~~~~~~~~~~~~~~~~~~ + +* Restart all instances of the application stored in the ``app/`` directory inside + ``instances_enabled`` in accordance with the :ref:`instances configuration `: + + .. code-block:: console + + $ tt restart app + +* Restart only the ``master`` instance of the application stored in the ``app/`` directory inside ``instances_enabled``: - tt restart app -y + .. code-block:: console + $ tt restart app:master \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/rocks.rst b/doc/reference/tooling/tt_cli/rocks.rst index 8978a4ef82..7f2a80cd5e 100644 --- a/doc/reference/tooling/tt_cli/rocks.rst +++ b/doc/reference/tooling/tt_cli/rocks.rst @@ -3,9 +3,9 @@ Using the LuaRocks package manager ================================== -.. code-block:: bash +.. code-block:: console - tt rocks [FLAG ...] [VAR=VALUE] COMMAND [ARGUMENT] + $ tt rocks [OPTION ...] [VAR=VALUE] COMMAND [ARGUMENT] ``tt rocks`` provides means to manage Lua modules (rocks) via the `LuaRocks `_ package manager. `tt` uses its own @@ -14,42 +14,54 @@ LuaRocks installation connected to the `Tarantool rocks repository `_. -Flags ------ +Options +------- -.. container:: table +.. option:: --dev - .. list-table:: - :widths: 30 70 - :header-rows: 0 + Enable the sub-repositories in rocks servers for rockspecs of in-development versions. + +.. option:: --server=SERVER + + Fetch rocks/rockspecs from this server (takes priority over config file). + +.. option:: --only-server=SERVER + + Fetch rocks/rockspecs from this server only (overrides any entries in the config file). + +.. option:: --only-sources=URL + + Restrict downloads to paths matching the given URL. + +.. option:: --lua-dir=PREFIX + + Specify which Lua installation to use + +.. option:: --lua-version=VERSION + + Specify which Lua version to use. + +.. option:: --tree=TREE + + Specify which tree to operate on. + +.. option:: --local + + Use the tree in the user's home directory. + Call ``tt rocks help path`` to learn how to enable it. + +.. option:: --global + + Use the system tree when ``local_by_default`` is ``true``. + +.. option:: --verbose + + Display verbose output for the command executed. + +.. option:: --timeout=SECONDS - * - ``--dev`` - - Enable the sub-repositories in rocks servers - for rockspecs of in-development versions - * - ``--server=`` - - Fetch rocks/rockspecs from this server - (takes priority over config file) - * - ``--only-server=`` - - Fetch rocks/rockspecs from this server only - (overrides any entries in the config file) - * - ``--only-sources=`` - - Restrict downloads to paths matching the given URL - * - ``--lua-dir=`` - - Specify which Lua installation to use - * - ``--lua-version=`` - - Specify which Lua version to use - * - ``--tree=`` - - Specify which tree to operate on - * - ``--local`` - - Use the tree in the user's home directory. - Call ``tt rocks help path`` to learn how to enable it - * - ``--global`` - - Use the system tree when `local_by_default` is `true` - * - ``--verbose`` - - Display verbose output for the command executed - * - ``--timeout=`` - - Timeout on network operations, in seconds. - 0 means no timeout (wait forever). Default: 30 + Timeout on network operations, in seconds. + ``0`` means no timeout (wait forever). Default: ``30``. Commands -------- @@ -108,40 +120,40 @@ Examples * Install the rock ``queue`` from the Tarantool rocks repository: - .. code-block:: bash + .. code-block:: console - tt rocks install queue + $ tt rocks install queue * Search for the rock ``queue`` in **both** the Tarantool rocks repository and the `default LuaRocks repository `_: - .. code-block:: bash + .. code-block:: console - tt rocks search queue --server='https://luarocks.org' + $ tt rocks search queue --server='https://luarocks.org' * List the documentation files for the installed rock ``queue``: - .. code-block:: bash + .. code-block:: console - tt rocks doc queue --list + $ tt rocks doc queue --list Without the ``--list`` flag, this command displays documentation in the user's default browser. * Create a ``*.rock`` file from the installed rock ``queue``: - .. code-block:: bash + .. code-block:: console - tt rocks pack queue + $ tt rocks pack queue * Unpack a ``*.rock`` file: - .. code-block:: bash + .. code-block:: console - tt rocks unpack queue-scm-1.all.rock + $ tt rocks unpack queue-scm-1.all.rock * Remove the installed rock ``queue``: - .. code-block:: bash + .. code-block:: console - tt rocks remove queue + $ tt rocks remove queue \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/run.rst b/doc/reference/tooling/tt_cli/run.rst index d2a6452e7e..26b7d204c4 100644 --- a/doc/reference/tooling/tt_cli/run.rst +++ b/doc/reference/tooling/tt_cli/run.rst @@ -3,37 +3,30 @@ Running code in a Tarantool instance ==================================== -.. code-block:: bash +.. code-block:: console - tt run [SCRIPT|-e EXPR] [flags] + $ tt run [SCRIPT|-e EXPR] [OPTION ...] ``tt run`` executes Lua code in a Tarantool instance. -Flags ------ +Options +------- + +.. option:: -e EXPR, --evaluate EXPR -.. container:: table + Execute the specified expression in a Tarantool instance. - .. list-table:: - :widths: 30 70 - :header-rows: 0 +.. option:: -l LIB_NAME, --library LIB_NAME - * - ``-e EXPR`` + Require the specified library. - ``--evaluate EXPR`` - - Execute the specified expression in a Tarantool instance - * - ``-l LIB_NAME`` +.. option:: -i, --interactive - ``--library LIB_NAME`` - - Require the specified library - * - ``-i`` + Enter the interactive mode after the script execution. - ``--interactive`` - - Enter the interactive mode after the script execution - * - ``-v`` +.. option:: -v, --version - ``--version`` - - Print the Tarantool version that is used for script execution + Print the Tarantool version that is used for script execution. Details ------- @@ -54,18 +47,18 @@ Examples * Execute the ``app.lua`` file in a Tarantool instance: - .. code-block:: bash + .. code-block:: console - tt run app.lua + $ tt run app.lua * Execute an expression in a Tarantool instance: - .. code-block:: bash + .. code-block:: console - tt run -e "print('hi there')" + $ tt run -e "print('hi there')" * Execute the ``app.lua`` file in a Tarantool instance and leave it running: - .. code-block:: bash + .. code-block:: console - tt run app.lua -i + $ tt run app.lua -i diff --git a/doc/reference/tooling/tt_cli/search.rst b/doc/reference/tooling/tt_cli/search.rst index 5f05732fd6..040cc9e0e7 100644 --- a/doc/reference/tooling/tt_cli/search.rst +++ b/doc/reference/tooling/tt_cli/search.rst @@ -3,9 +3,9 @@ Listing available Tarantool versions ==================================== -.. code-block:: bash +.. code-block:: console - tt search PROGRAM_NAME [flags] + $ tt search PROGRAM_NAME [OPTION ...] ``tt search`` lists versions of Tarantool and ``tt`` that are available for installation. The possible values of ``PROGRAM_NAME`` are: @@ -20,35 +20,37 @@ installation. The possible values of ``PROGRAM_NAME`` are: (see the :ref:`ee section ` of the configuration file) or provide interactively. -Flags ------ +Options +------- -.. container:: table +.. option:: --debug - .. list-table:: - :widths: 20 80 - :header-rows: 0 + **Applicable to:** ``taranttol-ee`` - * - ``--debug`` - - (``tarantool-ee`` only) Search for debug builds of Tarantool Enterprise SDK - * - ``--local-repo`` - - Search in the local repository, which is specified in the - :ref:`repo section ` of the ``tt`` - configuration file - * - ``--version`` - - (``tarantool-ee`` only) Tarantool Enterprise version + Search for debug builds of Tarantool Enterprise SDK. + +.. option:: --local-repo + + Search in the local repository, which is specified in the + :ref:`repo section ` of the ``tt`` configuration file. + +.. option:: --version VERSION + + **Applicable to:** ``taranttol-ee`` + + Tarantool Enterprise version. Example -------- * List available Tarantool versions: - .. code-block:: bash + .. code-block:: console - tt search tarantool + $ tt search tarantool * List available ``tt`` versions from the local repository: - .. code-block:: bash + .. code-block:: console - tt search --local-repo tt \ No newline at end of file + $ tt search --local-repo tt \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/start.rst b/doc/reference/tooling/tt_cli/start.rst index dc4f4d3017..9bae9fe4a4 100644 --- a/doc/reference/tooling/tt_cli/start.rst +++ b/doc/reference/tooling/tt_cli/start.rst @@ -3,9 +3,9 @@ Starting a Tarantool instance ============================= -.. code-block:: bash +.. code-block:: console - tt start APPLICATION + $ tt start {INSTANCE | APPLICATION[:APP_INSTANCE]} ``tt start`` starts Tarantool applications. @@ -32,9 +32,9 @@ Single instance * Start an instance with the ``app.lua`` application from the ``instances_enabled`` directory: - .. code-block:: bash + .. code-block:: console - tt start app + $ tt start app Multiple instances @@ -43,12 +43,12 @@ Multiple instances * Start all instances of the application stored in the ``app/`` directory inside ``instances_enabled`` in accordance with the :ref:`instances configuration `: - .. code-block:: bash + .. code-block:: console - tt start app + $ tt start app * Start only the ``master`` instance of the application stored in the ``app/`` directory inside ``instances_enabled``: - .. code-block:: bash + .. code-block:: console - tt start app:master \ No newline at end of file + $ tt start app:master \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/status.rst b/doc/reference/tooling/tt_cli/status.rst index 990b9b71cd..cfc35c0499 100644 --- a/doc/reference/tooling/tt_cli/status.rst +++ b/doc/reference/tooling/tt_cli/status.rst @@ -3,9 +3,9 @@ Checking instance status ======================== -.. code-block:: bash +.. code-block:: console - tt status INSTANCE|APPLICATION + $ tt status {INSTANCE | APPLICATION[:APP_INSTANCE]} ``tt status`` prints the current status of the specified Tarantool instance or all instances of an application. @@ -18,21 +18,21 @@ Single instance * Check the status of the ``app`` instance: - .. code-block:: bash + .. code-block:: console - tt status app + $ tt status app Multiple instances ~~~~~~~~~~~~~~~~~~ * Check the status of all instances of the ``app`` application: - .. code-block:: bash + .. code-block:: console - tt status app + $ tt status app * Check the status of the ``replica`` instance of the ``app`` application: - .. code-block:: bash + .. code-block:: console - tt status app:replica \ No newline at end of file + $ tt status app:replica \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/stop.rst b/doc/reference/tooling/tt_cli/stop.rst index 0c1807ad96..ef15754408 100644 --- a/doc/reference/tooling/tt_cli/stop.rst +++ b/doc/reference/tooling/tt_cli/stop.rst @@ -3,9 +3,9 @@ Stopping a Tarantool instance ============================= -.. code-block:: bash +.. code-block:: console - tt stop INSTANCE|APPLICATION + $ tt stop {INSTANCE | APPLICATION[:APP_INSTANCE]} ``tt stop`` stops the specified running Tarantool instances. @@ -14,23 +14,24 @@ Examples Single instance ~~~~~~~~~~~~~~~ + * Stop the ``app`` instance: - .. code-block:: bash + .. code-block:: console - tt stop app + $ tt stop app Multiple instances ~~~~~~~~~~~~~~~~~~ * Stop all instances of the ``app`` application: - .. code-block:: bash + .. code-block:: console - tt stop app + $ tt stop app * Stop the ``replica`` instance of the ``app`` application: - .. code-block:: bash + .. code-block:: console - tt stop app:replica \ No newline at end of file + $ tt stop app:replica \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/uninstall.rst b/doc/reference/tooling/tt_cli/uninstall.rst index c092b0b906..b61a1317ac 100644 --- a/doc/reference/tooling/tt_cli/uninstall.rst +++ b/doc/reference/tooling/tt_cli/uninstall.rst @@ -3,9 +3,9 @@ Uninstalling Tarantool software =============================== -.. code-block:: bash +.. code-block:: console - tt uninstall PROGRAM_NAME [version] + $ tt uninstall PROGRAM_NAME [VERSION] ``tt uninstall`` uninstalls a previously :doc:`installed ` Tarantool version. @@ -14,6 +14,6 @@ Example Uninstall Tarantool 2.10.4: -.. code-block:: bash +.. code-block:: console - tt uninstall tarantool 2.10.4 \ No newline at end of file + $ tt uninstall tarantool 2.10.4 \ No newline at end of file diff --git a/doc/reference/tooling/tt_cli/version.rst b/doc/reference/tooling/tt_cli/version.rst index 9c9429495d..a7f8e688ac 100644 --- a/doc/reference/tooling/tt_cli/version.rst +++ b/doc/reference/tooling/tt_cli/version.rst @@ -3,8 +3,8 @@ Displaying the tt version ========================= -.. code-block:: bash +.. code-block:: console - tt version + $ tt version ``tt version`` shows the version of the ``tt`` utility being used. \ No newline at end of file