Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-16819

Dynamic Postgres Primary/Standby Failover

    XMLWordPrintable

    Details

      Description

      I recently added a hot-standby to my Postgres install with the ability to failover automatically if the primary goes down. Since each the primary and standby are on different servers and have different IP addresses/hostnames I updated the config.php file to have each host specified as a comma seperated list:

      $dbhost = '192.168.0.X,192.168.0.Y';

      However, this will connect to the first in the list no matter what, even if it has failed-over and is the standby, which doesn't work with phpBB. This can be fixed by editing the postgres.php driver and adding the "target_session_attrs=read-write" setting to the $connect_string variable, which will cause it to check each connection for the ability to write before returning the connection.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            mbisme mbisme
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: