]> git.openstreetmap.org Git - chef.git/blob - roles/db-master.rb
Tune WDC RE3/RE4 disks with poor NCQ
[chef.git] / roles / db-master.rb
1 name "db-master"
2 description "Role applied to all the master database server"
3
4 default_attributes(
5   :postgresql => {
6     :versions => ["9.5"],
7     :settings => {
8       :defaults => {
9         :wal_level => "hot_standby",
10         :archive_mode => "on",
11         :archive_command => "/usr/local/bin/openstreetmap-wal-e --terse wal-push %p",
12         :max_wal_senders => "3",
13         :late_authentication_rules => [
14           { :database => "replication", :user => "replication", :address => "146.179.159.168/32" },
15           { :database => "replication", :user => "replication", :address => "146.179.159.170/32" },
16           { :database => "replication", :user => "replication", :address => "10.0.0.10/32" },
17           { :database => "replication", :user => "replication", :address => "10.0.32.40/32" }
18         ]
19       }
20     }
21   },
22   :rsyncd => {
23     :modules => {
24       :archive => {
25         :comment => "WAL Archive",
26         :path => "/store/arrays/nvme/postgresql-archive",
27         :read_only => true,
28         :write_only => false,
29         :list => false,
30         :uid => "postgres",
31         :gid => "postgres",
32         :transfer_logging => false,
33         :hosts_allow => [
34           "146.179.159.168", "146.179.159.170, 10.0.0.10, 10.0.32.40"
35         ]
36       }
37     }
38   }
39 )
40
41 run_list(
42   "role[db]",
43   "recipe[db::master]",
44   "recipe[rsyncd]"
45 )