WordPress.org

Ready to get started?Download WordPress

Forums

HyperDB
[resolved] I have the following settings but I am still not getting write to master (3 posts)

  1. David
    Member
    Posted 1 year ago #

    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/

  2. TuXaWy
    Member
    Posted 1 year ago #

    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,

  3. David
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags