~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to plugin/slave/docs/index.rst

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2011-03-15 10:41:18 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110315104118-eaf0hvlytjdl4zrf
Tags: 2011.03.13-0ubuntu1
* New upstream release.
* Added slave plugin.
* Removed archive, blackhole and blitzdb plugins.
* Moved location of libdrizzle headers.
* Removed drizzleadmin manpage patch.
* Add drizzle_safe_write_string to symbols.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
Replication Slave
2
 
=================
 
2
==================
 
3
 
 
4
This page contains the configuration and implementation details for Drizzle replication.
 
5
 
 
6
See these pages for user-level information: 
 
7
 
 
8
.. toctree::
 
9
   :maxdepth: 2
 
10
 
 
11
   user_example
 
12
   admin
3
13
 
4
14
Description
5
15
-----------
6
16
 
7
 
The replication slave plugin provides a native implementation of replication
8
 
between two Drizzle processes.
9
 
 
10
 
This plugin requires a master that is running with the InnoDB replication log
11
 
enabled.
 
17
Replication enables data from one Drizzle database server (the master) to be replicated to one or more Drizzle database servers (the slaves). It provides a native implementation of replication between two Drizzle processes. Depending on your configuration, you can replicate all databases, selected databases, or selected tables within a database.
 
18
 
 
19
Drizzle’s replication system is entirely new and different from MySQL. Replication events are stored using Google Protocol Buffer messages in an InnoDB table. These events are read by the slave, stored locally, and applied. The advantage of the Google Protocol Buffer messages is a script or program can be put together in pretty much any language in minutes, and read the replication log. In other words, replication plugins are easy to implement, which enable developers to entirely customize their replication system.
 
20
 
 
21
This plugin requires a master that is running with the InnoDB replication log enabled. The slave plugin allows a server to replicate from another server that is using the innodb-trx log. It is a very simple setup:

 
22
master options:  –innodb.replication-log=true
slave options: –plugin-add=slave –slave.config-file=XYZ
 
23
 
 
24
The config file may contain the following options in option=value format:

 
25
master-host – hostname/ip of the master host
master-port – port used by the master server
master-user – username
master-pass – password
max-reconnects – max # of reconnect attempts if the master disappears
seconds-between-reconnects – how long to wait between reconnect attempts
 
26
 
12
27
 
13
28
Configuration
14
29
-------------
15
30
 
16
31
Most of the options that can be used to control the replication slave plugin
17
 
can only be given in a configuration file. The only exception is the
18
 
**config-file** option which designates the location of this configuration
19
 
file.
20
 
 
21
 
**slave.config-file**
22
 
 
23
 
   Path to the replication slave configuration file.
 
32
can only be given in a configuration file. The only exceptions are the
 
33
:option:`--slave.config-file` and :option:`--slave.max-commit-id` options.
 
34
 
 
35
.. program:: drizzled
 
36
 
 
37
.. option:: --slave.config-file=arg
 
38
 
 
39
   Path to the replication slave configuration file. By default, the
 
40
   plugin will look for a file named `slave.cfg` in the `etc` directory
 
41
   of the Drizzle installation. If you want to specify a different path or
 
42
   configuration file name, it is best to specify a full path to the
 
43
   file. The relative path used by plugins is within the :option:`--datadir`
 
44
   directory, so a full path is recommended.
 
45
 
 
46
.. option:: --slave.max-commit-id=arg
 
47
 
 
48
   Manually set the maximum commit ID the slave is assumed to have retrieved
 
49
   from the master. This value will be used by the slave to determine where
 
50
   to begin retrieving replication messages from the master transaction log.
 
51
   This option can be used to provision a new slave machine by setting it to
 
52
   the value output from the drizzledump client when used with the
 
53
   --single-transaction option.
 
54
 
 
55
   This value is not allowed to be set via the configuration file since
 
56
   you would normally only set it once on initial slave startup. This
 
57
   eliminates the possibility of forgetting to delete it from the configuration
 
58
   file for subsequent slave restarts.
24
59
 
25
60
The options below are read from the configuration file.
26
61
 
27
 
**master-host**
 
62
.. confval:: master-host
28
63
 
29
64
   Hostname/IP address of the master server.
30
65
 
31
 
**master-port**
 
66
.. confval:: master-port
32
67
 
33
68
   Drizzle port used by the master server. Default is 3306.
34
69
 
35
 
**master-user**
 
70
.. confval:: master-user
36
71
 
37
72
   Username to use for connecting to the master server.
38
73
 
39
 
**master-pass**
40
 
 
41
 
   Password associated with the username given by **master-user**.
42
 
 
43
 
**max-reconnects**
 
74
.. confval:: master-pass
 
75
 
 
76
   Password associated with the username given by :confval:`master-user`.
 
77
 
 
78
.. confval:: max-reconnects
44
79
 
45
80
   The number of reconnection attempts the slave plugin will try if the
46
81
   master server becomes unreachable. Default is 10.
47
82
 
48
 
**seconds-between-reconnects**
 
83
.. confval:: seconds-between-reconnects
49
84
 
50
85
   The number of seconds to wait between reconnect attempts when the master
51
86
   server becomes unreachable. Default is 30.
52
87
 
 
88
.. confval:: io-thread-sleep
 
89
 
 
90
   The number of seconds the IO (producer) thread sleeps between queries to the
 
91
   master for more replication events. Default is 5.
 
92
 
 
93
.. confval:: applier-thread-sleep
 
94
 
 
95
   The number of seconds the applier (consumer) thread sleeps between applying
 
96
   replication events from the local queue. Default is 5.
 
97
 
53
98
Implementation Details
54
99
----------------------
55
100
 
62
107
The producer thread (or I/O thread) is in charge of connecting to the master
63
108
server and pulling down replication events from the master's transaction
64
109
log and storing them locally in the slave queue. It is required that the
65
 
master use the InnoDB replication log (--innodb.replication-log=true).
 
110
master use the InnoDB replication log (:option:`--innodb.replication-log <drizzled --innodb.replication-log>`).
66
111
 
67
112
The consumer thread (or applier thread) reads the replication events from
68
113
the local slave queue, applies them locally, and then deletes successfully
75
120
metadata. It stores everything in the **sys_replication** schema. The
76
121
following are the tables that it will create:
77
122
 
78
 
**sys_replication.io_state**
 
123
.. dbtable:: sys_replication.io_state
79
124
 
80
125
   Stores metadata about the IO/producer thread.
81
126
 
82
 
**sys_replication.applier_state**
 
127
.. dbtable:: sys_replication.applier_state
83
128
 
84
129
   Stores metadata about the applier/consumer thread.
85
130
 
86
 
**sys_replication.queue**
 
131
.. dbtable:: sys_replication.queue
87
132
 
88
133
   The replication event queue.
89
134