Create mini-tutorials for monitor and server configuration

The tutorials combine the Galera and MariaDB monitor configuration as well
as the server configuration sections that were duplicated for all
tutorials. This should make the documentation easier to maintain.
This commit is contained in:
Markus Mäkelä
2018-03-09 10:31:19 +02:00
parent 2023ee4dc7
commit 944d47167f
6 changed files with 140 additions and 162 deletions

View File

@ -0,0 +1,60 @@
# Configuring the Galera Monitor
This document describes how to configure a Galera cluster monitor.
## Configuring the Servers
The first step is to define the servers that make up the cluster. These servers will be used by the services and are monitored by the monitor.
```
[dbserv1]
type=server
address=192.168.2.1
port=3306
protocol=MariaDBBackend
[dbserv2]
type=server
address=192.168.2.2
port=3306
protocol=MariaDBBackend
[dbserv3]
type=server
address=192.168.2.3
port=3306
protocol=MariaDBBackend
```
## Configuring the Monitor
The next step is to define the monitor that monitors the servers.
```
[Galera-Monitor]
type=monitor
module=galeramon
servers=dbserv1, dbserv2, dbserv3
user=monitor_user
password=my_password
monitor_interval=2000
```
The mandatory parameters are the object type, the monitor module to use, the
list of servers to monitor and the username and password to use when connecting
to the servers. The `monitor_interval` parameter controls how many milliseconds
the monitor waits between each monitoring loop.
This monitor module will assign one node within the Galera Cluster as the
current master and other nodes as slave. Only those nodes that are active
members of the cluster are considered when making the choice of master node. The
master node will be the node with the lowest value of `wsrep_local_index`.
## Monitor User
The monitor user does not require any special grants to monitor a Galera
cluster. To create a user for the monitor, execute the following SQL.
```
CREATE USER 'monitor_user'@'%' IDENTIFIED BY 'my_password';
```

View File

@ -0,0 +1,56 @@
# Configuring the MariaDB Monitor
This document describes how to configure a MariaDB master-slave cluster monitor to be used with MaxScale.
## Configuring the Servers
The first step is to define the servers that make up the cluster. These servers will be used by the services and are monitored by the monitor.
```
[dbserv1]
type=server
address=192.168.2.1
port=3306
protocol=MariaDBBackend
[dbserv2]
type=server
address=192.168.2.2
port=3306
protocol=MariaDBBackend
[dbserv3]
type=server
address=192.168.2.3
port=3306
protocol=MariaDBBackend
```
## Configuring the Monitor
The next step is to define the monitor that monitors the servers.
```
[Replication-Monitor]
type=monitor
module=mariadbmon
servers=dbserv1, dbserv2, dbserv3
user=monitor_user
password=my_password
monitor_interval=2000
```
The mandatory parameters are the object type, the monitor module to use, the
list of servers to monitor and the username and password to use when connecting
to the servers. The `monitor_interval` parameter controls how many milliseconds
the monitor waits between each monitoring loop.
## Monitor User
The monitor user requires the REPLICATION CLIENT privileges to do basic
monitoring. To create a user with the proper grants, execute the following SQL.
```
CREATE USER 'monitor_user'@'%' IDENTIFIED BY 'my_password';
GRANT REPLICATION CLIENT on *.* to 'monitor_user'@'%';
```

View File

@ -135,50 +135,14 @@ An address parameter may be given if the listener is required to bind to a parti
network address when using hosts with multiple network addresses.
The default behavior is to listen on all network interfaces.
The next stage is the configuration is to define the server information.
This defines how to connect to each of the servers within the cluster, again a section
is created for each server, with the type set to server, the network address and port to
connect to and the protocol to use to connect to the server. Currently the protocol for
all database connections in MariaDBBackend.
## Configuring the Monitor and Servers
```
[dbserv1]
type=server
address=192.168.2.1
port=3306
protocol=MariaDBBackend
The next step is the configuration of the monitor and the servers that the
service uses. This is process described in the
[Configuring Galera Monitor](Configuring-Galera-Monitor.md)
document.
[dbserv2]
type=server
address=192.168.2.2
port=3306
protocol=MariaDBBackend
[dbserv3]
type=server
address=192.168.2.3
port=3306
protocol=MariaDBBackend
```
In order for MariaDB MaxScale to monitor the servers using the correct monitoring
mechanisms a section should be provided that defines the monitor to use and
the servers to monitor. Once again a section is created with a symbolic name for
the monitor, with the type set to monitor. Parameters are added for the module to use,
the list of servers to monitor and the username and password to use when connecting to
the servers with the monitor.
```
[Galera Monitor]
type=monitor
module=galeramon
servers=dbserv1, dbserv2, dbserv3
user=maxscale
passwd=96F99AA1315BDC3604B006F427DD9484
```
As with the password definition in the server either plain text or encrypted
passwords may be used.
## Configuring the Administrative Interface
The final stage in the configuration is to add the option service which is used by
the maxadmin command to connect to MariaDB MaxScale for monitoring and

View File

@ -85,54 +85,14 @@ port=3306
An address parameter may be given if the listener is required to bind to a particular network address when using hosts with multiple network addresses. The default behavior is to listen on all network interfaces.
The next stage is the configuration is to define the server information. This defines how to connect to each of the servers within the cluster, again a section is created for each server, with the type set to server, the network address and port to connect to and the protocol to use to connect to the server. Currently the protocol module for all database connections in `MariaDBBackend`.
## Configuring the Monitor and Servers
```
[dbserv1]
type=server
address=192.168.2.1
port=3306
protocol=MariaDBBackend
The next step is the configuration of the monitor and the servers that the
service uses. This is process described in the
[Configuring Galera Monitor](Configuring-Galera-Monitor.md)
document.
[dbserv2]
type=server
address=192.168.2.2
port=3306
protocol=MariaDBBackend
[dbserv3]
type=server
address=192.168.2.3
port=3306
protocol=MariaDBBackend
```
In order for MariaDB MaxScale to monitor the servers using the correct monitoring mechanisms a section should be provided that defines the monitor to use and the servers to monitor. Once again a section is created with a symbolic name for the monitor, with the type set to monitor. Parameters are added for the module to use, the list of servers to monitor and the username and password to use when connecting to the the servers with the monitor.
```
[Galera Monitor]
type=monitor
module=galeramon
servers=dbserv1, dbserv2, dbserv3
user=maxscale
passwd=96F99AA1315BDC3604B006F427DD9484
```
As with the password definition in the server either plain text or encrypted passwords may be used.
This monitor module will assign one node within the Galera Cluster as the current master and other nodes as slave. Only those nodes that are active members of the cluster are considered when making the choice of master node. Normally the master node will be the node with the lowest value of the status variable, `WSREP_LOCAL_INDEX`. When cluster membership changes a new master may be elected. In order to prevent changes of the node that is currently master, a parameter can be added to the monitor that will result in the current master remaining as master even if a node with a lower value of `WSREP_LOCAL_INDEX` joins the cluster. This parameter is called `disable_master_failback`.
```
[Galera Monitor]
type=monitor
module=galeramon
disable_master_failback=1
servers=dbserv1, dbserv2, dbserv3
user=maxscale
passwd=96F99AA1315BDC3604B006F427DD9484
```
Using this option the master node will only change if there is a problem with the current master and never because other nodes have joined the cluster.
## Configuring the Administrative Interface
The final stage in the configuration is to add the option service which is used by the maxadmin command to connect to MariaDB MaxScale for monitoring and administration purposes. This creates a service section and a listener section.

View File

@ -126,41 +126,14 @@ port=4307
An address parameter may be given if the listener is required to bind to a particular network address when using hosts with multiple network addresses. The default behavior is to listen on all network interfaces.
The next stage is the configuration is to define the server information. This defines how to connect to each of the servers within the cluster, again a section is created for each server, with the type set to server, the network address and port to connect to and the protocol to use to connect to the server. Currently the protocol for all database connections in MariaDBBackend.
## Configuring the Monitor and Servers
```
[dbserv1]
type=server
address=192.168.2.1
port=3306
protocol=MariaDBBackend
The next step is the configuration of the monitor and the servers that the
service uses. This is process described in the
[Configuring MariaDB Monitor](Configuring-MariaDB-Monitor.md)
document.
[dbserv2]
type=server
address=192.168.2.2
port=3306
protocol=MariaDBBackend
[dbserv3]
type=server
address=192.168.2.3
port=3306
protocol=MariaDBBackend
```
In order for MariaDB MaxScale to monitor the servers using the correct monitoring mechanisms a section should be provided that defines the monitor to use and the servers to monitor. Once again a section is created with a symbolic name for the monitor, with the type set to monitor. Parameters are added for the module to use, the list of servers to monitor and the username and password to use when connecting to the the servers with the monitor.
```
[Replication-Monitor]
type=monitor
module=mariadbmon
servers=dbserv1, dbserv2, dbserv3
user=maxscale
passwd=96F99AA1315BDC3604B006F427DD9484
monitor_interval=10000
```
As with the password definition in the server either plain text or encrypted passwords may be used.
## Configuring the Administrative Interface
The final stage in the configuration is to add the option service which is used by the maxadmin command to connect to MariaDB MaxScale for monitoring and administration purposes. This creates a service section and a listener section.

View File

@ -121,49 +121,14 @@ An address parameter may be given if the listener is required to bind to a
particular network address when using hosts with multiple network addresses. The
default behavior is to listen on all network interfaces.
The next stage in the configuration is to define the backend servers. The
definitions include how to connect to the servers. A section is created for each
server and it contains: `type` set to `server`, the network address and port,
and the protocol to use. Currently, the protocol module for all database
connections is `MariaDBBackend`.
## Configuring the Monitor and Servers
```
[dbserv1]
type=server
address=192.168.2.1
port=3306
protocol=MariaDBBackend
The next step is the configuration of the monitor and the servers that the
service uses. This is process described in the
[Configuring MariaDB Monitor](Configuring-MariaDB-Monitor.md)
document.
[dbserv2]
type=server
address=192.168.2.2
port=3306
protocol=MariaDBBackend
[dbserv3]
type=server
address=192.168.2.3
port=3306
protocol=MariaDBBackend
```
For MariaDB MaxScale to monitor the servers using the correct monitoring
mechanisms a monitor section should be written. This section defines the monitor
module to use and the monitored servers. The section `type` should be set to
`monitor`. Parameters added include: the list of servers to monitor and the
username and password the monitor module should use when connecting.
```
[Replication Monitor]
type=monitor
module=mariadbmon
servers=dbserv1, dbserv2, dbserv3
user=maxscale
passwd=96F99AA1315BDC3604B006F427DD9484
```
Similarly to the password definition in the server either a plain text or an
encrypted password may be used.
## Configuring the Administrative Interface
The final stage in the configuration is to add the service which used by the
`maxadmin` command to connect to MariaDB MaxScale for monitoring and