|
| 1 | +.. _box_introspection-box_info: |
| 2 | + |
| 3 | +-------------------------------------------------------------------------------- |
| 4 | +Submodule `box.info` |
| 5 | +-------------------------------------------------------------------------------- |
| 6 | + |
| 7 | +.. module:: box.info |
| 8 | + |
| 9 | +The ``box.info`` submodule provides access to information about server variables. |
| 10 | + |
| 11 | +* **server.lsn** Log Sequence Number for the latest entry in the WAL. |
| 12 | +* **server.ro** True if the server is in "read_only" mode |
| 13 | + (same as :ref:`read_only <cfg_basic-read_only>` in box.cfg). |
| 14 | +* **server.uuid** The unique identifier of this server, |
| 15 | + as stored in the database. This value is also |
| 16 | + in the :ref:`box.space._cluster <box_space-cluster>` system space. |
| 17 | +* **server.id** The number of this server within a cluster. |
| 18 | +* **version** Tarantool version. This value is also shown by |
| 19 | + :ref:`tarantool --version <index-tarantool_version>`. |
| 20 | +* **status** Usually this is 'running', but it can be 'loading', 'orphan', or 'hot_standby'. |
| 21 | +* **vclock** Same as replication.vclock. |
| 22 | +* **pid** Process ID. This value is also shown by the |
| 23 | + :ref:`tarantool <tarantool-build>` module. |
| 24 | + This value is also shown by the Linux "ps -A" command. |
| 25 | +* **cluster.uuid** UUID of the cluster. Every server in a cluster will have the same cluster.uuid value. |
| 26 | + This value is also in the :ref:`box.space._schema <box_space-schema>` system space. |
| 27 | +* **vinyl()** Returns runtime statistics for the vinyl storage engine. |
| 28 | +* **replication.lag** Number of seconds that the replica is behind the master. |
| 29 | +* **replication.status** Usually this is 'follow', but it can be |
| 30 | + 'off', 'stopped', 'connecting', 'auth', or 'disconnected'. |
| 31 | +* **replication.idle** Number of seconds that the server has been idle. |
| 32 | +* **replication.vclock** See the :ref:`discussion of "vector clock" <internals-vector>` in the Internals section. |
| 33 | +* **replication.uuid** The unique identifier of a master to which this server is connected. |
| 34 | +* **replication.uptime** Number of seconds since the server started. |
| 35 | + This value can also be retrieved with :ref:`tarantool.uptime() <tarantool-build>`. |
| 36 | + |
| 37 | +The replication fields are blank unless the server is a :ref:`replica <index-box_replication>`. |
| 38 | +The replication fields are in an array if the server is a replica for more than one master. |
| 39 | + |
| 40 | +.. function:: box.info() |
| 41 | + |
| 42 | + Since ``box.info`` contents are dynamic, it's not possible to iterate over |
| 43 | + keys with the Lua ``pairs()`` function. For this purpose, ``box.info()`` |
| 44 | + builds and returns a Lua table with all keys and values provided in the |
| 45 | + submodule. |
| 46 | + |
| 47 | + :return: keys and values in the submodule. |
| 48 | + :rtype: table |
| 49 | + |
| 50 | + **Example:** |
| 51 | + |
| 52 | + .. code-block:: tarantoolsession |
| 53 | +
|
| 54 | + tarantool> box.info() |
| 55 | + --- |
| 56 | + - server: |
| 57 | + lsn: 158 |
| 58 | + ro: false |
| 59 | + uuid: a2684219-b2b1-4334-88ab-50b0722283fd |
| 60 | + id: 1 |
| 61 | + version: 1.7.2-435-g6ba8500 |
| 62 | + pid: 12932 |
| 63 | + status: running |
| 64 | + vclock: |
| 65 | + - 158 |
| 66 | + replication: |
| 67 | + status: off |
| 68 | + uptime: 908 |
| 69 | + ... |
| 70 | + tarantool> box.info.pid |
| 71 | + --- |
| 72 | + - 12932 |
| 73 | + ... |
| 74 | + tarantool> box.info.status |
| 75 | + --- |
| 76 | + - running |
| 77 | + ... |
| 78 | + tarantool> box.info.uptime |
| 79 | + --- |
| 80 | + - 1065 |
| 81 | + ... |
| 82 | + tarantool> box.info.version |
| 83 | + --- |
| 84 | + - 1.7.2-435-g6ba8500 |
| 85 | + ... |
| 86 | +
|
0 commit comments