My Problem is postgresql replication and failover setup around 50 lakhs records in my database if primary nodes goes down, secondary node act as primary, then primary node comes normal state.
But if the replica pod needs to be rebuilt (by recloning the database).
Steps will reproduce the bug?
Create a new YAML configuration (local-pv.yaml) file
apiVersion: v1
kind: PersistentVolume # Create a PV
metadata:
name: postgresql-data # Sets PV's name
labels:
type: local # Sets PV's type to local
spec:
storageClassName: manual
capacity:
storage: 10Gi # Sets PV Volume
accessModes:
- ReadWriteOnce
hostPath:
path: "/data/volume" # Sets the volume's path
Create another YAML configuration file (pv-claim.yaml)
apiVersion: v1
kind: PersistentVolumeClaim # Create PVC
metadata:
name: postgresql-data-claim # Sets name of PV
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce # Sets read and write access
resources:
requests:
storage: 10Gi # Sets volume size
Create a new configuration file (values.yaml)
postgresql:
replicaCount: 2
password: "sar@123"
repmgrPassword: "sar@123"
repmgrConnectTimeout: 2
repmgrReconnectAttempts: 1
repmgrReconnectInterval: 2
repmgrChildNodesDisconnectTimeout: 5
pgpool:
replicaCount: 2
service:
type: NodePort
persistence:
enabled: true
existingClaim: "postgresql-data-claim"
Apply the YAML files to your Kubernetes cluster:
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
kubectl apply -f local-pv.yaml
kubectl apply -f pv-claim.yaml
kubectl get pv
kubectl get pvc
helm install postgresql-dev -f values.yaml bitnami/postgresql-ha
In My error occur
postgresql-repmgr 04:13:23.44 INFO ==>
postgresql-repmgr 04:13:23.44 INFO ==> Welcome to the Bitnami postgresql-repmgr container
postgresql-repmgr 04:13:23.44 INFO ==> Subscribe to project updates by watching https://github.com/bitnami/containers
postgresql-repmgr 04:13:23.44 INFO ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
postgresql-repmgr 04:13:23.44 INFO ==>
postgresql-repmgr 04:13:23.46 INFO ==> ** Starting PostgreSQL with Replication Manager setup **
postgresql-repmgr 04:13:23.48 INFO ==> Validating settings in REPMGR_* env vars...
postgresql-repmgr 04:13:23.48 INFO ==> Validating settings in POSTGRESQL_* env vars..
postgresql-repmgr 04:13:23.49 INFO ==> Querying all partner nodes for common upstream node...
postgresql-repmgr 04:13:23.58 INFO ==> Auto-detected primary node: 'postgresql-dev-postgresql-ha-postgresql-0.postgresql-dev-postgresql-ha-postgresql-headless.default.svc.cluster.local:5432'
postgresql-repmgr 04:13:23.58 INFO ==> Node configured as standby
postgresql-repmgr 04:13:23.59 INFO ==> Preparing PostgreSQL configuration...
postgresql-repmgr 04:13:23.59 INFO ==> postgresql.conf file not detected. Generating it...
postgresql-repmgr 04:13:24.67 INFO ==> Preparing repmgr configuration...
postgresql-repmgr 04:13:24.71 INFO ==> Initializing Repmgr...
postgresql-repmgr 04:13:24.72 INFO ==> Waiting for primary node...
postgresql-repmgr 04:13:24.77 INFO ==> Rejoining node...
postgresql-repmgr 04:13:24.78 INFO ==> Cloning data from primary node...
Expected Solution
I predict even nearly when 1TB database will replicate