Skip to content

Commit 97bdab2

Browse files
author
Vadym Lobzakov
committed
JE-58122 Replace master/slave w primary/secondary
1 parent ae9bcbd commit 97bdab2

9 files changed

+511
-417
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# PostgreSQL Database Replication
22

3-
Basic ready-to-use PostgreSQL cluster, which implements asynchronous master-slave data replication within a pair of preconfigured database containers.
3+
Basic ready-to-use PostgreSQL cluster, which implements asynchronous primary-secondary data replication within a pair of preconfigured database containers.
44

55
## Package Implementation Specifics
66

7-
The presented PostgreSQL Replication solution is built upon Jelastic certified stack template for **PostgreSQL 9.5.5**. It operates two database containers (master and slave, one per role) and makes data from primary DB server to be asynchronously replicated to a standby one.
7+
The presented PostgreSQL Replication solution is built upon Jelastic certified stack template for **PostgreSQL 9.5.5**. It operates two database containers (primary and secondary, one per role) and makes data from primary DB server to be asynchronously replicated to a standby one.
88

99
<p align="left">
1010
<img src="images/postgresql-replication-topology.svg" width="350">

addons/auto-cluster.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type: update
22
id: postgres-master-slave-auto-cluster
33
baseUrl: https://raw.githubusercontent.com/jelastic-jps/postgres/master
44
logo: /images/postgres-70x70.png
5-
name: PostgreSQL Master-Slave Auto-Cluster
5+
name: PostgreSQL Primary-Secondary Auto-Cluster
66

77
targetNodes: none
88
nodeGroupAlias:
@@ -49,7 +49,7 @@ actions:
4949
jcm updatePrimaryConnInfo &>> /var/log/run.log
5050
sudo jem service restart
5151
- else:
52-
- setNodeDisplayName[${nodes.sqldb.master.id}]: Master
52+
- setNodeDisplayName[${nodes.sqldb.master.id}]: Primary
5353
- getPswd
5454
- forEach(nodes.sqldb):
5555
if (${@i.id} != ${nodes.sqldb.master.id}):
@@ -65,7 +65,7 @@ actions:
6565
pswd: ${response.out}
6666

6767
initSlave:
68-
- setNodeDisplayName[${this.id}]: Slave
68+
- setNodeDisplayName[${this.id}]: Secondary
6969
- cmd[${nodes.sqldb.master.id}]: |-
7070
jcm addReplicaHost ${this.ip} &>> /var/log/run.log
7171
sudo jem service reload

addons/cluster.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"recommended": {
1717
"cloudlets": 32
1818
},
19-
"description": "<h3>Master-Slave with Scalable Slaves</h3>Pre-configured PostgreSQL database cluster with master-slave replication. New nodes are automatically added into the cluster as slaves. <a href='https://jelastic.com/blog/postgresql-auto-clustering-master-slave-replication/'>Learn More</a><img width='217' height='168' src='https://raw.githubusercontent.com/jelastic/icons/master/postgres/jelastic/images/tip-cluster-ms.svg?sanitize=true'>"
19+
"description": "<h3>Primary-Secondary with Scalable Secondaries</h3>Pre-configured PostgreSQL database cluster with primary-secondary replication. New nodes are automatically added into the cluster as secondaries. <a href='https://jelastic.com/blog/postgresql-auto-clustering-master-slave-replication/'>Learn More</a><img width='217' height='168' src='https://raw.githubusercontent.com/jelastic/icons/master/postgres/jelastic/images/tip-cluster-ms.svg?sanitize=true'>"
2020
}

images/postgresql-replication-installation.png

100644100755
39.5 KB
Loading

images/postgresql-replication-success-message.png

100644100755
22 KB
Loading
1.08 KB
Loading

images/postgresql-replication-topology.svg

Lines changed: 498 additions & 404 deletions
Loading

manifest.yaml

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ id: postgres-master-slave
44
baseUrl: https://raw.githubusercontent.com/jelastic-jps/postgres/master
55
homepage: http://docs.jelastic.com/postgresql-database-replication
66
logo: /images/postgres-70x70.png
7-
name: PostgreSQL Master-Slave Cluster
7+
name: PostgreSQL Primary-Secondary Cluster
88
description:
99
text: |
10-
PostgreSQL Master-Slave Cluster for improving data availability with asynchronous replication.
10+
PostgreSQL Primary-Secondary Cluster for improving data availability with asynchronous replication.
1111
PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
12-
short: PostgreSQL Master-Slave Cluster with asynchronous replication.
12+
short: PostgreSQL Primary-Secondary Cluster with asynchronous replication.
1313

1414
categories:
1515
- apps/clustered-dbs

tests/status.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
type: update
22
id: postgres-master-slave-test
3-
name: PostreSQL Master-Slave Test
3+
name: PostreSQL Primary-Secondary Test
44
homepage: https://www.postgresql.org/
55
baseUrl: https://raw.githubusercontent.com/jelastic-jps/postgres/master
66
logo: /images/postgres-70x70.png
7-
description: Test of Master-Slave cluster status
7+
description: Test of Primary-Secondary cluster status
88

99
onInstall:
1010
- cmd[${nodes.sqldb.master.id}]: |-
@@ -14,7 +14,7 @@ onInstall:
1414
if (rows == slaves) {
1515
return {result: 0}
1616
} else {
17-
return {result: "error", message: "Number of replicas (" + rows + ") does not match the number of slave nodes (" + slaves + ")"}
17+
return {result: "error", message: "Number of replicas (" + rows + ") does not match the number of secondary nodes (" + slaves + ")"}
1818
}
1919
success:
20-
text: PostreSQL Master-Slave is up and running. All slaves are healthy!
20+
text: PostreSQL Primary-Secondary is up and running. All secondaries are healthy!

0 commit comments

Comments
 (0)