Skip to content

Commit 9cb1798

Browse files
authored
Add tt console docs (#3994)
Resolves #3734 Resolves #3820 * Add tt console docs * Add tt connect SSL options
1 parent a4fb69c commit 9cb1798

File tree

5 files changed

+394
-11
lines changed

5 files changed

+394
-11
lines changed

doc/reference/tooling/tcm/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ in an instance's console.
2222
executable for Linux platforms.
2323

2424
|tcm| works only with Tarantool EE clusters that use centralized configuration in
25-
:ref:`etcd <configuration_etcd>` or a Tarantool-based storage.
25+
:ref:`etcd <configuration_etcd>` or a Tarantool-based configuration storage.
2626
When you create or edit a cluster's configuration in |tcm|, it publishes the saved
2727
configuration to the storage. This ensures consistent and reliable configuration storage.
2828
A single |tcm| installation can connect to multiple Tarantool EE clusters and
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.. _tcm_quick_start
2+
3+
Quick start with TCM
4+
====================
5+
6+
.. include:: index.rst
7+
:start-after: ee_note_tcm_start
8+
:end-before: ee_note_tcm_end
9+
10+
This guide explain how to get |tcm_full_name| up and running on your local system.
11+
12+
?? location: howto or TCM?
13+
14+
Prerequisites
15+
-------------
16+
17+
- Linux
18+
- macOS?
19+
- SDK archive (how to obtain)
20+
21+
Setting up Tarantool EE
22+
-----------------------
23+
24+
Preparing TCM environment
25+
-------------------------
26+
27+
Starting TCM
28+
------------
29+
30+
Logging in
31+
----------
32+
33+
Adding a cluster ? do we need further steps?
34+
----------------

doc/reference/tooling/tt_cli/connect.rst

Lines changed: 83 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,56 @@ Connecting to a Tarantool instance
88
$ tt connect {URI|INSTANCE} [OPTION ...]
99
1010
11-
``tt connect`` connects to a Tarantool instance by its URI or name specified
12-
during its startup (``tt start``).
11+
``tt connect`` connects to a Tarantool instance by its URI or instance name specified
12+
in the current environment.
1313

1414
Options
1515
-------
1616

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

19-
Username
19+
A Tarantool user for connecting to the instance.
2020

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

23-
Password
23+
The user's password.
2424

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

2727
Connect and evaluate the script from a file.
2828

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

31+
.. option:: -i, --interactive
32+
33+
Enter the interactive mode after evaluating the script passed in ``-f``/``--file``.
34+
35+
.. option:: -l LANGUAGE, --language LANGUAGE
36+
37+
The input language of the :ref:`tt interactive console <tt-interactive-console>`:
38+
``lua`` (default) or ``sql``.
39+
40+
.. option:: -x FORMAT, --outputformat FORMAT
41+
42+
The output format of the :ref:`tt interactive console <tt-interactive-console>`:
43+
``yaml`` (default), ``lua``, ``table``, ``ttable``.
44+
45+
.. option:: --sslcertfile FILEPATH
46+
47+
The path to an SSL certificate file for encrypted connections.
48+
49+
.. option:: --sslkeyfile FILEPATH
50+
51+
The path to a private SSL key file for encrypted connections.
52+
53+
.. option:: --sslcafile FILEPATH
54+
55+
The path to a trusted certificate authorities (CA) file for encrypted connections.
56+
57+
.. option:: --sslciphers STRING
58+
59+
The list of SSL cipher suites used for encrypted connections, separated by colons (``:``).
60+
3161
Details
3262
-------
3363

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

41-
If authentication is required, specify the username and the password using the ``-u`` (``--username``)
42-
and ``-p`` (``--password``) options.
71+
Authentication
72+
~~~~~~~~~~~~~~
73+
74+
When connecting to an instance by its URI, ``tt connect`` establishes a remote connection
75+
for which authentication is required. Use one of the following ways to pass the
76+
username and the password:
77+
78+
* The ``-u`` (``--username``) and ``-p`` (``--password``) options:
79+
80+
.. code-block:: console
4381
44-
By default, ``tt connect`` opens an interactive Tarantool console. Alternatively, you
45-
can open a connection to evaluate a Lua script from a file or stdin. To do this,
46-
pass the file path in the ``-f`` (``--file``) option or use ``-f -`` to take the script
47-
from stdin.
82+
$ tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD
83+
84+
* The connection string:
85+
86+
.. code-block:: console
87+
88+
$ tt connect myuser:[email protected]:3301 -u myuser -p p4$$w0rD
89+
90+
* Environment variables ``TT_CLI_USERNAME`` and ``TT_CLI_PASSWORD`` :
91+
92+
.. code-block:: console
93+
94+
$ export TT_CLI_USERNAME=myuser
95+
$ export TT_CLI_PASSWORD=p4$$w0rD
96+
$ tt connect 192.168.10.10:3301
97+
98+
If no credentials are provided for a remote connection, the user is automatically ``guest``.
99+
100+
.. note::
101+
102+
Local connections (by instance name instead of the URI) don't require authentication.
103+
104+
Encrypted connection
105+
~~~~~~~~~~~~~~~~~~~~
106+
107+
To connect to instances that use SSL encryption, provide the SSL certificate and
108+
SSL key files in the ``--sslcertfile`` and ``--sslkeyfile`` options. If necessary,
109+
add other SSL parameters -- ``--sslcafile`` and ``--sslciphers``.
110+
111+
Script evaluation
112+
~~~~~~~~~~~~~~~~~
113+
114+
By default, ``tt connect`` opens an :ref:`interactive tt console <tt-interactive-console>`.
115+
Alternatively, you can open a connection to evaluate a Lua script from a file or stdin.
116+
To do this, pass the file path in the ``-f`` (``--file``) option or use ``-f -``
117+
to take the script from stdin.
118+
119+
.. code-block:: console
48120
121+
$ tt connect app -f test.lua
49122
50123
Examples
51124
--------

doc/reference/tooling/tt_cli/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ concept explanation, and the ``tt`` command reference.
2727
global_options
2828
commands
2929
external_modules
30+
tt_interactive_console
3031

3132
.. _tt-cli-environments:
3233

0 commit comments

Comments
 (0)