Skip to content

Commit 52e2f17

Browse files
authored
Add tt 2.4.0 features: log, enable, --self, start -i (#4475)
1 parent 093760a commit 52e2f17

File tree

8 files changed

+112
-23
lines changed

8 files changed

+112
-23
lines changed

doc/tooling/tt_cli/commands.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ help for the given command.
5454
- List enabled applications
5555
* - :doc:`kill <kill>`
5656
- Terminate Tarantool applications or instances
57+
* - :doc:`log <log>`
58+
- Print instance logs
5759
* - :doc:`logrotate <logrotate>`
5860
- Rotate instance logs
5961
* - :doc:`pack <pack>`
@@ -100,13 +102,15 @@ help for the given command.
100102
create <create>
101103
crud <crud>
102104
download <download>
105+
enable <enable>
103106
export <export>
104107
help <help>
105108
import <import>
106109
init <init>
107110
install <install>
108111
instances <instances>
109112
kill <kill>
113+
log <log>
110114
logrotate <logrotate>
111115
pack <pack>
112116
play <play>

doc/tooling/tt_cli/enable.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. _tt-enable:
2+
3+
Adding external applications to environments
4+
============================================
5+
6+
.. code-block:: console
7+
8+
$ tt enable {APPLICATION|SCRIPT}
9+
10+
``tt enable`` adds an external Tarantool application to the current environment
11+
by creating a symlink to it in the ``instances.enabled`` directory.
12+
13+
To add the application located in ``/home/tt-user/external_app`` to the current
14+
``tt`` environment:
15+
16+
.. code-block:: console
17+
18+
$ tt enable /home/tt-user/external_app
19+
20+
Once the application is added, you can work with it the same way as with applications
21+
created in this environment.

doc/tooling/tt_cli/global_options.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ Global options
4444
Use the ``tt`` environment from the specified directory.
4545
Learn more about the :ref:`local launch mode <tt-config_modes-local>`.
4646

47+
.. option:: -s, --self
48+
49+
Use the current ``tt`` version instead of executing the one located
50+
in the :ref:`bin_dir <tt-config_file_env>` directory.
51+
4752
.. option:: -S, --system
4853

4954
Use the ``tt`` environment installed in the system.

doc/tooling/tt_cli/kill.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ To terminate all instances of the ``app`` application:
1313

1414
.. code-block:: console
1515
16-
$ tt stop app
16+
$ tt kill app
1717
1818
To terminate the ``storage-001-r`` instance of the ``app`` application without confirmation:
1919

2020
.. code-block:: console
2121
22-
$ tt stop app:storage-001-r --force
22+
$ tt kill app:storage-001-r --force
2323
2424
To terminate the ``storage-001-r`` instance of the ``app`` application and generate its core dump:
2525

2626
.. code-block:: console
2727
28-
$ tt stop app:storage-001-r --dump
28+
$ tt kill app:storage-001-r --dump
2929
3030
Options
3131
-------

doc/tooling/tt_cli/log.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.. _tt-log:
2+
3+
Printing Tarantool logs
4+
=======================
5+
6+
.. code-block:: console
7+
8+
$ tt log [APPLICATION[:APP_INSTANCE]]
9+
10+
``tt log`` prints the last lines of instance logs.
11+
12+
To print 10 last log lines of all the ``app`` application instances:
13+
14+
.. code-block:: console
15+
16+
$ tt log app
17+
18+
To print 50 last log lines of the ``router`` instance of the ``app`` application:
19+
20+
.. code-block:: console
21+
22+
$ tt log -n 50 app:router
23+
24+
To keep printing logs of the ``app`` application instances as they grow:
25+
26+
.. code-block:: console
27+
28+
$ tt log -f app
29+
30+
Options
31+
-------
32+
33+
.. option:: -f, --follow
34+
35+
Keep printing new lines added to the log file.
36+
37+
.. option:: -n, --lines
38+
39+
The number of last lines to output. Default: ``10``.

doc/tooling/tt_cli/start.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Starting Tarantool applications
55

66
.. code-block:: console
77
8-
$ tt start APPLICATION[:APP_INSTANCE]
8+
$ tt start [APPLICATION[:APP_INSTANCE]]
99
1010
``tt start`` starts Tarantool applications. The application files must be stored
1111
inside the ``instances_enabled`` directory specified in the :ref:`tt configuration file <tt-config_file_app>`.
@@ -21,6 +21,13 @@ To start all instances of the application stored in the ``app`` directory inside
2121
2222
$ tt start app
2323
24+
To start all instances of the ``app`` application appending their logs to stdout
25+
(in the interactive mode):
26+
27+
.. code-block:: console
28+
29+
$ tt start -i app
30+
2431
To start the ``router`` instance of the ``app`` application:
2532

2633
.. code-block:: console
@@ -125,6 +132,14 @@ If an integrity check fails, ``tt`` stops the application.
125132
Options
126133
-------
127134

135+
.. option:: -i, --interactive
136+
137+
Start the application or instance in the interactive mode.
138+
In this mode, instance logs are printed to the standard output in real time.
139+
140+
You can use the ``SIGINT`` signal (``CTRL+C``) to stop ``tt`` and its child
141+
Tarantool processes in the interactive mode. No watchdog processes are created.
142+
128143
.. option:: --integrity-check-interval NUMBER
129144

130145
Integrity check interval in seconds. Default: 86400 (24 hours).

doc/tooling/tt_cli/stop.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Stopping a Tarantool instance
55

66
.. code-block:: console
77
8-
$ tt stop APPLICATION[:APP_INSTANCE]
8+
$ tt stop [APPLICATION[:APP_INSTANCE]]
99
1010
``tt stop`` stops the specified running Tarantool applications or instances.
1111
When called without arguments, stops all running applications in the current environment.

doc/tooling/tt_cli/tt_interactive_console.rst

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ using the ``\set output`` console command:
119119
app:storage001> \set output table
120120
app:storage001> box.space.bands:select { }
121121
+------+-------------+------+
122-
| col1 | col2 | col3 |
122+
| id | band_name | year |
123123
+------+-------------+------+
124124
| 1 | Roxette | 1986 |
125125
+------+-------------+------+
@@ -128,20 +128,25 @@ using the ``\set output`` console command:
128128
| 3 | Ace of Base | 1987 |
129129
+------+-------------+------+
130130
131+
.. note::
132+
133+
Field names are printed since Tarantool 3.2. On earlier versions,
134+
actual names are replaced by numbered placeholders ``col1``, ``col2``, and so on.
135+
131136
The table output can be printed in the transposed format, where an object's fields
132137
are arranged in columns instead of rows:
133138

134139
.. code-block:: console
135140
136141
app:storage001> \set output ttable
137142
app:storage001> box.space.bands:select { }
138-
+------+---------+-----------+-------------+
139-
| col1 | 1 | 2 | 3 |
140-
+------+---------+-----------+-------------+
141-
| col2 | Roxette | Scorpions | Ace of Base |
142-
+------+---------+-----------+-------------+
143-
| col3 | 1986 | 1965 | 1987 |
144-
+------+---------+-----------+-------------+
143+
+-----------+---------+-----------+-------------+
144+
| id | 1 | 2 | 3 |
145+
+-----------+---------+-----------+-------------+
146+
| band_name | Roxette | Scorpions | Ace of Base |
147+
+-----------+---------+-----------+-------------+
148+
| year | 1986 | 1965 | 1987 |
149+
+-----------+---------+-----------+-------------+
145150
146151
.. note::
147152

@@ -162,9 +167,9 @@ following commands:
162167
163168
app:storage001> \set table_format jira
164169
app:storage001> box.space.bands:select {}
165-
| col1 | 1 | 2 | 3 |
166-
| col2 | Roxette | Scorpions | Ace of Base |
167-
| col3 | 1986 | 1965 | 1987 |
170+
| id | 1 | 2 | 3 |
171+
| band_name | Roxette | Scorpions | Ace of Base |
172+
| year | 1986 | 1965 | 1987 |
168173
169174
* ``\set grahpics`` -- enable or disable graphics for table cells in the default format:
170175

@@ -173,20 +178,20 @@ following commands:
173178
app:storage001> \set table_format default
174179
app:storage001> \set graphics false
175180
app:storage001> box.space.bands:select {}
176-
col1 1 2 3
177-
col2 Roxette Scorpions Ace of Base
178-
col3 1986 1965 1987
181+
id 1 2 3
182+
band_name Roxette Scorpions Ace of Base
183+
year 1986 1965 1987
179184
180185
* ``\set table_column_width`` -- maximum column width.
181186

182187
.. code-block:: console
183188
184189
app:storage001> \set table_column_width 6
185190
app:storage001> box.space.bands:select {}
186-
col1 1 2 3
187-
col2 Roxett Scorpi Ace of
188-
+e +ons + Base
189-
col3 1986 1965 1987
191+
id 1 2 3
192+
band_n Roxett Scorpi Ace of
193+
+ame +e +ons + Base
194+
year 1986 1965 1987
190195
191196
192197
.. _tt-interactive-console-commands:

0 commit comments

Comments
 (0)