From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:$wgExternalServers and the translation is 31% complete.
Other languages:
English • ‎Nederlands • ‎español • ‎français • ‎magyar • ‎polski • ‎português do Brasil • ‎中文 • ‎日本語
Content handlers and storage: $wgExternalServers
An array of external MySQL servers.
Wprowadzono w wersji:1.5.0 (r9118)
Usunięto w wersji:nadal w użyciu
Dozwolone wartości:(zobacz poniżej)
Domyślna wartość:[]


An array of external MySQL servers.

$wgExternalServers collects all the usable clusters with all usable nodes of a cluster.

The top-level array's keys denote a cluster's name (The below example defines only one cluster. It has the name demoCluster).

The value to those keys are again arrays. They hold the specifications of the individual nodes, using the same format as $wgDBservers .

The first node is considered the master. All writes to the database are performed through this master node.

Zero or more slave nodes may follow. (In the example below, you find two slave nodes).

Each node should have its own host, user, password, dbname, and type, as shown in the example. The load parameter allows to specify how much of the load should pass through this node.


$wgExternalServers = [ 'demoCluster' => [
  [ 'host' => 'master.example.org', 'user' => 'userM',  'password' =>'pwdM',  'dbname' => 'dbM',  'type' => "mysql", 'load' => 1 ],
  [ 'host' => 'slave1.example.org', 'user' => 'userS1', 'password' =>'pwdS1', 'dbname' => 'dbS1', 'type' => "mysql", 'load' => 1 ],
  [ 'host' => 'slave2.example.org', 'user' => 'userS2', 'password' =>'pwdS2', 'dbname' => 'dbS2', 'type' => "mysql", 'load' => 1 ]

See External Storage for a discussion of this example, and how to turn this into a usable cluster configuration.