diff --git a/CMakeLists.txt b/CMakeLists.txt index 6780205fb..dcf65c091 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,10 @@ find_package(TCMalloc) find_package(Jemalloc) find_package(Git) find_package(CURL) + +# Build PCRE2 +include(cmake/BuildPCRE2.cmake) + # You can find the variables set by this in the FindCURL.cmake file # which is a default module in CMake. diff --git a/Documentation/Getting-Started/Configuration-Guide.md b/Documentation/Getting-Started/Configuration-Guide.md index c3a608b2d..b41d51391 100644 --- a/Documentation/Getting-Started/Configuration-Guide.md +++ b/Documentation/Getting-Started/Configuration-Guide.md @@ -22,6 +22,23 @@ connection failover| When a connection currently being used between MaxScale and backend database | A term used to refer to a database that sits behind MaxScale and is accessed by applications via MaxScale. filter | A module that can be placed between the client and the MaxScale router module. All client data passes through the filter module and may be examined or modified by the filter modules. Filters may be chained together to form processing pipelines. +# Table of Contents + +* [Configuration](#configuration) + * [Global Settings](#global-settings) + * [Service](#service) + * [Service and SSL](#service-and-ssl) + * [Server](#server) + * [Listener](#listener) + * [Filter](#filter) + * [Monitor](#monitor) + * [Protocol](#protocol) +* [Router Modules](#router-modules) +* [Monitor Modules](#monitor-modules) +* [Filter Modules](#filter-modules) +* [Reloading Configuration](#reloading-configuration) +* [Authentication](#authentication) +* [Error Reporting](#error-reporting) ## Configuration @@ -50,11 +67,11 @@ Please see the section about [Protocol Modules](#protocol-modules) for more deta ### Global Settings -The global settings, in a section named `[MaxScale]`, allow various parameters that affect MaxScale as a whole to be tuned. Currently the only setting that is supported is the number of threads to use to handle the network traffic. MaxScale will also accept the section name of `[gateway]` for global settings. This is for backward compatibility with versions prior to the naming of MaxScale. +The global settings, in a section named `[MaxScale]`, allow various parameters that affect MaxScale as a whole to be tuned. #### `threads` -To control the number of threads that poll for network traffic set the parameter threads to a number. It is recommended that you start with a single thread and add more as you find the performance is not satisfactory. MaxScale is implemented to be very thread efficient, so a small number of threads is usually adequate to support reasonably heavy workloads. Adding more threads may not improve performance and can consume resources needlessly. +This parameter controls the number of worker threads that are handling the events coming from the kernel. MaxScale will auto-detect the number of processors of the system unless number of threads is manually configured. It is recommended that you let MaxScale detect how many cores the system has and leave this parameter undefined. The number of used cores will be logged into the message logs and if you are not satisfied with the auto-detected value, you can manually configure it. Increasing the amount of worker threads beyond the number of processor cores does not improve performance and can consume resources needlessly. ``` # Valid options are: @@ -350,6 +367,16 @@ This parameter takes a boolean value and when enabled, will strip all `\` charac Enabling this feature will transform wildcard grants to individual database grants. This will consume more memory but authentication in MaxScale will be done faster. The parameter takes a boolean value. +#### `retry_on_failure` + +The retry_on_failure parameter controls whether MaxScale will try to restart failed services and accepts a boolean value. This functionality is enabled by default to prevent services being permanently disabled if the starting of the service failed due to a network outage. Disabling the restarting of the failed services will cause them to be permanently disabled if the services can't be started when MaxScale is started. + +#### `log_auth_warnings` + +Enable or disable the logging of authentication failures and warnings. This parameter takes a boolean value. + +MaxScale normally suppresses warning messages about failed authentication. Enabling this option will log those messages into the message log with details about who tried to connect to MaxScale and from where. + #### `connection_timeout` The connection_timeout parameter is used to disconnect sessions to MaxScale that have been idle for too long. The session timeouts are disabled by default. To enable them, define the timeout in seconds in the service's configuration section. @@ -692,7 +719,7 @@ Default value is `1`. Read Timeout is the timeout in seconds for each attempt to Default value is `2`. Write Timeout is the timeout in seconds for each attempt to write to the server. There is a retry if necessary, so the total effective timeout value is two times the option value. That's for `mysql_real_connect` C API. -## Protocol Modules +## Protocol The protocols supported by MaxScale are implemented as external modules that are loaded dynamically into the MaxScale core. These modules reside in the directory `/usr/lib64/maxscale`. The location can be overridden with the `libdir=PATH` parameter under the `[maxscale]` section. It may also be set by passing the `-B PATH` or `--libdir=PATH` option on the MaxScale command line. diff --git a/Documentation/Reference/Hint-Syntax.md b/Documentation/Reference/Hint-Syntax.md index a037365e0..4f5d17f30 100644 --- a/Documentation/Reference/Hint-Syntax.md +++ b/Documentation/Reference/Hint-Syntax.md @@ -14,7 +14,7 @@ router_options=master servers=server1 user=maxuser passwd=maxpwd -filter=Hint +filters=Hint [Hint] type=filter 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=