]> git.openstreetmap.org Git - chef.git/blob - roles/nominatim.rb
Drop roles for thorn-02 and thorn-03
[chef.git] / roles / nominatim.rb
1 name "nominatim"
2 description "Role applied to all nominatim servers."
3
4 default_attributes(
5   :accounts => {
6     :users => {
7       :lonvia => { :status => :administrator },
8       :nominatim => {
9         :status => :role,
10         :members => [:lonvia, :tomh]
11       }
12     }
13   },
14   :networking => {
15     :firewall => {
16       :http_rate_limit => "s:2/sec:15"
17     }
18   },
19   :postgresql => {
20     :settings => {
21       :defaults => {
22         :max_connections => "450",
23         :synchronous_commit => "off",
24         :checkpoint_segments => "32",
25         :checkpoint_timeout => "10min",
26         :checkpoint_completion_target => "0.9",
27         :jit => "off",
28         :shared_buffers => "2GB",
29         :autovacuum_max_workers => "1",
30         :max_parallel_workers_per_gather => "0",
31         :maintenance_work_mem => "10GB",
32         :random_page_cost => "1.5",
33         :effective_cache_size => "60GB"
34       }
35     }
36   },
37   :sysctl => {
38     :postgres => {
39       :comment => "Increase shared memory for postgres",
40       :parameters => {
41         "kernel.shmmax" => 26 * 1024 * 1024 * 1024,
42         "kernel.shmall" => 26 * 1024 * 1024 * 1024 / 4096
43       }
44     },
45     :swappiness => {
46       :comment => "Reduce swap usage",
47       :parameters => {
48         "vm.swappiness" => 10
49       }
50     },
51     :network_conntrack_time_wait => {
52       :comment => "Only track completed connections for 30 seconds",
53       :parameters => {
54         "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30"
55       }
56     },
57     :network_conntrack_max => {
58       :comment => "Increase max number of connections tracked",
59       :parameters => {
60         "net.netfilter.nf_conntrack_max" => "196608"
61       }
62     }
63   },
64   :nominatim => {
65     :dbadmins => %w[lonvia tomh],
66     :tablespaces => {
67       "dosm" => "/ssd/tablespaces/dosm",
68       "iosm" => "/ssd/tablespaces/iosm",
69       "dplace" => "/ssd/tablespaces/dplace",
70       "iplace" => "/ssd/tablespaces/iplace",
71       "daddress" => "/ssd/tablespaces/daddress",
72       "iaddress" => "/ssd/tablespaces/iaddress",
73       "dsearch" => "/ssd/tablespaces/dsearch",
74       "isearch" => "/ssd/tablespaces/isearch",
75       "daux" => "/ssd/tablespaces/daux",
76       "iaux" => "/ssd/tablespaces/iaux"
77     }
78   }
79 )
80
81 run_list(
82   "recipe[nominatim::default]"
83 )