Header Shadow Image


LOG:  specifying both host name and CIDR mask is invalid

Getting this?

[root@psql06 log]# ls -altri
total 12
 69297428 drwx——.  2 postgres postgres   31 Mar  6 12:29 .
 69297429 -rw——-.  1 postgres postgres 7245 Mar  6 12:37 postgresql-Sun.log
135582283 drwx——. 20 postgres postgres 4096 Mar  6 12:37 ..
[root@psql06 log]# cat postgresql-Sun.log
2022-03-06 12:29:47.467 EST [15085] LOG:  specifying both host name and CIDR mask is invalid: "psql04.nix.mds.xyz/0"
2022-03-06 12:29:47.467 EST [15085] CONTEXT:  line 96 of configuration file "/data/patroni/pg_hba.conf"

It means exactly what it says:

[root@psql06 patroni]# cat /etc/patroni.yml
scope: postgres
namespace: /db/
name: postgresql2

log:
    level: DEBUG
    dir: /var/log/patroni/
    file_num: 37
    file_size: 52428800

restapi:
    listen: psql06.nix.mds.xyz:8008
    connect_address: psql06.nix.mds.xyz:8008

etcd:
    host: psql06.nix.mds.xyz:2379

bootstrap:
    dcs:
        ttl: 30
        loop_wait: 10
        retry_timeout: 10
        maximum_lag_on_failover: 1048576
        postgresql:
            use_pg_rewind: true

    initdb:
    – encoding: UTF8
    – data-checksums

    pg_hba:
    – host replication replicator 127.0.0.1/32 md5
    – host replication replicator psql04.nix.mds.xyz/0 md5
    – host replication replicator psql05.nix.mds.xyz/0 md5
    – host replication replicator psql06.nix.mds.xyz/0 md5

    – host all all 0.0.0.0/0 md5

    users:
        admin:
            password: admin
            options:
                – createrole
                – createdb

postgresql:
    listen: psql06.nix.mds.xyz:5432
    bin_dir: /usr/pgsql-10/bin
    connect_address: psql06.nix.mds.xyz:5432
    data_dir: /data/patroni
    pgpass: /tmp/pgpass
    unix_socket_directories: /data/patroni
    authentication:
        replication:
            username: replicator
            password: some-rep-pass
        superuser:
            username: postgres
            password: somepass
    parameters:
        unix_socket_directories: '.'
        max_connections: '256'
        max_replication_slots: '64'

tags:
    nofailover: false
    noloadbalance: false
    clonefrom: false
    nosync: false
[root@psql06 patroni]#

Correct syntax should be without the mask for hostnames.  (For IP's it's ok):

    pg_hba:
    – host replication replicator 127.0.0.1/32 md5
    – host replication replicator psql04.nix.mds.xyz md5
    – host replication replicator psql05.nix.mds.xyz md5
    – host replication replicator psql06.nix.mds.xyz md5

    – host all all 0.0.0.0/0 md5

Cheers,

 

Leave a Reply

You must be logged in to post a comment.


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License