MXS-1343: documentation update.
MXS-1343: documentation update for new option ‘slave_hostname’
This commit is contained in:
parent
9b9d7e4c4d
commit
424c7b7ad3
@ -93,6 +93,15 @@ version of the real master. This option allows the router to use a custom versio
|
||||
By default, the router will identify itself to the slaves using the
|
||||
hostname of the real master. This option allows the router to use a custom hostname.
|
||||
|
||||
|
||||
### `slave_hostname`
|
||||
|
||||
Since MaxScale 2.1.6 the router can optionally identify itself
|
||||
to the master using a custom hostname.
|
||||
The specified hostname can be seen in the master via
|
||||
`SHOW SLAVE HOSTS` command.
|
||||
The default is not to send any hostname string during registration.
|
||||
|
||||
### `user`
|
||||
|
||||
This is the user name that MariaDB MaxScale uses when it connects to the
|
||||
@ -271,7 +280,25 @@ follows.
|
||||
version_string=5.6.17-log
|
||||
user=maxscale
|
||||
passwd=Mhu87p2D
|
||||
router_options=uuid=f12fcb7f-b97b-11e3-bc5e-0401152c4c22,server_id=3,user=repl,password=slavepass,master_id=32,heartbeat=30,binlogdir=/var/binlogs,transaction_safety=1,master_version=5.6.19-common,master_hostname=common_server,master_uuid=xxx-fff-cccc-common,mariadb10-compatibility=1,send_slave_heartbeat=1,ssl_cert_verification_depth=9,semisync=1,encrypt_binlog=1,encryption_algorithm=aes_ctr,encryption_key_file=/var/binlogs/enc_key.txt
|
||||
router_options=uuid=f12fcb7f-b97b-11e3-bc5e-0401152c4c22,
|
||||
server_id=3,
|
||||
user=repl,
|
||||
password=slavepass,
|
||||
master_id=32,
|
||||
heartbeat=30,
|
||||
binlogdir=/var/binlogs,
|
||||
transaction_safety=1,
|
||||
master_version=5.6.19-common,
|
||||
master_hostname=common_server,
|
||||
master_uuid=xxx-fff-cccc-common,
|
||||
mariadb10-compatibility=1,
|
||||
send_slave_heartbeat=1,
|
||||
ssl_cert_verification_depth=9,
|
||||
semisync=1,
|
||||
encrypt_binlog=1,
|
||||
encryption_algorithm=aes_ctr,
|
||||
encryption_key_file=/var/binlogs/enc_key.txt,
|
||||
slave_hostname=maxscale-blr-1
|
||||
```
|
||||
|
||||
The minimum set of router options that must be given in the configuration are
|
||||
|
@ -32,152 +32,12 @@ Using MariaDB MaxScale as a Binlog Server is much the same as using MariaDB MaxS
|
||||
|
||||
As with any MariaDB MaxScale configuration a good starting point is with the service definition with the *maxscale.cnf* file. The service requires a name which is the section name in the ini file, a type parameter with a value of service and the name of the router plugin that should be loaded. In the case of replication proxies this router name is *binlogrouter*.
|
||||
|
||||
```
|
||||
[Replication]
|
||||
type=service
|
||||
router=binlogrouter
|
||||
```
|
||||
|
||||
Other standard service parameters need to be given in the configuration section that are used to retrieve the set of users from the backend (master) database, also a version string can be given such that the MariaDB MaxScale instance will report this version string to the slave servers that connect to MariaDB MaxScale.
|
||||
|
||||
```
|
||||
[Replication]
|
||||
type=service
|
||||
router=binlogrouter
|
||||
version_string=5.6.17-log
|
||||
user=maxscale
|
||||
passwd=Mhu87p2D
|
||||
```
|
||||
|
||||
The *user* and *passwd* entries in the above example are used in order for MariaDB MaxScale to populate the credential information that is required to allow the slaves to connect to MariaDB MaxScale. This user should be configured in exactly the same way a for any other MariaDB MaxScale service, i.e. the user needs access to the *mysql.user* table and the *mysql.db* table as well as having the ability to perform a *SHOW DATABASES* command.
|
||||
|
||||
This user is the only one available for MySQL connection to MaxScale Binlog Server for administration when master connection is not done yet.
|
||||
|
||||
The master server details are currently provided by a **master.ini** file located in binlog directory and could be changed via *CHANGE MASTER TO* command issued via MySQL connection to MariaDB MaxScale; refer to the Master setup section below for further details.
|
||||
|
||||
In the current implementation of the router only a single server can be used.
|
||||
|
||||
The final configuration requirement is the router specific options. The binlog router requires a set of parameters to be passed, these are passed, as a comma separated list of name value pairs, in the *router_options* parameter of the service definition..
|
||||
|
||||
### binlogdir
|
||||
|
||||
This parameter allows the location that MariaDB MaxScale uses to store binlog files to be set. If this parameter is not set to a directory name then MariaDB MaxScale will store the binlog files in the directory */var/cache/maxscale/<Service Name>*.
|
||||
In the binlog dir there is also the 'cache' directory that contains data retrieved from the master during registration phase and the *master.ini* file which contains the configuration of current configured master.
|
||||
|
||||
### uuid
|
||||
|
||||
This is used to set the unique uuid that the binlog router uses when it connects to the master server.
|
||||
If no explicit value is given for the uuid in the configuration file then a uuid will be generated.
|
||||
|
||||
### server-id
|
||||
|
||||
As with uuid, MariaDB MaxScale must have a unique server-id for the connection it makes to the master, this parameter provides the value of server-id that MariaDB MaxScale will use when connecting to the master.
|
||||
|
||||
### master-id
|
||||
|
||||
The server-id value that MariaDB MaxScale should use to report to the slaves that connect to MariaDB MaxScale.
|
||||
This may either be the same as the server-id of the real master or can be chosen to be different if the slaves need to be aware of the proxy layer.
|
||||
The real master server-id will be used if the option is not set.
|
||||
|
||||
### master_uuid
|
||||
|
||||
It is a requirement of replication that each slave have a unique UUID value. The MariaDB MaxScale router will identify itself to the slaves using the uuid of the real master if this option is not set.
|
||||
|
||||
### master_version
|
||||
|
||||
The MariaDB MaxScale router will identify itself to the slaves using the server version of the real master if this option is not set.
|
||||
|
||||
### master_hostname
|
||||
|
||||
The MariaDB MaxScale router will identify itself to the slaves using the server hostname of the real master if this option is not set.
|
||||
|
||||
### user
|
||||
|
||||
This is the user name that MariaDB MaxScale uses when it connects to the master. This user name must have the rights required for replication as with any other user that a slave uses for replication purposes. If the user parameter is not given in the router options then the same user as is used to retrieve the credential information will be used for the replication connection, i.e. the user in the service entry.
|
||||
|
||||
This user is also the only one available for Binlog Server administration when the connection with master is not ready yet: the 'master.ini' file doesn't exists and no other users are available for authentication.
|
||||
|
||||
The user that is used for replication, either defined using the *user=* option in the router options or using the username and password defined of the service must be granted replication privileges on the database server.
|
||||
|
||||
```
|
||||
MariaDB> CREATE USER 'repl'@'maxscalehost' IDENTIFIED by 'password';
|
||||
MariaDB> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'maxscalehost';
|
||||
```
|
||||
|
||||
### password
|
||||
|
||||
The password of the above user. If the password is not explicitly given then the password in the service entry will be used. For compatibility with other username and password definitions within the MariaDB MaxScale configuration file it is also possible to use the parameter *passwd=*.
|
||||
|
||||
### heartbeat
|
||||
|
||||
This defines the value of the heartbeat interval in seconds for the connection to the master. MariaDB MaxScale requests the master to ensure that a binlog event is sent at least every heartbeat period. If there are no real binlog events to send the master will sent a special heartbeat event. The default value for the heartbeat period is every 5 minutes. The current interval value is reported in the diagnostic output.
|
||||
|
||||
### send_slave_heartbeat
|
||||
|
||||
This defines whether (on | off) MariaDB MaxScale sends to the slave the heartbeat packet when there are no real binlog events to send. The default value if 'off', no heartbeat event is sent to slave server. If value is 'on' the interval value (requested by the slave during registration) is reported in the diagnostic output and the packet is send after the time interval without any event to send.
|
||||
|
||||
### burstsize
|
||||
|
||||
This parameter is used to define the maximum amount of data that will be sent to a slave by MariaDB MaxScale when that slave is lagging behind the master. In this situation the slave is said to be in "catchup mode", this parameter is designed to both prevent flooding of that slave and also to prevent threads within MariaDB MaxScale spending disproportionate amounts of time with slaves that are lagging behind the master. The burst size can be defined in Kb, Mb or Gb by adding the qualifier K, M or G to the number given. The default value of burstsize is 1Mb and will be used if burstsize is not given in the router options.
|
||||
|
||||
### transaction_safety
|
||||
|
||||
This parameter is used to enable/disable incomplete transactions detection in binlog router.
|
||||
When MariaDB MaxScale starts an error message may appear if current binlog file is corrupted or an incomplete transaction is found.
|
||||
During normal operations binlog events are not distributed to the slaves until a *COMMIT* is seen.
|
||||
The default value is off, set *transaction_safety=on* to enable the incomplete transactions detection.
|
||||
|
||||
### semisync
|
||||
|
||||
This parameter controls whether binlog server could ask Master server to start the Semi-Synchronous replication.
|
||||
In order to get semi-sync working the Master server must have the *rpl_semi_sync_master* plugin installed.
|
||||
The availability of the plugin and the value of the GLOBAL VARIABLE *rpl_semi_sync_master_enabled* are checked in the Master registration phase: if the plugin is installed in the Master database the binlog server subsequently requests the semi-sync option.
|
||||
|
||||
Note:
|
||||
- the network replication stream from Master has two additional bytes before each binlog event.
|
||||
- the Semi-Sync protocol requires an acknowledge packet to be sent back to Master only when requested: the semi-sync flag will have value of 1.
|
||||
This flag is set only if *rpl_semi_sync_master_enabled=1* in the Master, otherwise it will always have value of 0 and no ack packet is sent back.
|
||||
|
||||
Please note that semi-sync replication is only related to binlog server to Master communication.
|
||||
|
||||
|
||||
### ssl_cert_verification_depth
|
||||
|
||||
This parameter sets the maximum length of the certificate authority chain that will be accepted. Legal values are positive integers.
|
||||
This applies to SSL connection to master server that could be acivated either by writing options in master.ini or later via CHANGE MASTER TO.
|
||||
This parameter cannot be modified at runtime, default is 9.
|
||||
|
||||
### `encrypt_binlog`
|
||||
Whether to encrypt binlog files: the default is Off
|
||||
|
||||
When set to On the binlog files will be encrypted using specified AES algorithm and the KEY in the specified key file.
|
||||
|
||||
### `encryption_algorithm`
|
||||
aes_ctr or aes_cbc
|
||||
|
||||
The default is 'aes_cbc'
|
||||
|
||||
### `encryption_key_file`
|
||||
The specified key file must have this format:
|
||||
a line with `1;HEX(KEY)`
|
||||
|
||||
Additional informatons about Binlog files encryption can be found here:
|
||||
[Binlogrouter - The replication protocol proxy module for MariaDB MaxScale](../Routers/Binlogrouter.md).
|
||||
|
||||
A complete example of a service entry for a binlog router service would be as follows.
|
||||
|
||||
```
|
||||
[Replication]
|
||||
type=service
|
||||
router=binlogrouter
|
||||
version_string=5.6.17-log
|
||||
user=maxscale
|
||||
passwd=Mhu87p2D
|
||||
router_options=uuid=f12fcb7f-b97b-11e3-bc5e-0401152c4c22,server-id=3,user=repl,password=slavepass,master-id=1,heartbeat=30,binlogdir=/var/binlogs,transaction_safety=1,master_version=5.6.19-common,master_hostname=common_server,master_uuid=xxx-fff-cccc-common,master-id=999,mariadb10-compatibility=1,ssl_cert_verification_depth=9,semisync=1,encrypt_binlog=1,encryption_algorithm=aes_ctr,encryption_key_file=/var/binlogs/enc_key.txt
|
||||
```
|
||||
|
||||
The minimum set of router options that must be given in the configuration are are *server-id* and *master-id*, default values may be used for all other options.
|
||||
|
||||
All configuration prameters can be found in the [Binlog Router Documentation](../Routers/Binlogrouter.md).
|
||||
|
||||
|
||||
## Listener Section
|
||||
|
||||
As per any service in MariaDB MaxScale a listener section is required to define the address, port and protocol that is used to listen for incoming connections. Those incoming connections will originate from the slave servers or from a MySQL client in order to administer/configure the master server configuration via SQL commands such as *STOP/START SLAVE* and *CHANGE MASTER TO* ...
|
||||
|
Loading…
x
Reference in New Issue
Block a user