diff --git a/Documentation/Routers/ReadWriteSplit.md b/Documentation/Routers/ReadWriteSplit.md index ec89db65f..c6e5f456f 100644 --- a/Documentation/Routers/ReadWriteSplit.md +++ b/Documentation/Routers/ReadWriteSplit.md @@ -16,22 +16,31 @@ The configuration consists of mandatory and optional parameters. ## Mandatory parameters +### `type` + **`type`** specifies the type of service. For **readwritesplit** module the type is `router`: type=router +### `router` + **`router`** specifies the router module to be used. For **readwritesplit** the value is `readwritesplit`: router=readwritesplit +### `servers` + **`servers`** provides a list of servers, which must include one master and available slaves: servers=server1,server2,server3 **NOTE: Each server on the list must have its own section in the configuration file where it is defined.** +### `user` **`user`** is the username the router session uses for accessing backends in order to load the content of the `mysql.user` table (and `mysql.db` and database names as well) and optionally for creating, and using `maxscale_schema.replication_heartbeat` table. +### `passwd` + **`passwd`** specifies corresponding password for the user. Syntax for user and passwd is: ``` @@ -41,10 +50,13 @@ passwd= ## Optional parameters +### `max_slave_connections` + **`max_slave_connections`** sets the maximum number of slaves a router session uses at any moment. Default value is `1`. max_slave_connections= +### `max_slave_replication_lag` **`max_slave_replication_lag`** specifies how many seconds a slave is allowed to be behind the master. If the lag is bigger than configured value a slave can't be used for routing. max_slave_replication_lag= @@ -52,16 +64,8 @@ passwd= This applies to Master/Slave replication with MySQL monitor and `detect_replication_lag=1` options set. Please note max_slave_replication_lag must be greater than monitor interval. -**`router_options`** may include multiple **readwritesplit**-specific options. Values are either singular or parameter-value pairs. Currently available is a single option which specifies the criteria used in slave selection both in initialization of router session and per each query. Note that due to the current monitor implementation, the value specified here should be ** + 1. - options=slave_selection_criteria= - -where ** is one of the following: - -* `LEAST_GLOBAL_CONNECTIONS`, the slave with least connections in total -* `LEAST_ROUTER_CONNECTIONS`, the slave with least connections from this router -* `LEAST_BEHIND_MASTER`, the slave with smallest replication lag -* `LEAST_CURRENT_OPERATIONS` (default), the slave with least active operations +### `use_sql_variables_in` **`use_sql_variables_in`** specifies where should queries, which read session variable, be routed. The syntax for `use_sql_variable_in` is: @@ -73,6 +77,35 @@ When value all is used, queries reading session variables can be routed to any a In above-mentioned case the user-defined variable would only be updated in the master where query would be routed due to `INSERT` statement. +## Router options + +**`router_options`** may include multiple **readwritesplit**-specific options. All the options are parameter-value pairs. All parameters listed in this section must be configured as a value in `router_options`. + +Multiple options can be defined as a comma-separated list of parameter-value pairs. + +``` +router_options=