Skip to content

Commit 00d0431

Browse files
committed
Merge pull request sorintlab#552 from sgotti/doc_two_nodes_setup
doc: add a two nodes example
2 parents d88775a + df88155 commit 00d0431

7 files changed

+1076
-8
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ For more details and requirements see [Stolon Architecture and Requirements](doc
4141

4242
## Quick start and examples
4343

44-
* [simple cluster example](doc/simplecluster.md)
45-
* [kubernetes example](examples/kubernetes/README.md)
44+
* [Simple cluster example](doc/simplecluster.md)
45+
* [Kubernetes example](examples/kubernetes/README.md)
46+
* [Two (or more) nodes setup](doc/twonodes.md)
4647

4748
## Project Status
4849

doc/README.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ We suggest that you first read the [Stolon Architecture and Requirements](archit
1515
* [Standby Cluster](standbycluster.md)
1616

1717
### Misc topics
18-
* [Enabling pg_rewind](pg_rewind.md)
19-
* [Enabling synchronous replication](syncrepl.md)
20-
* [PostgreSQL SSL/TLS setup](ssl.md)
18+
19+
* [Enabling pg_rewind](pg_rewind.md)
20+
* [Enabling synchronous replication](syncrepl.md)
21+
* [PostgreSQL SSL/TLS setup](ssl.md)
2122

2223
### Recipes
23-
* [Manual switchover without transactions loss](manual_switchover.md)
24+
25+
* [Manual switchover without transactions loss](manual_switchover.md)
2426

2527
### Examples
26-
* [Simple test cluster](simplecluster.md)
27-
* [Kubernetes](../examples/kubernetes/README.md)
28+
29+
* [Simple test cluster](simplecluster.md)
30+
* [Kubernetes](../examples/kubernetes/README.md)
31+
* [Two (or more) nodes setup](twonodes.md)
2832

2933
### [FAQ](faq.md)

doc/twonodes.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Two (or more) nodes setup example
2+
3+
If you're going to run stolon on an IaaS or any kind of two nodes (baremetal, VM) this document provides some example configurations. These examples provide a two nodes setup that can be extended to a number greater than two nodes.
4+
5+
The related store should live outside the instances hosting the stolon cluster for multiple reasons:
6+
7+
* Stores like etcd/consul uses the raft consensus protocol that requires at least 3 nodes to provides high availability (it can survive to the death of (N/2)-1 members)
8+
* Disk I/O of postgres must not impact the etcd/consul I/O
9+
* You can run multiple stolon clusters using the same store
10+
11+
# Two nodes with load balancer
12+
13+
![Two nodes with a load balancer](twonodes_lb_small.png)
14+
15+
Every nodes will run one keeper, one sentinel and one proxy.
16+
17+
The load balancer will balance between the stolon proxies.
18+
19+
Clients will connect to the load balancer VIP.
20+
21+
# Two nodes with keepalived
22+
23+
![Two nodes with keepalived](twonodes_keepalived_small.png)
24+
25+
Every nodes will run one keeper, one sentinel and one proxy.
26+
27+
Every nodes also runs a [keepalived](http://www.keepalived.org/) instance that will mantain a VIP assigned to one of the nodes. If one of the nodes dies/become partitioned keepealived will switch the VIP to the other node.
28+
29+
Clients will connect to the VIP managed by keepalived.

0 commit comments

Comments
 (0)