You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In particular, both instances use the same directory for storing write-ahead logs and snapshots.
1442
+
1443
+
When you start both cluster applications at the same machine, the first one will be the "primary" instance and the second will be the "standby" instance.
1444
+
In the :ref:`logs <configuration_reference_log>` of the second cluster instance, you should see a notification:
1445
+
1446
+
.. code-block:: text
1447
+
1448
+
main/104/interactive I> Entering hot standby mode
1449
+
1450
+
This means that the standby instance is ready to take over if the primary instance goes down.
1451
+
The standby instance initializes and tries to take a lock on a directory for storing write-ahead logs
1452
+
but fails because the primary instance has made a lock on this directory.
1453
+
So the standby instance goes into a loop, reading the write-ahead log which
1454
+
the primary instance is writing (), and trying to take the lock.
1455
+
So the two instances are always in sync.
1456
+
1457
+
If the primary instance goes down for any reason, the lock is released.
1458
+
In this case, the standby instance succeeds in taking the lock and becomes the primary instance.
1459
+
1460
+
``database.hot_standby`` has no effect:
1461
+
1462
+
* If :ref:`wal.mode <configuration_reference_wal_mode>` is ``none``.
1463
+
* On macOS and FreeBSD if :ref:`wal.dir_rescan_delay <configuration_reference_wal_dir_rescan_delay>` is a large value; on these platforms, the hot standby mode is designed so that the loop repeats every
1464
+
``wal.dir_rescan_delay`` seconds.
1465
+
* For spaces created with :doc:`engine = 'vinyl' </reference/reference_lua/box_schema/space_create>`.
1466
+
1467
+
Examples on GitHub: `hot_standby_1 <https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/config/instances.enabled/hot_standby_1>`_, `hot_standby_2 <https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/config/instances.enabled/hot_standby_2>`_
0 commit comments