Merge remote-tracking branch 'origin/develop' into MXS-105

Conflicts (resolved):
	server/modules/routing/schemarouter/schemarouter.c
This commit is contained in:
counterpoint
2015-05-05 10:54:09 +01:00
3 changed files with 29 additions and 5 deletions

View File

@ -410,6 +410,8 @@ In order for the various router modules to function correctly they require infor
Monitors are defined in much the same way as other elements in the configuration file, with the section name being the name of the monitor instance and the type being set to monitor.
This is an example configuration of the MySQL monitor module. It is intended for Master-Slave replication clusters and allows for replication lag detection.
```
[MySQL Monitor]
type=monitor
@ -425,7 +427,11 @@ backend_write_timeout=2
# mysqlmon specific options
detect_replication_lag=0
detect_stale_master=0
```
Here is an example configuration of the Galera cluster monitor. It detects when nodes are in sync and also assigns master and slave roles to nodes within MaxScale, allowing it to be used with modules designed for Master-Slave replication clusters.
```
[Galera Monitor]
type=monitor
module=galeramon
@ -451,6 +457,8 @@ The module parameter defines the name of the loadable module that implements the
The servers parameter is a comma separated list of server names to monitor, these are the names defined elsewhere in the configuration file. The set of servers monitored by a single monitor need not be the same as the set of servers used within any particular server, a single monitor instance may monitor servers in multiple servers.
Multiple monitors monitoring the same servers should be avoided. They can possibly make the whole cluster inoperable and a good example is the mixed use of the MySQL and the Galera monitors. The MySQL monitor requires a working Master-Slave replication for it to assign the Master and Slave roles inside MaxScale but the Galera monitor only looks for Galera specific status variables. These two monitors will cause a conflict when one tries to clear server states it sees as valid while the other is simultaneously setting new states to the rest of the servers.
#### `user`
The user parameter defines the username that the monitor will use to connect to the monitored databases. Depending on the monitoring module used this user will require specific privileges in order to determine the state of the nodes, details of those privileges can be found in the sections on each of the monitor modules.

View File

@ -74,7 +74,7 @@ Each mandatory rule accepts one or more optional parameters. These are to be def
#### `at_times`
This rule expects a list of time ranges that define the times when the rule in question is active. The time formats are expected to be ISO-8601 compliant and to be separated by a single dash (the - character). For example, to define the active period of a rule to be 5pm to 7pm, you would include `at times 17:00:00-19:00:00` in the rule definition.
This rule expects a list of time ranges that define the times when the rule in question is active. The time formats are expected to be ISO-8601 compliant and to be separated by a single dash (the - character). For example, to define the active period of a rule to be 5pm to 7pm, you would include `at times 17:00:00-19:00:00` in the rule definition. The rule uses local time to check if the rule is active and has a precision of one second.
#### `on_queries`

View File

@ -32,7 +32,7 @@ The regex filter accepts the options ignorecase or case. These define if the pat
The Regex filter requires two mandatory parameters to be defined.
### Match
### `match`
A parameter that can be used to match text in the SQL statement which should be replaced.
@ -42,7 +42,7 @@ match=TYPE[ ]*=
If the filter option ignorecase is used all regular expressions are evaluated with the option to ignore the case of the text, therefore a match option of select will match both type, TYPE and any form of the word with upper or lowercase characters.
### Replace
### `replace`
The replace parameter defines the text that should replace the text in the SQL text which matches the match.
@ -50,7 +50,7 @@ The replace parameter defines the text that should replace the text in the SQL t
replace=ENGINE =
```
### Source
### `source`
The optional source parameter defines an address that is used to match against the address from which the client connection to MaxScale originates. Only sessions that originate from this address will have the match and replacement applied to them.
@ -58,7 +58,7 @@ The optional source parameter defines an address that is used to match against t
source=127.0.0.1
```
### User
### `user`
The optional user parameter defines a user name that is used to match against the user from which the client connection to MaxScale originates. Only sessions that are connected using this username will have the match and replacement applied to them.
@ -66,6 +66,22 @@ The optional user parameter defines a user name that is used to match against th
user=john
```
### `log_file`
The optional log_file parameter defines a log file in which the filter writes all queries that are not mached and maching queries with their replacement queries. All sessions will log to this file so this should only be used for diagnostic purposes.
```
log_file=/tmp/regexfilter.log
```
### `log_trace`
The optional log_trace parameter toggles the logging of non-matching and matching queries with their replacements into the trace log file. This is the preferred method of diagnosing the matching of queries since the trace log can be disabled mid-session if such a need rises.
```
log_trace=true
```
## Examples
### Example 1 - Replace MySQL 5.1 create table syntax with that for later versions