Murat Suluhan
Murat Suluhan

Reputation: 33

patroni and vip-manager virtual ip problem

Just installed vip-manager to manage PostgreSQL Patroni cluster' s relocateable cluster IP but vip-manager could not up virtual IP address

Environment information RHEL 9.3 etcd Version: 3.4.31 patroni version 3.0.4 vip-manager 2.3.0

vip-manager configuration

interval: 1000
trigger-key: "/pg_cluster/postgres/leader"
trigger-value: "sp-smaxpsql1"
ip: 10.164.20.180 # the virtual ip address to manage
netmask: 24 # netmask for the virtual ip
interface: ens33 #interface to which the virtual ip will be added
hosting-type: basic # possible values: basic, or hetzner.
dcs-type: etcd # etcd or consul
dcs-endpoints:
  - http://10.164.20.177:2379
  - http://10.164.20.178:2379
  - http://10.164.20.179:2379
retry-num: 2
retry-after: 250  #in milliseconds
verbose: true

etcd configuration

ETCD_LISTEN_PEER_URLS="http://10.164.20.177:2380"
ETCD_LISTEN_CLIENT_URLS="http://10.164.20.177:2379,http://localhost:2379"
ETCD_NAME="sp-smaxpsql1"
[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.164.20.177:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://10.164.20.177:2379"
ETCD_INITIAL_CLUSTER="sp-smaxpsql1=http://10.164.20.177:2380,sp-smaxpsql2=http://10.164.20.178:2380,sp-smaxpsql3=http://10.164.20.179:2380"
ETCD_INITIAL_CLUSTER_TOKEN="postgresql-etcd-cluster"
ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_DATA_DIR="/var/lib/etcd"

patroni configuration

scope: postgres
namespace: /pg_cluster/
name: sp-smaxpsql1
restapi:
  listen: sp-smaxpsql1:8008
  connect_address: sp-smaxpsql1:8008
etcd:
  hosts: 10.164.20.177:2379, 10.164.20.178:2379, 10.164.20.179:2379
bootstrap:
  dcs:
    ttl: 30
    loop_wait: 10
    retry_timeout: 10
    maximum_lag_on_failover: 1048576
    maximum_lag_on_syncnode: 15000000
    synchronous_mode: false
    postgresql:
      use_pg_rewind: true
      use_slots: true
      parameters:
        shared_buffers: 8GB
        work_mem: 13981kB
        maintenance_work_mem: 2GB
        max_worker_processes: 16
        wal_buffers: 64MB
        max_wal_size: 2GB
        min_wal_size: 8GB
        effective_cache_size: 24GB
        fsync: on
        checkpoint_completion_target: 0.9
        log_rotation_size: 100MB
        listen_addresses: "*"
        max_connections: 2000
        temp_buffers: 4MB
        default_statistics_target: 100
        random_page_cost: 1.1
        effective_io_concurrency: 200
        ssl: true
        ssl_cert_file: /var/lib/pgsql/12/data/server.crt
        ssl_key_file: /var/lib/pgsql/12/data/server.key
  initdb:
    - encoding: UTF8
    - data-checksums
  pg_hba:
    - host replication replicator 127.0.0.1/32 md5
    - host replication replicator 10.164.20.177/32 md5
    - host replication replicator 10.164.20.178/32 md5
    - host replication replicator 10.164.20.179/32 md5
    - host all all 0.0.0.0/0 md5
users:
  admin:
    password: admin
    options:
      - createrole
      - createdb

postgresql:
  listen: sp-smaxpsql1:5432
  connect_address: sp-smaxpsql1:5432
  data_dir: /var/lib/pgsql/12/data
  bin_dir: /usr/pgsql-12/bin
  pgpass: /tmp/pgpass
  authentication:
    replication:
      username: replicator
      password: <*********>
    superuser:
      username: postgres
      password: <*********>
    rewind:
      username: pgrewind
      password: <*********>
tags:
  nofailover: false
  noloadbalance: false
  clonefrom: false
  nosync: true

vip-manager logs on master node of the cluster

Mar 27 15:24:26 sp-smaxpsql1 vip-manager[68389]: 2024/03/27 15:24:26 IP address 10.164.20.180/24 state is false, desired false
Mar 27 15:24:36 sp-smaxpsql1 vip-manager[68389]: 2024/03/27 15:24:36 IP address 10.164.20.180/24 state is false, desired false
Mar 27 15:24:46 sp-smaxpsql1 vip-manager[68389]: 2024/03/27 15:24:46 IP address 10.164.20.180/24 state is false, desired false
Mar 27 15:24:56 sp-smaxpsql1 vip-manager[68389]: 2024/03/27 15:24:56 IP address 10.164.20.180/24 state is false, desired false
Mar 27 15:25:06 sp-smaxpsql1 vip-manager[68389]: 2024/03/27 15:25:06 IP address 10.164.20.180/24 state is false, desired false
Mar 27 15:25:16 sp-smaxpsql1 vip-manager[68389]: 2024/03/27 15:25:16 IP address 10.164.20.180/24 state is false, desired false
Mar 27 15:25:26 sp-smaxpsql1 vip-manager[68389]: 2024/03/27 15:25:26 IP address 10.164.20.180/24 state is false, desired false
Mar 27 15:25:36 sp-smaxpsql1 vip-manager[68389]: 2024/03/27 15:25:36 IP address 10.164.20.180/24 state is false, desired false
Mar 27 15:25:46 sp-smaxpsql1 vip-manager[68389]: 2024/03/27 15:25:46 IP address 10.164.20.180/24 state is false, desired false

Upvotes: 0

Views: 557

Answers (1)

THaala
THaala

Reputation: 1

Do a simple Test. Isolate the etcd node. Then put the trigger manually to the local node by using

etcdctl put /pg_cluster/postgres/leader sp-smaxpsql1

check the logs then.

Upvotes: 0

Related Questions