From 453f3fe9df070fbd10a1d3fb613f8c373cb66874 Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Tue, 27 Sep 2011 14:19:29 +0000 Subject: [PATCH] Updates for 1.1.0: plugin config files, links and so forth git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@317395 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysqlnd_ms/quickstart.xml | 210 +++++++++++++++++++++------- 1 file changed, 159 insertions(+), 51 deletions(-) diff --git a/reference/mysqlnd_ms/quickstart.xml b/reference/mysqlnd_ms/quickstart.xml index f5c9553f02..ea85a15df7 100755 --- a/reference/mysqlnd_ms/quickstart.xml +++ b/reference/mysqlnd_ms/quickstart.xml @@ -15,6 +15,17 @@ environments we urge you to read additionally the background information from the reference sections. + + + The documentation has been updated to show the syntax used as of version + 1.1.0-beta. PECL/mysqlnd_ms 1.1.0-beta introduces many + changes. Among + others, it is using a new JSON + based + plugin configuration file + format. + +
Setup @@ -52,46 +63,77 @@ mysqlnd_ms.ini_file=/path/to/mysqlnd_ms_plugin.ini The plugin-specific file must be readable by PHP. - The plugins configuration file is divided into one or more sections. + The plugins configuration file + is JSON based. It is divided into one or more sections. Each section has a name, for example, myapp. Every section makes its own set of configuration settings. - A section must at least list the MySQL replication master server. - The plugin supports using only one master server per section. Multi-master - MySQL replication setups are not supported. - Use the configuration directive - master[] + A section must at least 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 supported. + Use the configuration setting + master to set the hostname and the port or socket of the MySQL master server. + MySQL slave servers are configured using the + slave + keyword. Minimal plugin-specific configuration file (mysqlnd_ms_plugin.ini) - It is allowed to set no MySQL slave server but it is not recommended to do. - You should always configure at least one slave server as well. Slave servers - are set using the configuration directive - slave[]. - A configuration section may contain no, one or multiple - slave[] directives to set no, one or multiple - MySQL slaves. + It is not allowed to omit the MySQL slave server list. However, + an empty list may be configured. Doing so is not recommended. + You should always configure at least one slave server as well. + The slave server list may consist of one or more servers. + + + Server lists can use + anonymous or non-anonymous syntax. 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. Recommended minimal plugin-specific config (mysqlnd_ms_plugin.ini) @@ -128,9 +170,22 @@ slave[]=192.168.2.27:3306 Using one server as a master and as a slave (testing only!) @@ -162,9 +217,22 @@ slave[]=127.0.0.1:3306 Plugin specific configuration file (mysqlnd_ms_plugin.ini) @@ -249,16 +317,6 @@ Slave returns id = '1' - - - The plugin does not support native prepared statements. Prepared - statements are not load balanced. Most users of - PDO_MYSQL - will be unaffected by this restriction because - PDO_MYSQL is using a - client-side prepared statement emulation by default. - -
@@ -284,9 +342,22 @@ Slave returns id = '1' Plugin config with one slave and one master @@ -390,9 +461,22 @@ $mysqli->close(); Plugin config with one slave and one master @@ -529,8 +613,22 @@ $mysqli->close(); @@ -591,7 +689,7 @@ $mysqli->close(); If using PHP 5.4.0 or newer, API calls to set the autocommit mode and setting the experimental plugin configuration option - trx_stickiness=master + trx_stickiness=master the plugin can automatically disable load balancing and connection switches for SQL transactions. In this configuration the plugin stops load balancing, if autocommit is disabled and directs all statements to @@ -604,10 +702,23 @@ $mysqli->close(); Experimental trx_stickiness setting @@ -618,9 +729,6 @@ trx_stickiness=master close(); The plugin configuration option - trx_stickiness=master + trx_stickiness=master is an experimental feature. It requires PHP 5.4.0 or newer.