Skip to content
This repository has been archived by the owner on Aug 4, 2018. It is now read-only.

Implement a pgpool-II/keepalived pair to sit in front of the PostgreSQL cluster. #3

Merged
merged 8 commits into from
Nov 24, 2013
Prev Previous commit
Next Next commit
create individual virtual machines for pgpool cluster
  • Loading branch information
ewdurbin committed Nov 23, 2013
commit b4ad4e462221b6ee70513f9b9951c7726b65a596
22 changes: 22 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,28 @@ Vagrant.configure("2") do |config|
end
end

config.vm.define "pgpool0" do |pgpool0|
pgpool0.vm.network "private_network", ip: "192.168.57.7"
pgpool0.vm.network "private_network", ip: "172.16.57.7"

pgpool0.vm.provision :salt do |s|
s.verbose = true
s.minion_config = "provisioning/salt/minion/pg_cluster-pgpool"
s.run_highstate = true
end
end

config.vm.define "pgpool1" do |pgpool1|
pgpool1.vm.network "private_network", ip: "192.168.57.8"
pgpool1.vm.network "private_network", ip: "172.16.57.8"

pgpool1.vm.provision :salt do |s|
s.verbose = true
s.minion_config = "provisioning/salt/minion/pg_cluster-pgpool"
s.run_highstate = true
end
end

end

end
8 changes: 8 additions & 0 deletions provisioning/salt/minion/pg_cluster-pgpool
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
file_client: local
file_roots:
base:
- /srv/salt
grains:
roles:
- develop
- postgresql_pgpool
8 changes: 0 additions & 8 deletions provisioning/salt/roots/pillar/postgresql/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@
firewall:
ports:
- 5432
- 9000
- 9694
- 9898
- 9999

postgresql_cluster:
primary_server: 172.16.57.5
standby_servers:
- 172.16.57.6

pgpool_cluster:
nodes:
- 172.16.57.5
- 172.16.57.6
11 changes: 9 additions & 2 deletions provisioning/salt/roots/pillar/postgresql/pgpool.sls
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

firewall:
- 9999
- 9000
- 9694
- 9898
- 5433
- 9999
- 5432

pgpool_cluster:
nodes:
- 172.16.57.7
- 172.16.57.8
5 changes: 5 additions & 0 deletions provisioning/salt/roots/pillar/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ base:
'roles:postgresql_cluster':
- match: grain
- postgresql
- postgresql.pgpool
'roles:postgresql_pgpool':
- match: grain
- postgresql
- postgresql.pgpool
3 changes: 3 additions & 0 deletions provisioning/salt/roots/salt/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ base:
- match: grain
- firewall
- postgresql.cluster
'roles:postgresql_pgpool':
- match: grain
- firewall
- postgresql.cluster.pgpool