Skip to content

Commit

Permalink
Add tt console docs (#3994)
Browse files Browse the repository at this point in the history
Resolves #3734
Resolves #3820

* Add tt console docs
* Add tt connect SSL options
  • Loading branch information
p7nov authored Jan 22, 2024
1 parent a4fb69c commit 9cb1798
Show file tree
Hide file tree
Showing 5 changed files with 394 additions and 11 deletions.
2 changes: 1 addition & 1 deletion doc/reference/tooling/tcm/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ in an instance's console.
executable for Linux platforms.

|tcm| works only with Tarantool EE clusters that use centralized configuration in
:ref:`etcd <configuration_etcd>` or a Tarantool-based storage.
:ref:`etcd <configuration_etcd>` or a Tarantool-based configuration storage.
When you create or edit a cluster's configuration in |tcm|, it publishes the saved
configuration to the storage. This ensures consistent and reliable configuration storage.
A single |tcm| installation can connect to multiple Tarantool EE clusters and
Expand Down
34 changes: 34 additions & 0 deletions doc/reference/tooling/tcm/tcm_quick_start.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _tcm_quick_start
Quick start with TCM
====================

.. include:: index.rst
:start-after: ee_note_tcm_start
:end-before: ee_note_tcm_end

This guide explain how to get |tcm_full_name| up and running on your local system.

?? location: howto or TCM?

Prerequisites
-------------

- Linux
- macOS?
- SDK archive (how to obtain)

Setting up Tarantool EE
-----------------------

Preparing TCM environment
-------------------------

Starting TCM
------------

Logging in
----------

Adding a cluster ? do we need further steps?
----------------
93 changes: 83 additions & 10 deletions doc/reference/tooling/tt_cli/connect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,56 @@ Connecting to a Tarantool instance
$ tt connect {URI|INSTANCE} [OPTION ...]
``tt connect`` connects to a Tarantool instance by its URI or name specified
during its startup (``tt start``).
``tt connect`` connects to a Tarantool instance by its URI or instance name specified
in the current environment.

Options
-------

.. option:: -u USERNAME, --username USERNAME

Username
A Tarantool user for connecting to the instance.

.. option:: -p PASSWORD, --password PASSWORD

Password
The user's password.

.. option:: -f FILEPATH, --file FILEPATH

Connect and evaluate the script from a file.

``-`` – read the script from stdin.

.. option:: -i, --interactive

Enter the interactive mode after evaluating the script passed in ``-f``/``--file``.

.. option:: -l LANGUAGE, --language LANGUAGE

The input language of the :ref:`tt interactive console <tt-interactive-console>`:
``lua`` (default) or ``sql``.

.. option:: -x FORMAT, --outputformat FORMAT

The output format of the :ref:`tt interactive console <tt-interactive-console>`:
``yaml`` (default), ``lua``, ``table``, ``ttable``.

.. option:: --sslcertfile FILEPATH

The path to an SSL certificate file for encrypted connections.

.. option:: --sslkeyfile FILEPATH

The path to a private SSL key file for encrypted connections.

.. option:: --sslcafile FILEPATH

The path to a trusted certificate authorities (CA) file for encrypted connections.

.. option:: --sslciphers STRING

The list of SSL cipher suites used for encrypted connections, separated by colons (``:``).

Details
-------

Expand All @@ -38,14 +68,57 @@ You can also connect to instances in the same ``tt`` environment
(that is, those that use the same :ref:`configuration file <tt-config_file>` and Tarantool installation)
by their instance names.

If authentication is required, specify the username and the password using the ``-u`` (``--username``)
and ``-p`` (``--password``) options.
Authentication
~~~~~~~~~~~~~~

When connecting to an instance by its URI, ``tt connect`` establishes a remote connection
for which authentication is required. Use one of the following ways to pass the
username and the password:

* The ``-u`` (``--username``) and ``-p`` (``--password``) options:

.. code-block:: console
By default, ``tt connect`` opens an interactive Tarantool console. Alternatively, you
can open a connection to evaluate a Lua script from a file or stdin. To do this,
pass the file path in the ``-f`` (``--file``) option or use ``-f -`` to take the script
from stdin.
$ tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD
* The connection string:

.. code-block:: console
$ tt connect myuser:[email protected]:3301 -u myuser -p p4$$w0rD
* Environment variables ``TT_CLI_USERNAME`` and ``TT_CLI_PASSWORD`` :

.. code-block:: console
$ export TT_CLI_USERNAME=myuser
$ export TT_CLI_PASSWORD=p4$$w0rD
$ tt connect 192.168.10.10:3301
If no credentials are provided for a remote connection, the user is automatically ``guest``.

.. note::

Local connections (by instance name instead of the URI) don't require authentication.

Encrypted connection
~~~~~~~~~~~~~~~~~~~~

To connect to instances that use SSL encryption, provide the SSL certificate and
SSL key files in the ``--sslcertfile`` and ``--sslkeyfile`` options. If necessary,
add other SSL parameters -- ``--sslcafile`` and ``--sslciphers``.

Script evaluation
~~~~~~~~~~~~~~~~~

By default, ``tt connect`` opens an :ref:`interactive tt console <tt-interactive-console>`.
Alternatively, you can open a connection to evaluate a Lua script from a file or stdin.
To do this, pass the file path in the ``-f`` (``--file``) option or use ``-f -``
to take the script from stdin.

.. code-block:: console
$ tt connect app -f test.lua
Examples
--------
Expand Down
1 change: 1 addition & 0 deletions doc/reference/tooling/tt_cli/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ concept explanation, and the ``tt`` command reference.
global_options
commands
external_modules
tt_interactive_console

.. _tt-cli-environments:

Expand Down
Loading

0 comments on commit 9cb1798

Please sign in to comment.