Skip to content

Add tt commands start, stop, status, restart #3022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions doc/reference/tt_cli/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ help for the given command.
:widths: 30 70
:header-rows: 0

* - ``start``
- Start a Tarantool :ref:`instance <admin-instance_file>`
* - ``stop``
* - :doc:`start <start>`
- Start a Tarantool instance
* - :doc:`stop <stop>`
- Stop a Tarantool instance
* - ``status``
* - :doc:`status <status>`
- Get the current status of a Tarantool instance
* - ``restart``
* - :doc:`restart <restart>`
- Restart a Tarantool instance
* - ``version``
- Show the ``tt`` version information
Expand All @@ -35,4 +35,12 @@ help for the given command.
* - ``cat``
- Print the contents of ``.snap`` or ``.xlog`` files into stdout
* - ``play``
- Play the contents of ``.snap`` or ``.xlog`` files to another Tarantool instance
- Play the contents of ``.snap`` or ``.xlog`` files to another Tarantool instance

.. toctree::
:hidden:

start <start>
stop <stop>
status <status>
restart <restart>
2 changes: 2 additions & 0 deletions doc/reference/tt_cli/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ modules section
* ``directory`` -- the directory where external modules are stored.
.. // TODO: add link to external modules doc page when it's ready

.. _tt-config_file_app:

app section
~~~~~~~~~~~

Expand Down
20 changes: 20 additions & 0 deletions doc/reference/tt_cli/restart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Restarting a Tarantool instance
===============================

.. code-block:: bash

tt restart INSTANCE

``tt restart`` restarts the specified running Tarantool instance.
A ``tt restart`` call is equivalent to consecutive calls of
:doc:`tt stop <stop>` and :doc:`tt start <start>`.

Examples
--------

Restart the ``app`` instance:

.. code-block:: bash

tt restart app

36 changes: 36 additions & 0 deletions doc/reference/tt_cli/start.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.. _tt-start:

Starting a Tarantool instance
=============================

.. code-block:: bash

tt start INSTANCE

``tt start`` starts the specified Tarantool :ref:`instance <admin-instance_file>`.

Details
-------

``INSTANCE`` is the name of an instance from the ``instances_available`` directory
specified in the :ref:`tt configuration file <tt-config_file_app>`. This can be:

* the name of an :ref:`instance file <admin-instance_file>` without the ``.lua`` extension.
* the name of a directory containing the ``init.lua`` file.


Examples
--------

* Start the ``app.lua`` instance from the ``instances_available`` directory:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the default value for the instances_available directory? The user might have the same question when reading this document. Consider indicating the default on the config page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now it's the current working directory but it's not the final decision, please see this comment. We decided to skip this detail so that readers don't rely on it.


.. code-block:: bash

tt start app


* Start the ``init.lua`` instance from the ``instance1/`` directory inside ``instances_available``:

.. code-block:: bash

tt start instance1
17 changes: 17 additions & 0 deletions doc/reference/tt_cli/status.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Checking instance status
========================

.. code-block:: bash

tt status INSTANCE

``tt status`` prints the current status of the specified Tarantool instance.

Examples
--------

Check the status of the ``app`` instance:

.. code-block:: bash

tt status app
19 changes: 19 additions & 0 deletions doc/reference/tt_cli/stop.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. _tt-stop:

Stopping a Tarantool instance
=============================

.. code-block:: bash

tt stop INSTANCE

``tt stop`` stops the specified running Tarantool instance.

Examples
--------

Stop the ``app`` instance:

.. code-block:: bash

tt stop app