Blackbeard
Well-known member
Should I put the master in the slave array also and if it will rotate all of those?
ErrorException: Undefined index: digitalPoint - library/Zend/DigitalPoint/Mysqli.php:34
Generated By: Unknown Account, 6 minutes ago
Stack Trace
#0 /public_html/site.com/library/Zend/DigitalPoint/Mysqli.php(34): XenForo_Application::handlePhpError(8, 'Undefined index...', '/public_html...', 34, Array)
#1 /public_html/site.com/library/Zend/Db/Adapter/Abstract.php(858): DigitalPoint_Mysqli->_connect()
#2 /public_html/site.com/library/XenForo/Model/DataRegistry.php(143): Zend_Db_Adapter_Abstract->quote(Array)
#3 /public_html/site.com/library/XenForo/Model/DataRegistry.php(97): XenForo_Model_DataRegistry->_getMultiFromDb(Array)
#4 /public_html/site.com/library/XenForo/Dependencies/Abstract.php(147): XenForo_Model_DataRegistry->getMulti(Array)
#5 /public_html/site.com/library/XenForo/FrontController.php(127): XenForo_Dependencies_Abstract->preLoadData()
#6 /public_html/site.com/index.php(13): XenForo_FrontController->run()
#7 {main}
Request State
array(3) {
["url"] => string(83) "http://www.site.com/threads/post-some-unusual-marbles.103/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
ErrorException: array_rand() expects parameter 1 to be array, null given - library/Zend/DigitalPoint/Mysqli.php:36
Generated By: Unknown Account, 2 minutes ago
Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'array_rand() ex...', '/public_html...', 36, Array)
#1 /site.com/library/Zend/DigitalPoint/Mysqli.php(36): array_rand(NULL)
#2 /site.com/library/Zend/Db/Adapter/Abstract.php(858): DigitalPoint_Mysqli->_connect()
#3 /site.com/library/XenForo/Model/DataRegistry.php(143): Zend_Db_Adapter_Abstract->quote(Array)
#4 /site.com/library/XenForo/Model/DataRegistry.php(97): XenForo_Model_DataRegistry->_getMultiFromDb(Array)
#5 /site.com/library/XenForo/Dependencies/Abstract.php(147): XenForo_Model_DataRegistry->getMulti(Array)
#6 /site.com/library/XenForo/FrontController.php(127): XenForo_Dependencies_Abstract->preLoadData()
#7 /site.com/index.php(13): XenForo_FrontController->run()
#8 {main}
Request State
array(3) {
["url"] => string(41) "https://www.site.com/posts/xxxxxxxx/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
$config['db']['adapterNamespace'] = 'DigitalPoint';
$GLOBALS['digitalPoint']['SlaveServerAll'][] = 'XXXXX';
Yep works fine with 1.5
No idea, sorry. If it uses something that is different than how MySQL Master/Slave works then no... it would not work.
Master/slave support in DB adapter
XF2 introduces master/slave replication via a new DB adapter which allows separate read and write connections to be made. By default, select statements will be sent to the read server and all other statements will be sent to the write server.
You can see a typical example of configuration below:
As well as inferring the correct connection to make from the type of query, you can also control the behavior by prefixing a query with a comment in the form ofPHP:$config['db']['adapterClass'] = 'XF\Db\Mysqli\ReplicationAdapter'; $config['db']['write'] = [ 'host' => '192.168.10.1', // ... username, password, dbname etc. ]; $config['db']['read'] = [ 'host' => '192.168.10.2', // ... username, password, dbname etc. ];
-- XFDB=modifier
.
Where themodifier
is one of:
fromWrite
- forces a specific read query to come from the write server even if it normally wouldn'tforceAllWrite
- forces this query and all subsequent queries to the write servernoForceAllWrite
- if this query would normally force all subsequent queries to the write server, this option disables that (useful for a write you know won't be read back immediately or if it is, can tolerate lag)
We use essential cookies to make this site work, and optional cookies to enhance your experience.