Jump to content

Error with $config->dbReader: "1836 Running in read-only mode"


Laikmosh
 Share

Recommended Posts

Hello, im trying to configure a read replica as documented in https://processwire.com/blog/posts/pw-3.0.175/

I have already configured my aws aurora database to have read replicas

205582578_CapturadePantalla2022-01-24ala(s)15_37_45.thumb.png.131810ee7b7bb16e8bf582e25b0a7308.png

Im using elasticbeanstalk so i configured the writer and reader endpoints as env vars:

1174029380_CapturadePantalla2022-01-24ala(s)15_39_45.thumb.png.779240f5073161da2252c813decba9fd.png

and finally added this configuration to my config.php

/**
 * Installer: Database Configuration
 * 
 */
$config->dbHost = $_SERVER['host'];
$config->dbName = $_SERVER['db'];
$config->dbUser = $_SERVER['user'];
$config->dbPass = $_SERVER['pass'];
$config->dbPort = 3306;
$config->dbEngine = 'InnoDB';

if ($_SERVER['hostReader']) {
    $config->dbReader = [
        'host' => $_SERVER['hostReader'],
    ];
};

but now im getting this error anytime i try to load the site:

Error: Exception: SQLSTATE[HY000]: General error: 1836 Running in read-only mode (in wire/core/WireDatabasePDO.php line 889) 

Any ideas what i could be doing wrong?

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...