Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
postgresql_patroni [2025/05/02 12:58] andonovjpostgresql_patroni [2025/05/13 05:14] (current) andonovj
Line 128: Line 128:
  
 So we have our key-value propagated among the cluster, nice.... So we have our key-value propagated among the cluster, nice....
 +
 +
 +We can also check the health of the cluster endpoints as follow:
 +
 +<Code:Bash|Check cluster endpoints>
 +[root@etcd02 ~]# etcdctl endpoint status --write-out=table --endpoints=http://etcd01:2379,http://etcd00:2379,http://etcd02:2379
 ++--------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
 +|      ENDPOINT      |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
 ++--------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
 +| http://etcd01:2379 | 32552f25bf46ac89 |  3.5.21 |   20 kB |     false |      false |         2 |         12 |                 12 |        |
 +| http://etcd00:2379 | 5dd4414f709cd700 |  3.5.21 |   20 kB |      true |      false |         2 |         12 |                 12 |        |
 +| http://etcd02:2379 | e1e9e5d83c377f01 |  3.5.21 |   20 kB |     false |      false |         2 |         12 |                 12 |        |
 ++--------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
 +[root@etcd02 ~]# 
 +
 +</Code>
 +
  
 =====Setup Patroni===== =====Setup Patroni=====
Line 581: Line 598:
  
 echo "Obtaining the first replica in the cluster" echo "Obtaining the first replica in the cluster"
-case ${environment} in +REPLICA_HOST=postgres-${environment}
-    "dev"+
-        REPLICA_HOST=postgres-dev-mel-001.mel.adi.netsuite.com +
-    ;; +
-    "stg"+
-        REPLICA_HOST=postgres-stg-mel-001.mel.adi.netsuite.com +
-    ;; +
-    "prod"+
-        REPLICA_HOST=postgres-prod-mel-001.mel.adi.netsuite.com +
-    ;; +
-    *) +
-        echo "Environment not given" +
-    ;; +
-esac+
  
 v_first_replica=$(curl -sk https://${REPLICA_HOST}:8008/cluster | jq -r '.members[] | select(.role == "replica") | .host' | head -n 1) v_first_replica=$(curl -sk https://${REPLICA_HOST}:8008/cluster | jq -r '.members[] | select(.role == "replica") | .host' | head -n 1)
  • postgresql_patroni.1746190704.txt.gz
  • Last modified: 2025/05/02 12:58
  • by andonovj