【问题标题】:Postgres synchronous_standby_names var not accepting '-' in the hostnamePostgres synchronous_standby_names var 不接受主机名中的“-”
【发布时间】:2019-03-14 12:14:35
【问题描述】:

我正在尝试使用 3 台机器设置 Postgres 集群,以通过自动故障转移获得高可用性。

postgres-01 --> master
postgres-02 --> sync replica
postgres-03 --> async replica

当我尝试在 postgresql.conf 中使用 synchronous_standby_names='postgres-02' 时,它无法重新启动 postgres,并出现以下错误

LOG:  invalid value for parameter "synchronous_standby_names": "postgres-02"
DETAIL:  syntax error at or near "-"
FATAL:  configuration file "/pgsql/postgresql.conf" contains errors
postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Failed to start PostgreSQL 10 database server.
    -- Subject: Unit postgresql-10.service has failed
    -- Defined-By: systemd

从主机名中删除“-”可以解决问题,但这真的需要吗?

【问题讨论】:

    标签: postgresql database-replication postgresql-10


    【解决方案1】:

    您必须引用名称:

    synchronous_standby_names = '"postgres-02"'
    

    您应该至少有两个同步备用服务器,否则如果单个同步备用服务器出现故障,您的系统将停止运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多