So anyone else have some experience setting up/moving to SharDB from the Multi-DB setup provided at WPMuDEv. I've been looking at the db-settings file as I begin the process, and I just wanted to be clear.
I have 16 DBs (actually 18 with a global and 1 VIP DB) and the are named wpmu_global wpmu_0 through wpmu_9 and then wpmu_a through wpmu_f, and finally wpmu_vip1.
I guess my very first question is, would this be considered a hexidecimal based hash? If so great, then I think the following settings would be right for configuration. If not, anyone have a suggestion of how else I might declare the DBs?
// If you have multiple datacenters you can come up with your own datacenter
// detection logic (php_uname?). This helps ensure the web servers try to
// connect to the nearest database servers first, then distant ones.
define( 'DATACENTER', '' );
function add_slave($read, $host, $lhost = '', $user = DB_USER, $password = DB_PASSWORD) {
global $slaves;
$slaves[] = compact('read', 'host', 'lhost', 'name', 'user', 'password');
}
/* Add your configuration here */
/* Use this configuration for a hexidecimal based hash
Ex. you have 256 databases that follow the naming convention acct_wpmuXX
where XX is the hexidecimal hash for the blog DB
// how many characters of hexidecimal hash
$shardb_hash_length = 1;
// what is the prefix of your blog database shards (everything before the hexidecimal hash)
$shardb_prefix = 'umwblogs_wpmu_';
// set a string to be used as an internal identifier for the dataset
$shardb_dataset = 'umwblogs';
// do you want to put your primary blog (blog_id 1) in its own 'home' database?
$enable_home_db = true;
// how many, if any, VIP databases do you have?
$num_vipdbs = 1;
// add this to set the write master read priority (default 1)
$shardb_master_read = 99;
// add this if all of your databases are on a local server
$shardb_local_db = true;
// use this function to add a read slave host
add_slave($read_priority, $hostname, $local_hostname, $user, $password);
____________
Notice I didn't put in any information for the datacenter, should there be an IP address there, and I don;t believe I have a slave master situation running with this given I am on one server. But any clarification of what I might be missing here would be great. Additionally, is there information I should be filling out elsewhere in this file, even if it says your good, stop editing?
Finally, and to show what a complete loser I am, I believe these lines are commented out through this line
/* Use this configuration for a hexidecimal based hash
I imagine I should get rid of that so these settings work, right?
Idiotically yours,
Jim Groom