Mysqlnd replication and load balancing plugin (
mysqlnd_ms
)
2605
may be empty. It is possible to allow no slaves. However, this is only recommended with synchronous
clusters, please see also
supported clusters
. The main part of the documentation focusses on the use
of asynchronous MySQL replication clusters.
The master and slave server lists can be optionally indexed by symbolic names for the servers they
describe. Alternatively, an array of descriptions for slave and master servers may be used.
Example 20.266. List of anonymous slaves
"slave": [
{
"host": "192.168.3.24",
"port": "3305"
},
{
"host": "192.168.3.65",
"port": "3309"
}
]
An anonymous server list is encoded by the
JSON array
type. Optionally, symbolic names may be
used for indexing the slave or master servers of a server list, and done so using the
JSON object
type.
Example 20.267. Master list using symbolic names
"master": {
"master_0": {
"host": "localhost"
}
}
It is recommended to index the server lists with symbolic server names. The alias names will be shown
in error messages.
The order of servers is preserved and taken into account by mysqlnd_ms. If, for example, you
configure round robin load balancing strategy, the first
SELECT
statement will be executed on the slave
that appears first in the slave server list.
A configured server can be described with the
host
,
port
,
socket
,
db
,
user
,
password
and
connect_flags
. It is mandatory to set the database server host using the
host
keyword. All other
settings are optional.
Example 20.268. Keywords to configure a server
{
"myapp": {
"master": {
"master_0": {
"host": "db_server_host",
"port": "db_server_port",
"socket": "db_server_socket",
"db": "database_resp_schema",
"user": "user",
"password": "password",
"connect_flags": 0
}
},
"slave": {
"slave_0": {
"host": "db_server_host",
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...