• Resolved David

    (@dalonzovictoriaclippercom)


    I have two web servers (xxx.xxx.xxx.4 and xxx.xxx.xxx.5) that are trying to read from a master slave configuration.

    the db.php is in the wp-config folder.
    I have added the following line to wp-config.php file:

    define ( 'DB_CONFIG_FILE' , '/var/www/html/%folder_name%/%folder_name%/db-config.php' );

    I have added the following to the db-config.php file:

    $myVAR1 = "%Password%";
    $escapedMyVAR1 = mysql_real_escape_string($myVAR1);
    $myVAR2 = "xxx.xxx.xxx.6";
    $escapedMyVAR2 = mysql_real_escape_string($myVAR2);
    $myVAR3 = "xxx.xxx.xxx.7";
    $escapedMyVAR3 = mysql_real_escape_string($myVAR3);
    
    $wpdb->add_database(array(
    	'host'     => $escapedMyVAR2,     // If port is other than 3306, use host:port.
    	'user'     => %Username%,
    	'password' => $escapedMyVAR1,
    	'name'     => %Database%,
    ));
    
    $wpdb->add_database(array(
    	'host'     => $escapedMyVAR3,     // If port is other than 3306, use host:port.
    	'user'     => %Username%,
    	'password' => $escapedMyVAR1,
    	'name'     => %Database%,
    	'write'    => 0,
    	'read'     => 1,
    	'dataset'  => 'global',
    	'timeout'  => 0.2,
    ));

    Should I just remove all the defined(‘DB_NAME’, in wp-config.php?

    It still has the master (xxx.xxx.xxx.6) config in there, will this cause the hyperdb to not enable?

    http://wordpress.org/extend/plugins/hyperdb/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have the same problem over here .
    Does any one have a solution for it ?
    but this problem appears if the master or the slave is down … not only the master.

    regards,

    Thread Starter David

    (@dalonzovictoriaclippercom)

    I removed the line in wp-config.php file. My issue was that I didn’t have the db.php in both of the server’s wp-content folders. I have rsync replication between the two but had chosen to ignore the hyperdb files when I first started using it.

    PEBKACed

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I have the following settings but I am still not getting write to master’ is closed to new replies.