Oracle 5.0 Reference Manual page 2580

Table of Contents

Advertisement

Mysqlnd replication and load balancing plugin (mysqlnd_ms)
"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
names for the servers, such as
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
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"
}
},
for the master in the above example. The quickstart uses
master_0
switching,
transaction
2560
[2604]. Non-anonymous lists include alias
handling,
fail over load balancing
and

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents