Skip to content

Commit 3eab90f

Browse files
3.0 config: update replication tutorials (#3862)
1 parent 5cf032a commit 3eab90f

File tree

25 files changed

+1866
-1063
lines changed

25 files changed

+1866
-1063
lines changed

doc/code_snippets/snippets/replication/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Master-replica: automated failover
2+
3+
A sample application demonstrating how to bootstrap a replica set with [automated failover](https://www.tarantool.io/en/doc/latest/how-to/replication/repl_bootstrap_auto/).
4+
5+
## Running
6+
7+
To start all instances, execute the following command in the [replication](../../../replication) directory:
8+
9+
```console
10+
$ tt start auto_leader
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Master-replica: manual failover
2+
3+
A sample application demonstrating how to bootstrap a replica set with [manual failover](https://www.tarantool.io/en/doc/latest/how-to/replication/repl_bootstrap/).
4+
5+
## Running
6+
7+
To start all instances, execute the following command in the [replication](../../../replication) directory:
8+
9+
```console
10+
$ tt start manual_leader
11+
```

doc/code_snippets/snippets/replication/instances.enabled/manual_leader/myapp.lua

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ function create_space()
88
box.space.bands:create_index('primary', { parts = { 'id' } })
99
end
1010

11-
function create_sync_space()
12-
box.schema.space.create('bands', { is_sync = true })
13-
box.space.bands:format({
14-
{ name = 'id', type = 'unsigned' },
15-
{ name = 'band_name', type = 'string' },
16-
{ name = 'year', type = 'unsigned' }
17-
})
18-
box.space.bands:create_index('primary', { parts = { 'id' } })
19-
end
20-
2111
function load_data()
2212
box.space.bands:insert { 1, 'Roxette', 1986 }
2313
box.space.bands:insert { 2, 'Scorpions', 1965 }
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Master-master
2+
3+
A sample application demonstrating how to bootstrap a [master-master](https://www.tarantool.io/en/doc/latest/how-to/replication/repl_bootstrap_master_master/) replica set.
4+
5+
## Running
6+
7+
To start all instances, execute the following command in the [replication](../../../replication) directory:
8+
9+
```console
10+
$ tt start master_master
11+
```

doc/code_snippets/snippets/replication/instances.enabled/master_master/config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ groups:
2525
database:
2626
mode: rw
2727
iproto:
28-
listen: 127.0.0.1:3302
28+
listen: 127.0.0.1:3302
29+
30+
# Load sample data
31+
app:
32+
file: 'myapp.lua'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
function create_space()
2+
box.schema.space.create('bands')
3+
box.space.bands:format({
4+
{ name = 'id', type = 'unsigned' },
5+
{ name = 'band_name', type = 'string' },
6+
{ name = 'year', type = 'unsigned' }
7+
})
8+
box.space.bands:create_index('primary', { parts = { 'id' } })
9+
end
10+
11+
function load_data()
12+
box.space.bands:insert { 1, 'Roxette', 1986 }
13+
box.space.bands:insert { 2, 'Scorpions', 1965 }
14+
box.space.bands:insert { 3, 'Ace of Base', 1987 }
15+
box.space.bands:insert { 4, 'The Beatles', 1960 }
16+
box.space.bands:insert { 5, 'Pink Floyd', 1965 }
17+
box.space.bands:insert { 6, 'The Rolling Stones', 1962 }
18+
box.space.bands:insert { 7, 'The Doors', 1965 }
19+
box.space.bands:insert { 8, 'Nirvana', 1987 }
20+
box.space.bands:insert { 9, 'Led Zeppelin', 1968 }
21+
box.space.bands:insert { 10, 'Queen', 1970 }
22+
end

doc/concepts/replication/index.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Replication allows multiple Tarantool instances to work on copies of the same
1010
databases. The databases are kept in sync because each instance can communicate
1111
its changes to all the other instances.
1212

13-
This chapter includes the following sections:
13+
This section includes the following topics:
1414

1515
.. toctree::
1616
:maxdepth: 2
@@ -20,9 +20,5 @@ This chapter includes the following sections:
2020
repl_sync
2121
repl_leader_elect
2222

23-
For practical guides to replication, see the :ref:`How-to section <how-to-replication>`.
24-
You can learn about :ref:`bootstrapping a replica set <replication-bootstrap>`,
25-
:ref:`adding instances <replication-add_instances>` to the replica set
26-
or :ref:`removing them <replication-remove_instances>`,
27-
:ref:`using synchronous replication <how-to-repl_sync>`
28-
and :ref:`managing leader elections <how-to-repl_leader_elect>`.
23+
For practical guides to replication, see :ref:`Replication tutorials <how-to-replication>`.
24+
You can learn about bootstrapping a replica set, adding instances to the replica set, or removing them.

doc/concepts/replication/repl_architecture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The following are specifics of adding different types of information to the WAL:
4747
* Data change operations on **replication-local** spaces (:doc:`created </reference/reference_lua/box_schema/space_create>` with ``is_local = true``) are written to the WAL but are not replicated.
4848

4949

50-
To learn how to enable replication, check the :ref:`Bootstrapping a replica set <replication-setup>` guide.
50+
To learn how to enable replication, check the :ref:`Bootstrapping a replica set <replication-bootstrap>` guide.
5151

5252

5353
.. _replication_stages:

0 commit comments

Comments
 (0)