Hi everyone!
I`d wanto to now how to config an elgg instaltion with multiple mysql instances replication.
Thanks.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Paweł Sroka@srokap

Paweł Sroka - 0 likes
- Paweł Sroka@srokap

Paweł Sroka - 0 likes
- Gustavo Caldeira@gucaldeira

Gustavo Caldeira - 0 likes
- Paweł Sroka@srokap

Paweł Sroka - 0 likes
You must log in to post replies.In general it's possible, however keep in mind #1377 and #1349 (they seem to be mostly outdated though). Try using changes from my pull request that fixes connection selection bug and problem with configuration of databases: https://github.com/Elgg/Elgg/pull/410/
I would appreciate if you give some feedback how things are going.
I did and it works for me. I`m using an AWS RDS instance and a read replica.
My config file:
$CONFIG->connection->split = true;
$db_read = new stdClass();
$db_read->dbuser = 'dev';
$db_read->dbpass = 'dev';
$db_read->dbhost = 'localhost';
$db_read->dbname = 'database_read';
$db_write = new stdClass();
$db_write->dbuser = 'dev';
$db_write->dbpass = 'dev';
$db_write->dbhost = 'localhost';
$db_write->dbname = 'database_write';
$CONFIG->db = array();
$CONFIG->db['read'] = $db_read;
$CONFIG->db['write'] = $db_write;
Also had to change the method setup_db_connection for validade the variable $CONFIG->connection->split to correct a old bug (http://trac.elgg.org/ticket/1349):
function setup_db_connections() {
global $CONFIG, $dblink;
if (!empty($CONFIG->connection->split)) {
establish_db_link('read');
establish_db_link('write');
} else {
establish_db_link('readwrite');
}
}
Now it work like a charm. :)
Nice :-) Just notice that there's core bug in random selection of connection in case of multiple read replicas (if you're going to setup more instances eventually), you just need to replace in function establish_db_link:
With: