@@ -8,26 +8,56 @@ Connecting to a Tarantool instance
8
8
$ tt connect {URI|INSTANCE} [OPTION ...]
9
9
10
10
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 .
13
13
14
14
Options
15
15
-------
16
16
17
17
.. option :: -u USERNAME , --username USERNAME
18
18
19
- Username
19
+ A Tarantool user for connecting to the instance.
20
20
21
21
.. option :: -p PASSWORD , --password PASSWORD
22
22
23
- Password
23
+ The user's password.
24
24
25
25
.. option :: -f FILEPATH , --file FILEPATH
26
26
27
27
Connect and evaluate the script from a file.
28
28
29
29
``- `` – read the script from stdin.
30
30
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
+
31
61
Details
32
62
-------
33
63
@@ -38,14 +68,57 @@ You can also connect to instances in the same ``tt`` environment
38
68
(that is, those that use the same :ref: `configuration file <tt-config_file >` and Tarantool installation)
39
69
by their instance names.
40
70
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
43
81
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
48
120
121
+ $ tt connect app -f test.lua
49
122
50
123
Examples
51
124
--------
0 commit comments