Using MultiDB using manual setup

leksa
Sophomore
Just Getting Started

Member    Likes (0)

Hi,..
We are test to using multidb rightnow.
The strategy is to shard more than 72000 blogs. 10000 blog IDs/one database. For 72000 IDs, so we have 9 databases.
1 global databases. 8 blogs databases.

We're using RDS from amazon. 1 multiaz for global + blog ID's 1-10000.
2 RDS for the others. Let say we separated the others blogs in a half each other.

I prefer dont use move-blog.php for the migration process. Because the data have been separated like strategy above. So, i need to set up and db-config the database to match our needs.

I have try to manually put the db-config like this:

define ('DB_SCALING', '16');
add_dc_ip('10.138.178.1xx', 'dc1');
add_global_table('dgdgdg');

//	Note: you can also place this section in a file called db-list.php in wp-content
add_db_server('global', 'dc1', 1, 1,'dgdgdg.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com','dgdgdg.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com', 'dgdgdg', 'dbdgdgdg',  '#');
add_db_server('0', 'dc1', 1, 1,'dgdgdg.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com','dgdgdg.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com', 'dgdgdg_1', 'dbdgdgdg',  '#');
add_db_server('1', 'dc1', 1, 1,'dgdgdg2.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com','dgdgdg2.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com', 'dgdgdg2_2', 'dbdgdgdg',  '#');
add_db_server('2', 'dc1', 1, 1,'dgdgdg2.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com','dgdgdg2.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com', 'dgdgdg2_3', 'dbdgdgdg',  '#');
add_db_server('3', 'dc1', 1, 1,'dgdgdg2.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com','dgdgdg2.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com', 'dgdgdg2_4', 'dbdgdgdg',  '#');
add_db_server('4', 'dc1', 1, 1,'dgdgdg2.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com','dgdgdg2.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com', 'dgdgdg2_5', 'dbdgdgdg',  '#');
add_db_server('5', 'dc1', 1, 1,'dgdgdg3.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com','dgdgdg3.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com', 'dgdgdg3_6', 'dbdgdgdg',  '#');
add_db_server('6', 'dc1', 1, 1,'dgdgdg3.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com','dgdgdg3.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com', 'dgdgdg3_7', 'dbdgdgdg',  '#');
add_db_server('7', 'dc1', 1, 1,'dgdgdg3.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com','dgdgdg3.cmpuwbp11vb.ap-southeast-1.rds.amazonaws.com', 'dgdgdg3_8', 'dbdgdgdg',  '#');

The setting above give me error, db-config coludn't find the global database.
Let me know if i do some wrong there.

**Some info striped and change in the codes, for security reason.

WordPress Questions?

We've got answers!

  • 350+ Premium Plugins & Themes
  • 'Your WordPress Team' support
  • WordPress Nirvana from just $19

Find out more »