diff --git a/doc/sphinx/book/replication.rst b/doc/sphinx/book/replication.rst index 9909d9f6703096ec3b9eb7b0623d9e833d25e4ef..fbaa7caaba881b9d35240316ecccc56e23241ef5 100644 --- a/doc/sphinx/book/replication.rst +++ b/doc/sphinx/book/replication.rst @@ -213,15 +213,219 @@ a cluster and adding a replica. Start two shells. Put them side by side on the screen. -+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ -| Terminal #1 | Terminal #2 | -+===============================================================================+===============================================================================+ -| | | -| .. code-block:: lua | .. code-block:: lua | -| | | -| $ | $ | -| | | -+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+ - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. container:: table-wide + + +----------------------+---------------------+ + | Terminal #1 | Terminal #2 | + +======================+=====================+ + | | | + | .. code-block:: lua | .. code-block:: lua | + | | | + | $ | $ | + | | | + +----------------------+---------------------+ + +On the first shell, which we'll call Terminal #1, execute these commands: + +.. code-block:: bash + + # Terminal 1 + mkdir -p ~/tarantool_test_node_1 + cd ~/tarantool_test_node_1 + rm -R ~/tarantool_test_node_1/* + ~/tarantool/src/tarantool + box.cfg{listen=3301} + box.schema.user.create('replicator', {password = 'password'}) + box.schema.user.grant('replicator','read,write','universe') + box.space._cluster:select({0},{iterator='GE'}) + +The result is that a new cluster is set up, and the UUID is displayed. +Now the screen looks like this: (except that UUID values are always different): + + +.. container:: table-wide + + +----------------------------------+----------------------------------+ + | Terminal #1 | Terminal #2 | + +==================================+==================================+ + | | | + | .. include:: replication/1-1.rst | .. include:: replication/1-2.rst | + | | | + +----------------------------------+----------------------------------+ + +On the second shell, which we'll call Terminal #2, execute these commands: + +.. code-block:: bash + + # Terminal 2 + mkdir -p ~/tarantool_test_node_2 + cd ~/tarantool_test_node_2 + rm -R ~/tarantool_test_node_2/* + ~/tarantool/src/tarantool + box.cfg{listen=3302, replication_source='replicator:password@localhost:3301'} + box.space._cluster:select({0},{iterator='GE'}) + +The result is that a replica is set up. Messages appear on Terminal #1 +confirming that the replica has connected and that the WAL contents have +been shipped to the replica. Messages appear on Terminal #2 showing that +replication is starting. Also on Terminal#2 the _cluster UUID value is +displayed, and it is the same as the _cluster UUID value that was displayed +on Terminal #1, because both servers are in the same cluster. + + +.. container:: table-wide + + +----------------------------------+----------------------------------+ + | Terminal #1 | Terminal #2 | + +==================================+==================================+ + | | | + | .. include:: replication/2-1.rst | .. include:: replication/2-2.rst | + | | | + +----------------------------------+----------------------------------+ + +On Terminal #1, execute these requests: + +.. code-block:: lua + + s = box.schema.space.create('tester') + i = s:create_index('primary', {}) + s:insert{1,'Tuple inserted on Terminal #1'} + +Now the screen looks like this: + +.. container:: table-wide + + +----------------------------------+----------------------------------+ + | Terminal #1 | Terminal #2 | + +==================================+==================================+ + | | | + | .. include:: replication/3-1.rst | .. include:: replication/3-2.rst | + | | | + +----------------------------------+----------------------------------+ + +The creation and insertion were successful on Terminal #1. +Nothing has happened on Terminal #2. + +On Terminal #2, execute these requests: + +.. code-block:: lua + + s = box.space.tester + s:select({1},{iterator='GE'}) + s:insert{2,'Tuple inserted on Terminal #2'} + +Now the screen looks like this: + +.. container:: table-wide + + +----------------------------------+----------------------------------+ + | Terminal #1 | Terminal #2 | + +==================================+==================================+ + | | | + | .. include:: replication/4-1.rst | .. include:: replication/4-2.rst | + | | | + +----------------------------------+----------------------------------+ + +The selection and insertion were successful on Terminal #2. Nothing has +happened on Terminal #1. + +On Terminal #1, execute these Tarantool requests and shell commands: + +.. code-block:: lua + + os.exit() + ls -l ~/tarantool_test_node_1 + ls -l ~/tarantool_test_node_2 + +Now Tarantool #1 is stopped. Messages appear on Terminal #2 announcing that fact. +The "ls -l" commands show that both servers have made snapshots, which have the +same size because they both contain the same tuples. + +.. container:: table-wide + + +----------------------------------+----------------------------------+ + | Terminal #1 | Terminal #2 | + +==================================+==================================+ + | | | + | .. include:: replication/5-1.rst | .. include:: replication/5-2.rst | + | | | + +----------------------------------+----------------------------------+ + +On Terminal #2, ignore the repeated messages saying "failed to connect", +and execute these requests: + +.. code-block:: lua + + box.space.tester:select({0},{iterator='GE'}) + box.space.tester:insert{3,'Another'} + +Now the screen looks like this (ignoring the repeated messages saying +"failed to connect"): + +.. container:: table-wide + + +----------------------------------+----------------------------------+ + | Terminal #1 | Terminal #2 | + +==================================+==================================+ + | | | + | .. include:: replication/6-1.rst | .. include:: replication/6-2.rst | + | | | + +----------------------------------+----------------------------------+ + +Terminal #2 has done a select and an insert, even though Terminal #1 is down. + +On Terminal #1 execute these commands: + +.. code-block:: lua + + ~/tarantool/src/tarantool + box.cfg{listen=3301} + box.space.tester:select({0},{iterator='GE'}) + +Now the screen looks like this (ignoring the repeated messages on terminal +#2 saying "failed to connect"): + +.. container:: table-wide + + +----------------------------------+----------------------------------+ + | Terminal #1 | Terminal #2 | + +==================================+==================================+ + | | | + | .. include:: replication/7-1.rst | .. include:: replication/7-2.rst | + | | | + +----------------------------------+----------------------------------+ + +The master has reconnected to the cluster, and has NOT found what the replica +wrote while the master was away. That is not a surprise -- the replica has not +been asked to act as a replication source. + +On Terminal #1, say: + +.. code-block:: lua + + box.cfg{replication_source='replicator:password@localhost:3302'} + box.space.tester:select({0},{iterator='GE'}) + +The screen now looks like this: + +.. container:: table-wide + + +----------------------------------+----------------------------------+ + | Terminal #1 | Terminal #2 | + +==================================+==================================+ + | | | + | .. include:: replication/8-1.rst | .. include:: replication/8-2.rst | + | | | + +----------------------------------+----------------------------------+ + +This shows that the two servers are once again in synch, and that each server +sees what the other server wrote. + +To clean up, say "``os.exit()``" on both Terminal #1 and Terminal #2, and then +on either terminal say: + +.. code-block:: lua + + cd ~ + rm -R ~/tarantool_test_node_1 + rm -R ~/tarantool_test_node_2 diff --git a/doc/sphinx/book/replication/1-1.rst b/doc/sphinx/book/replication/1-1.rst new file mode 100644 index 0000000000000000000000000000000000000000..86d9d29d121882d62525057225a24fe5f71d5a21 --- /dev/null +++ b/doc/sphinx/book/replication/1-1.rst @@ -0,0 +1,22 @@ +.. code-block:: bash + + $ # Terminal 1 + $ mkdir -p ~/tarantool_test_node_1 + $ cd ~/tarantool_test_node_1 + ~/tarantool_test_node_1$ rm -R ~/tarantool_test_node_1/* + ~/tarantool_test_node_1$ ~/tarantool/src/tarantool + ~/tarantool/src/tarantool: version 1.6.3-1724-g033ed69 + type 'help' for interactive help + tarantool> box.cfg{listen=3301} + ... ... + tarantool> box.schema.user.create('replicator', {password = 'password'}) + 2014-10-13 11:12:56.052 [25018] wal I> creating `./00000000000000000000.xlog.inprogress' + --- + ... + tarantool> box.schema.user.grant('replicator','read,write','universe') + --- + ... + tarantool> box.space._cluster:select({0},{iterator='GE'}) + --- + - - [1, '6190d919-1133-4452-b123-beca0b178b32'] + ... diff --git a/doc/sphinx/book/replication/1-2.rst b/doc/sphinx/book/replication/1-2.rst new file mode 100644 index 0000000000000000000000000000000000000000..51e9e7687119ceda6472f6ea6f7a4f3948bd4aa5 --- /dev/null +++ b/doc/sphinx/book/replication/1-2.rst @@ -0,0 +1,3 @@ +.. code-block:: bash + + $ diff --git a/doc/sphinx/book/replication/2-1.rst b/doc/sphinx/book/replication/2-1.rst new file mode 100644 index 0000000000000000000000000000000000000000..852b82fd4ac500f6f4834fcbeb8a5665c6b0c497 --- /dev/null +++ b/doc/sphinx/book/replication/2-1.rst @@ -0,0 +1,14 @@ +.. code-block:: lua + + ... ... + tarantool> box.space._cluster:select({0},{iterator='GE'}) + --- + - - [1, '6190d919-1133-4452-b123-beca0b178b32'] + ... + tarantool> 2014-10-13 11:20:08.691 [25020] main/101/spawner I> created a replication relay: pid = 25583 + 2014-10-13 11:20:08.691 [25583] main/101/relay/127.0.0.1:50883 I> recovery start + 2014-10-13 11:20:08.691 [25583] main/101/relay/127.0.0.1:50883 I> recovering from `./00000000000000000000.snap' + 2014-10-13 11:20:08.692 [25583] main/101/relay/127.0.0.1:50883 I> snapshot sent + 2014-10-13 11:20:08.789 [25020] main/101/spawner I> created a replication relay: pid = 25585 + 2014-10-13 11:20:08.890 [25585] main/101/relay/127.0.0.1:50884 I> recover from `./00000000000000000000.xlog' + diff --git a/doc/sphinx/book/replication/2-2.rst b/doc/sphinx/book/replication/2-2.rst new file mode 100644 index 0000000000000000000000000000000000000000..82c1432d5e960568326a8c01dc6194ef2392d1e7 --- /dev/null +++ b/doc/sphinx/book/replication/2-2.rst @@ -0,0 +1,23 @@ + +.. code-block:: bash + + $ # Terminal 2 + ~/tarantool_test_node_2$ mkdir -p ~/tarantool_test_node_2 + ~/tarantool_test_node_2$ cd ~/tarantool_test_node_2 + ~/tarantool_test_node_2$ rm -R ~/tarantool_test_node_2/* + ~/tarantool_test_node_2$ ~/tarantool/src/tarantool + /home/username/tarantool/src/tarantool: version 1.6.3-1724-g033ed69 + type 'help' for interactive help + tarantool> box.cfg{listen=3302, replication_source='replicator:password@localhost:3301'} + ... ... + --- + ... + tarantool> box.space._cluster:select({0},{iterator='GE'}) + 2014-10-13 11:20:08.789 [25579] main/103/replica/localhost:3301 C> connected to 127.0.0.1:3301 + 2014-10-13 11:20:08.789 [25579] main/103/replica/localhost:3301 I> authenticated + 2014-10-13 11:20:08.901 [25579] wal I> creating `./00000000000000000000.xlog.inprogress' + --- + - - [1, '6190d919-1133-4452-b123-beca0b178b32'] + - [2, '236230b8-af3e-406b-b709-15a60b44c20c'] + ... + diff --git a/doc/sphinx/book/replication/3-1.rst b/doc/sphinx/book/replication/3-1.rst new file mode 100644 index 0000000000000000000000000000000000000000..6f5a63dfba044d6d3dbe660f84a06e6f1b5ee7ba --- /dev/null +++ b/doc/sphinx/book/replication/3-1.rst @@ -0,0 +1,21 @@ +.. code-block:: lua + + ... ... + tarantool> 2014-10-13 11:20:08.691 [25020] main/101/spawner I> created a replication relay: pid = 25583 + 2014-10-13 11:20:08.691 [25583] main/101/relay/127.0.0.1:50883 I> recovery start + 2014-10-13 11:20:08.691 [25583] main/101/relay/127.0.0.1:50883 I> recovering from `./00000000000000000000.snap' + 2014-10-13 11:20:08.692 [25583] main/101/relay/127.0.0.1:50883 I> snapshot sent + 2014-10-13 11:20:08.789 [25020] main/101/spawner I> created a replication relay: pid = 25585 + 2014-10-13 11:20:08.890 [25585] main/101/relay/127.0.0.1:50884 I> recover from `./00000000000000000000.xlog' + --- + ... + tarantool> s = box.schema.space.create('tester') + --- + ... + tarantool> i = s:create_index('primary', {}) + --- + ... + tarantool> s:insert{1,'Tuple inserted on Terminal #1'} + --- + - [1, 'Tuple inserted on Terminal #1'] + ... diff --git a/doc/sphinx/book/replication/3-2.rst b/doc/sphinx/book/replication/3-2.rst new file mode 100644 index 0000000000000000000000000000000000000000..faf49f0b0af1081f29429326cb4f0a0faf8a2851 --- /dev/null +++ b/doc/sphinx/book/replication/3-2.rst @@ -0,0 +1,21 @@ +.. code-block:: lua + + $ # Terminal 2 + ~/tarantool_test_node_2$ mkdir -p ~/tarantool_test_node_2 + ~/tarantool_test_node_2$ cd ~/tarantool_test_node_2 + ~/tarantool_test_node_2$ rm -R ~/tarantool_test_node_2/* + ~/tarantool_test_node_2$ ~/tarantool/src/tarantool + /home/username/tarantool/src/tarantool: version 1.6.3-1724-g033ed69 + type 'help' for interactive help + tarantool> box.cfg{listen=3302, replication_source='replicator:password@localhost:3301'} + ... ... + --- + ... + tarantool> box.space._cluster:select({0},{iterator='GE'}) + 2014-10-13 11:20:08.789 [25579] main/103/replica/localhost:3301 C> connected to 127.0.0.1:3301 + 2014-10-13 11:20:08.789 [25579] main/103/replica/localhost:3301 I> authenticated + 2014-10-13 11:20:08.901 [25579] wal I> creating `./00000000000000000000.xlog.inprogress' + --- + - - [1, '6190d919-1133-4452-b123-beca0b178b32'] + - [2, '236230b8-af3e-406b-b709-15a60b44c20c'] + ... diff --git a/doc/sphinx/book/replication/4-1.rst b/doc/sphinx/book/replication/4-1.rst new file mode 100644 index 0000000000000000000000000000000000000000..9027fda19a4ea5a9f5bcb8627f7e3ccd90abbe9e --- /dev/null +++ b/doc/sphinx/book/replication/4-1.rst @@ -0,0 +1,21 @@ +.. code-block:: lua + + ... + tarantool> 2014-10-13 11:20:08.691 [25020] main/101/spawner I> created a replication relay: pid = 25583 + 2014-10-13 11:20:08.691 [25583] main/101/relay/127.0.0.1:50883 I> recovery start + 2014-10-13 11:20:08.691 [25583] main/101/relay/127.0.0.1:50883 I> recovering from `./00000000000000000000.snap' + 2014-10-13 11:20:08.692 [25583] main/101/relay/127.0.0.1:50883 I> snapshot sent + 2014-10-13 11:20:08.789 [25020] main/101/spawner I> created a replication relay: pid = 25585 + 2014-10-13 11:20:08.890 [25585] main/101/relay/127.0.0.1:50884 I> recover from `./00000000000000000000.xlog' + --- + ... + tarantool> s = box.schema.space.create('tester') + --- + ... + tarantool> i = s:create_index('primary', {}) + --- + ... + tarantool> s:insert{1,'Tuple inserted on Terminal #1'} + --- + - [1, 'Tuple inserted on Terminal #1'] + ... diff --git a/doc/sphinx/book/replication/4-2.rst b/doc/sphinx/book/replication/4-2.rst new file mode 100644 index 0000000000000000000000000000000000000000..b524f87af687c8d68559a2b204430d8ccfd22ee2 --- /dev/null +++ b/doc/sphinx/book/replication/4-2.rst @@ -0,0 +1,22 @@ +.. code-block:: lua + + ... ... + tarantool> box.space._cluster:select({0},{iterator='GE'}) + 2014-10-13 11:20:08.789 [25579] main/103/replica/localhost:3301 C> connected to 127.0.0.1:3301 + 2014-10-13 11:20:08.789 [25579] main/103/replica/localhost:3301 I> authenticated + 2014-10-13 11:20:08.901 [25579] wal I> creating `./00000000000000000000.xlog.inprogress' + --- + - - [1, '6190d919-1133-4452-b123-beca0b178b32'] + - [2, '236230b8-af3e-406b-b709-15a60b44c20c'] + ... + tarantool> s = box.space.tester + --- + ... + tarantool> s:select({1},{iterator='GE'}) + --- + - - [1, 'Tuple inserted on Terminal #1'] + ... + tarantool> s:insert{2,'Tuple inserted on Terminal #2'} + --- + - [2, 'Tuple inserted on Terminal #2'] + ... diff --git a/doc/sphinx/book/replication/5-1.rst b/doc/sphinx/book/replication/5-1.rst new file mode 100644 index 0000000000000000000000000000000000000000..cdcb79518dbbe64c2b91daa8a4e824d318db5c7c --- /dev/null +++ b/doc/sphinx/book/replication/5-1.rst @@ -0,0 +1,21 @@ +.. code-block:: lua + + ... ... + tarantool> s:insert{1,'Tuple inserted on Terminal #1'} + --- + - [1, 'Tuple inserted on Terminal #1'] + ... + tarantool> os.exit() + 2014-10-13 11:45:20.455 [25585] main/101/relay/127.0.0.1:50884 I> done `./00000000000000000000.xlog' + 2014-10-13 11:45:20.531 [25020] main/101/spawner I> Exiting: master shutdown + 2014-10-13 11:45:20.531 [25020] main/101/spawner I> sending signal 15 to 1 children + 2014-10-13 11:45:20.531 [25020] main/101/spawner I> waiting for children for up to 5 seconds + ~/tarantool_test_node_1$ ls -l ~/tarantool_test_node_1 + total 8 + -rw-rw-r-- 1 1781 Oct 13 11:12 00000000000000000000.snap + -rw-rw-r-- 1 518 Oct 13 11:45 00000000000000000000.xlog + ~/tarantool_test_node_1$ ls -l ~/tarantool_test_node_2/ + total 8 + -rw-rw-r-- 1 1781 Oct 13 11:20 00000000000000000000.snap + -rw-rw-r-- 1 588 Oct 13 11:38 00000000000000000000.xlog + ~/tarantool_test_node_1$ diff --git a/doc/sphinx/book/replication/5-2.rst b/doc/sphinx/book/replication/5-2.rst new file mode 100644 index 0000000000000000000000000000000000000000..5b8a5825762f3919c22bfc36a532e07d438e3c24 --- /dev/null +++ b/doc/sphinx/book/replication/5-2.rst @@ -0,0 +1,16 @@ +.. code-block:: lua + + ... ... + tarantool> s:select({1},{iterator='GE'}) + --- + - - [1, 'Tuple inserted on Terminal #1'] + ... + tarantool> s:insert{2,'Tuple inserted on Terminal #2'} + --- + - [2, 'Tuple inserted on Terminal #2'] + ... + tarantool> 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 I> can't read row + 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 !> SystemError + unexpected EOF when reading from socket, + called on fd 10, aka 127.0.0.1:50884, peer of 127.0.0.1:3301: Broken pipe + 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 I> will retry every 1 second diff --git a/doc/sphinx/book/replication/6-1.rst b/doc/sphinx/book/replication/6-1.rst new file mode 100644 index 0000000000000000000000000000000000000000..cdcb79518dbbe64c2b91daa8a4e824d318db5c7c --- /dev/null +++ b/doc/sphinx/book/replication/6-1.rst @@ -0,0 +1,21 @@ +.. code-block:: lua + + ... ... + tarantool> s:insert{1,'Tuple inserted on Terminal #1'} + --- + - [1, 'Tuple inserted on Terminal #1'] + ... + tarantool> os.exit() + 2014-10-13 11:45:20.455 [25585] main/101/relay/127.0.0.1:50884 I> done `./00000000000000000000.xlog' + 2014-10-13 11:45:20.531 [25020] main/101/spawner I> Exiting: master shutdown + 2014-10-13 11:45:20.531 [25020] main/101/spawner I> sending signal 15 to 1 children + 2014-10-13 11:45:20.531 [25020] main/101/spawner I> waiting for children for up to 5 seconds + ~/tarantool_test_node_1$ ls -l ~/tarantool_test_node_1 + total 8 + -rw-rw-r-- 1 1781 Oct 13 11:12 00000000000000000000.snap + -rw-rw-r-- 1 518 Oct 13 11:45 00000000000000000000.xlog + ~/tarantool_test_node_1$ ls -l ~/tarantool_test_node_2/ + total 8 + -rw-rw-r-- 1 1781 Oct 13 11:20 00000000000000000000.snap + -rw-rw-r-- 1 588 Oct 13 11:38 00000000000000000000.xlog + ~/tarantool_test_node_1$ diff --git a/doc/sphinx/book/replication/6-2.rst b/doc/sphinx/book/replication/6-2.rst new file mode 100644 index 0000000000000000000000000000000000000000..8e17263605377c6d0e91b093160befec82e68f8a --- /dev/null +++ b/doc/sphinx/book/replication/6-2.rst @@ -0,0 +1,21 @@ +.. code-block:: lua + + ... ... + tarantool> s:insert{2,'Tuple inserted on Terminal #2'} + --- + - [2, 'Tuple inserted on Terminal #2'] + ... + tarantool> 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 I> can't read row + 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 !> SystemError + unexpected EOF when reading from socket, + called on fd 10, aka 127.0.0.1:50884, peer of 127.0.0.1:3301: Broken pipe + 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 I> will retry every 1 second + tarantool> box.space.tester:select({0},{iterator='GE'}) + --- + - - [1, 'Tuple inserted on Terminal #1'] + - [2, 'Tuple inserted on Terminal #2'] + ... + tarantool> box.space.tester:insert{3,'Another'} + --- + - [3, 'Another'] + ... diff --git a/doc/sphinx/book/replication/7-1.rst b/doc/sphinx/book/replication/7-1.rst new file mode 100644 index 0000000000000000000000000000000000000000..cdd2ddcd82ad965ad3dda567c7d6610c93e3f4d9 --- /dev/null +++ b/doc/sphinx/book/replication/7-1.rst @@ -0,0 +1,34 @@ +.. code-block:: lua + + ... ... + tarantool> s:insert{1,'Tuple inserted on Terminal #1'} + --- + - [1, 'Tuple inserted on Terminal #1'] + ... + tarantool> os.exit() + 2014-10-13 11:45:20.455 [25585] main/101/relay/127.0.0.1:50884 I> done `./00000000000000000000.xlog' + 2014-10-13 11:45:20.531 [25020] main/101/spawner I> Exiting: master shutdown + 2014-10-13 11:45:20.531 [25020] main/101/spawner I> sending signal 15 to 1 children + 2014-10-13 11:45:20.531 [25020] main/101/spawner I> waiting for children for up to 5 seconds + ~/tarantool_test_node_1$ ls -l ~/tarantool_test_node_1 + total 8 + -rw-rw-r-- 1 1781 Oct 13 11:12 00000000000000000000.snap + -rw-rw-r-- 1 518 Oct 13 11:45 00000000000000000000.xlog + ~/tarantool_test_node_1$ ls -l ~/tarantool_test_node_2/ + total 8 + -rw-rw-r-- 1 1781 Oct 13 11:20 00000000000000000000.snap + -rw-rw-r-- 1 588 Oct 13 11:38 00000000000000000000.xlog + ~/tarantool_test_node_1$ ~/tarantool/src/tarantool + /home/username/tarantool/src/tarantool: version 1.6.3-515-g0a06cce + type 'help' for interactive help + tarantool> box.cfg{listen=3301} + ... ... + --- + ... + tarantool> box.space.tester:select({0},{iterator='GE'}) + 2014-10-13 12:01:55.615 [28989] main/101/spawner I> created a replication relay: pid = 28992 + 2014-10-13 12:01:55.716 [28992] main/101/relay/127.0.0.1:51892 I> recover from `./00000000000000000000.xlog' + 2014-10-13 12:01:55.716 [28992] main/101/relay/127.0.0.1:51892 I> done `./00000000000000000000.xlog' + --- + - - [1, 'Tuple inserted on Terminal #1'] + ... diff --git a/doc/sphinx/book/replication/7-2.rst b/doc/sphinx/book/replication/7-2.rst new file mode 100644 index 0000000000000000000000000000000000000000..43764599ef9b42e2d032a87e90b1274b981e769c --- /dev/null +++ b/doc/sphinx/book/replication/7-2.rst @@ -0,0 +1,25 @@ +.. code-block:: lua + + ... ... + tarantool> s:insert{2,'Tuple inserted on Terminal #2'} + --- + - [2, 'Tuple inserted on Terminal #2'] + ... + tarantool> 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 I> can't read row + 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 !> SystemError + unexpected EOF when reading from socket, + called on fd 10, aka 127.0.0.1:50884, peer of 127.0.0.1:3301: Broken pipe + 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 I> will retry every 1 second + tarantool> box.space.tester:select({0},{iterator='GE'}) + --- + - - [1, 'Tuple inserted on Terminal #1'] + - [2, 'Tuple inserted on Terminal #2'] + ... + tarantool> box.space.tester:insert{3,'Another'} + --- + - [3, 'Another'] + ... + tarantool> + 2014-10-13 12:01:55.614 [25579] main/103/replica/localhost:3301 C> connected to 127.0.0.1:3301 + 2014-10-13 12:01:55.614 [25579] main/103/replica/localhost:3301 I> authenticated + diff --git a/doc/sphinx/book/replication/8-1.rst b/doc/sphinx/book/replication/8-1.rst new file mode 100644 index 0000000000000000000000000000000000000000..90e50fa595d5b38de6d39cdc8b2c6b0c3df90a5b --- /dev/null +++ b/doc/sphinx/book/replication/8-1.rst @@ -0,0 +1,33 @@ +.. code-block:: lua + + ... ... + ~/tarantool_test_node_1$ ~/tarantool/src/tarantool + ~/tarantool: version 1.6.3-1724-g033ed69 + type 'help' for interactive help + tarantool> box.cfg{listen=3301} + ... ... + --- + ... + tarantool> box.space.tester:select({0},{iterator='GE'}) + 2014-10-13 12:01:55.615 [28989] main/101/spawner I> created a replication relay: pid = 28992 + 2014-10-13 12:01:55.716 [28992] main/101/relay/127.0.0.1:51892 I> recover from `./00000000000000000000.xlog' + 2014-10-13 12:01:55.716 [28992] main/101/relay/127.0.0.1:51892 I> done `./00000000000000000000.xlog' + + --- + - - [1, 'Tuple inserted on Terminal #1'] + ... + tarantool> box.cfg{replication_source='replicator:password@localhost:3302'} + 2014-10-13 12:10:21.485 [28987] main/101/interactive C> starting replication from localhost:3302 + --- + ... + 2014-10-13 12:10:21.487 [28987] main/104/replica/localhost:3302 C> connected to 127.0.0.1:3302 + 2014-10-13 12:10:21.487 [28987] main/104/replica/localhost:3302 I> authenticated + tarantool> box.space.tester:select({0},{iterator='GE'}) + 2014-10-13 12:10:21.592 [28987] wal I> creating `./00000000000000000006.xlog.inprogress' + 2014-10-13 12:10:21.617 [28992] main/101/relay/127.0.0.1:51892 I> recover from `./00000000000000000006.xlog' + --- + - - [1, 'Tuple inserted on Terminal #1'] + - [2, 'Tuple inserted on Terminal #2'] + - [3, 'Another'] + ... + diff --git a/doc/sphinx/book/replication/8-2.rst b/doc/sphinx/book/replication/8-2.rst new file mode 100644 index 0000000000000000000000000000000000000000..b3fc1924c639f48a2daf2f4cb22a159f1891ce7a --- /dev/null +++ b/doc/sphinx/book/replication/8-2.rst @@ -0,0 +1,26 @@ +.. code-block:: lua + + ... ... + tarantool> s:insert{2,'Tuple inserted on Terminal #2'} + --- + - [2, 'Tuple inserted on Terminal #2'] + ... + tarantool> 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 I> can't read row + 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 !> SystemError + unexpected EOF when reading from socket, + called on fd 10, aka 127.0.0.1:50884, peer of 127.0.0.1:3301: Broken pipe + 2014-10-13 11:45:20.532 [25579] main/103/replica/localhost:3301 I> will retry every 1 second + tarantool> box.space.tester:select({0},{iterator='GE'}) + --- + - - [1, 'Tuple inserted on Terminal #1'] + - [2, 'Tuple inserted on Terminal #2'] + ... + tarantool> box.space.tester:insert{3,'Another'} + --- + - [3, 'Another'] + ... + tarantool> + 2014-10-13 12:01:55.614 [25579] main/103/replica/localhost:3301 C> connected to 127.0.0.1:3301 + 2014-10-13 12:01:55.614 [25579] main/103/replica/localhost:3301 I> authenticated + 2014-10-13 12:10:21.488 [25581] main/101/spawner I> created a replication relay: pid = 29632 + 2014-10-13 12:10:21.592 [29632] main/101/relay/127.0.0.1:45908 I> recover from `./00000000000000000000.xlog'