11 pointsStarting to get into this DEV thingI'm new here
hiptobesmart
Member
—
11th December 2010 (1 year ago)
I have one web server which will be connecting to two database servers set up with 256 databases in a master/slave configuration. I have installed wordpress, set up my network, placed the multi-db files in their proper location and the configuration seems to be lost on me, which is embarrassing due to the fact that I am a web developer and intermediate server admin.
Both servers are on the same network (same data center). Here are my questions:
1. Do I simply duplicate the add_db_server calls for the slave server with different host information and the write flag set to 0?
2. Can I get a clear definition of the HOST and LAN_HOST arguments in the add_db_server function? The values in the sample config seem reversed to my understanding (host being external IP and lan_host being internal IP).
Any help or examples you can shoot my way would be very helpful :)
I have one web server which will be connecting to two database servers set up with 256 databases in a master/slave configuration. I have installed wordpress, set up my network, placed the multi-db files in their proper location and the configuration seems to be lost on me, which is embarrassing due to the fact that I am a web developer and intermediate server admin.
Both servers are on the same network (same data center). Here are my questions:
1. Do I simply duplicate the add_db_server calls for the slave server with different host information and the write flag set to 0?
2. Can I get a clear definition of the HOST and LAN_HOST arguments in the add_db_server function? The values in the sample config seem reversed to my understanding (host being external IP and lan_host being internal IP).
Any help or examples you can shoot my way would be very helpful :)
Do I simply duplicate the add_db_server calls for the slave server with different host information and the write flag set to 0?
Yes - if you want to prioritise reads from the slave then set the read value for those to 1, and those for the dbs on the master to a higher number e.g. 2 or 5 - doesn't matter with a single master / slave, but that number will be more important when you add more slaves.
Can I get a clear definition of the HOST and LAN_HOST arguments in the add_db_server function? The values in the sample config seem reversed to my understanding (host being external IP and lan_host being internal IP).
If both server are in the same datacentre then you can ignore them and put the same IP / address in both.
If the server is in the same datacentre the plugin will use LAN_HOST, if it isn't it will use HOST
Responses (3)
Developer — 12th December 2010 (1 year ago) #
Answering the two questions separately:
Yes - if you want to prioritise reads from the slave then set the read value for those to 1, and those for the dbs on the master to a higher number e.g. 2 or 5 - doesn't matter with a single master / slave, but that number will be more important when you add more slaves.
Developer — 12th December 2010 (1 year ago) #
If both server are in the same datacentre then you can ignore them and put the same IP / address in both.
If the server is in the same datacentre the plugin will use LAN_HOST, if it isn't it will use HOST
Member — 12th December 2010 (1 year ago) #
A thousand thanks, Barry :) I'll give it a shot.
Become a member