Manual:$wgDBservers/cs

Podrobnosti
Nástroj pro vyrovnávání zatížení databáze. Toto je dvourozměrné pole, pole informačních struktur serveru. Pole jsou:


 * host
 * Název hostitele (viz ). Pro MySQL může obsahovat port nebo cestu soketu za dvojtečkou.


 * dbname
 * Výchozí název databáze (viz )


 * user
 * Uživatel DB (viz )


 * password
 * Heslo DB (viz )


 * type
 * "mysql" nebo "pgsql" (viz )


 * load
 * poměr zatížení DB_REPLICA, musí být >=0, součet všech zatížení musí být >0


 * groupLoads
 * pole poměrů zatížení, klíčem je název skupiny dotazů. Dotaz může patřit do několika skupin, používá se nejkonkrétnější zde definovaná skupina.


 * max lag
 * (volitelné) Maximální prodleva replikace, než bude replika vyřazena z rotace


 * max threads
 * (volitelné) Maximální počet běžících vláken


 * flags
 * bitové pole:
 * DBO_DEFAULT -- zapne DBO_TRX pouze pokud != true (doporučeno)
 * DBO_DEBUG -- equivalent of
 * DBO_TRX -- automatically start transactions (see )
 * DBO_IGNORE -- ignore errors (not useful in LocalSettings.php)
 * DBO_NOBUFFER -- turn off buffering (not useful in LocalSettings.php)
 * DBO_SSL -- use a secure connection
 * DBO_COMPRESS -- compress communication
 * DBO_PERSISTENT -- enable persistent connections


 * ssl
 * Boolean, whether to use TLS encryption. Overrides DBO_SSL.

Leave at false to use the single-server variables listed above.

The primary must be the first entry in the array.

Example 1:

This would configure one primary and two replicas, each replica getting an equal amount of read access load.

Example 2:

This would configure one server with custom SSL connection if set to  fails.

These and any other user-defined properties will be assigned to the mLBInfo member variable of the Database object.

MySQL specific options

 * lagDetectionMethod
 * Set to one of (Seconds_Behind_Master,pt-heartbeat). pt-heartbeat assumes the table is at heartbeat.heartbeat and uses UTC timestamps in the heartbeat.ts column. (https://www.percona.com/doc/percona-toolkit/2.2/pt-heartbeat.html)


 * lagDetectionOptions
 * If using pt-heartbeat, this can be set to an array map to change the default behavior. Normally, the heartbeat row with the server ID of this server's primary will be used. Set the "conds" field to override the query conditions, e.g. ['shard' => 's1'].


 * useGTIDs
 * Use GTID methods like MASTER_GTID_WAIT when possible.


 * sslKeyPath
 * Path to key file.


 * sslCertPath
 * Path to certificate file.


 * sslCAFile
 * Path to a single certificate authority PEM file.


 * sslCAPath
 * Path to certificate authority PEM directory.


 * sslCiphers
 * Array list of allowable ciphers.

PostgreSQL specific options

 * port
 * Port to connect to the server.


 * keywordTableMap
 * Map of reserved table names to alternative table names to use

SQLite specific options

 * dbFilePath : Path to the database file.
 * dbDirectory : Path to the directory containing the database file. Only needed if dbFilePath is not specified, and requires dbname.
 * dbname : Name of the database (without the .sqlite extension). Only needed if dbFilePath is not specified, and requires dbDirectory.
 * trxMode : Transaction mode. One of DEFERRED, IMMEDIATE or EXCLUSIVE.

MSSQL specific options

 * port
 * Port to connect to the server.


 * UseWindowsAuth
 * Use Integrated Windows Authentication for authentication to the database instead of username/password.

Important notes
If you switch to this, ensure you either keep set, or ensure  are set explicitly. Note also that if you only connect to one database server the  parameter needs to be set to.