Mysqlnd replication and load balancing plugin (
mysqlnd_ms
)
2560
"master": {
"master_0": {
"host": "localhost"
}
},
"slave": [
]
}
}
Configuring a MySQL slave server list is required, although it may contain an empty list. It is
recommended to always configure at least one slave server.
Server lists can use
anonymous or non-anonymous syntax [2604]
. Non-anonymous lists include alias
names for the servers, such as
master_0
for the master in the above example. The quickstart uses
the more verbose non-anonymous syntax.
Example 20.217. Recommended minimal plugin-specific config (mysqlnd_ms_plugin.ini)
{
"myapp": {
"master": {
"master_0": {
"host": "localhost",
"socket": "\/tmp\/mysql.sock"
}
},
"slave": {
"slave_0": {
"host": "192.168.2.27",
"port": "3306"
}
}
}
}
If there are at least two servers in total, the plugin can start to load balance and switch connections.
Switching connections is not always transparent and can cause issues in certain cases. The reference
sections about
connection pooling and switching
,
transaction handling
,
fail over
load balancing
and
read-write splitting
all provide more details. And potential pitfalls are described later in this guide.
It is the responsibility of the application to handle potential issues caused by connection switches, by
configuring a master with at least one slave server, which allows switching to work therefore related
problems can be found.
The MySQL master and MySQL slave servers, which you configure, do not need to be part of MySQL
replication setup. For testing purpose you can use single MySQL server and make it known to the
plugin as a master and slave server as shown below. This could help you to detect many potential
issues with connection switches. However, such a setup will not be prone to the issues caused by
replication lag.
Example 20.218. Using one server as a master and as a slave (testing only!)
{
"myapp": {
"master": {
"master_0": {
"host": "localhost",
"socket": "\/tmp\/mysql.sock"
}
},
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 ...