Oracle 5.0 Reference Manual page 2579

Table of Contents

Advertisement

The shortcut
a quick-and-dirty proof-of-concept. In the beginning the developers did not expect to continue using the
code base.
20.7.6.4. Quickstart and Examples
Copyright 1997-2012 the PHP Documentation Group. [2230]
The mysqlnd replication load balancing plugin is easy to use. This quickstart will demo typical use-
cases, and provide practical advice on getting started.
It is strongly recommended to read the reference sections in addition to the quickstart. The quickstart
tries to avoid discussing theoretical concepts and limitations. Instead, it will link to the reference
sections. It is safe to begin with the quickstart. However, before using the plugin in mission critical
environments we urge you to read additionally the background information from the reference sections.
The focus is on using PECL mysqlnd_ms for work with an asynchronous MySQL cluster, namely
MySQL replication. Generally speaking an asynchronous cluster is more difficult to use than a
synchronous one. Thus, users of, for example, MySQL Cluster will find more information than needed.
20.7.6.4.1. Setup
Copyright 1997-2012 the PHP Documentation Group. [2230]
The plugin is implemented as a PHP extension. See also the
PECL/mysqlnd_ms
Compile or configure the PHP MySQL extension (API) (mysqli, PDO_MYSQL, mysql) that you plan to
use with support for the
the plugin with any of the PHP MySQL extensions, the extension has to use the mysqlnd library.
Then, load the extension into PHP and activate the plugin in the PHP configuration file using the PHP
configuration directive named mysqlnd_ms.enable.
Example 20.215. Enabling the plugin (php.ini)
mysqlnd_ms.enable=1
mysqlnd_ms.config_file=/path/to/mysqlnd_ms_plugin.ini
The plugin uses its own configuration file. Use the PHP configuration directive
to set the full file path to the plugin-specific configuration file. This file must be readable by PHP (e.g.,
the web server user). Please note, the configuration directive
mysqlnd_ms.ini_file
directive.
Create a plugin-specific configuration file. Save the file to the path set by the PHP configuration
directive mysqlnd_ms.config_file.
The plugins
a name, for example, myapp. Every section makes its own set of configuration settings.
A section must, at a minimum, list the MySQL replication master server, and set a list of slaves. The
plugin supports using only one master server per section. Multi-master MySQL replication setups are
not yet fully supported. Use the configuration setting
of the MySQL master server. MySQL slave servers are configured using the
Example 20.216. Minimal plugin-specific configuration file (mysqlnd_ms_plugin.ini)
{
"myapp": {
Mysqlnd replication and load balancing plugin (mysqlnd_ms)
stands for
mysqlnd_ms
extension.
mysqlnd
library. PECL/mysqlnd_ms is a plugin for the mysqlnd library. To use
since 1.4.0. It is a common pitfall to use the old, no longer available configuration
configuration file
is JSON based. It is divided into one or more sections. Each section has
mysqlnd master slave
master
to set the hostname, and the port or socket
2559
plugin. The name was chosen for
installation instructions
mysqlnd_ms.config_file
mysqlnd_ms.config_file
slave
keyword.
to install the
superseeds

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents