File tree Expand file tree Collapse file tree 4 files changed +45
-2
lines changed Expand file tree Collapse file tree 4 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 1
1
* .retry
2
2
inventory /manual
3
+ logs /
3
4
4
5
/postgresql.conf.common
5
6
/postgresql.conf.lord
Original file line number Diff line number Diff line change 2
2
3
3
---
4
4
- hosts : nodes
5
-
6
5
environment :
7
6
PATH : " {{ pg_dst }}/bin:{{ ansible_env.PATH }}"
8
7
31
30
tags :
32
31
- initdb
33
32
33
+ - name : enable blind trust
34
+ lineinfile :
35
+ dest : " {{pg_datadir}}/pg_hba.conf"
36
+ line : " {{item}}"
37
+ state : present
38
+ with_items :
39
+ - " host all all 0.0.0.0/0 trust"
40
+ - " host replication all 0.0.0.0/0 trust"
41
+ - " local replication all trust"
42
+
34
43
- import_playbook : send_config.yml
35
44
36
45
- hosts : nodes
37
-
38
46
environment :
39
47
PATH : " {{ pg_dst }}/bin:{{ ansible_env.PATH }}"
40
48
43
51
command : psql -p {{ pg_port }} -c "create extension pg_shardman cascade;"
44
52
tags :
45
53
- create_ext
54
+
55
+ - hosts : shardlord
56
+ environment :
57
+ PATH : " {{ pg_dst }}/bin:{{ ansible_env.PATH }}"
58
+
59
+ tasks :
60
+ - name : add ec2 workers
61
+ command : >
62
+ psql -p {{ pg_port }} -c "select shardman.add_node(
63
+ 'hostaddr={{ hostvars[item]['ec2_private_ip_address'] }} port={{ pg_port }}')"
64
+ with_items : " {{ groups.ec2_workers }}"
65
+ tags :
66
+ - add_nodes
67
+
68
+ - name : add manual workers
69
+ command : >
70
+ psql -p {{ pg_port }} -c "select shardman.add_node(
71
+ 'hostaddr={{ item]}} port={{ pg_port }}')"
72
+ with_items : " {{ groups.manual_workers }}"
73
+ tags :
74
+ - add_nodes
Original file line number Diff line number Diff line change 14
14
validate_checksum : no # new logs might constantly arrive
15
15
flat : yes
16
16
17
+ - name : touch logs/united.log
18
+ local_action : copy content="" dest=logs/united.log
19
+ run_once : true
20
+
21
+ - name : unite logs
22
+ local_action : shell cat logs/{{ item }}.log >> logs/united.log
23
+ with_items : " {{ groups.nodes }}"
24
+ run_once : true
25
+
17
26
- hosts : shardlord
18
27
19
28
tasks :
Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ ansible-playbook -i inventory_ec2 pg_ctl.yml -e "pg_ctl_action=restart"
52
52
Read cmd log on shardlord:
53
53
ansible-playbook -i inventory_ec2/ psql.yml --limit 'shardlord' -e "cmd='\'table shardman.cmd_log\''"
54
54
55
+ Gather logs to ./logs:
56
+ ansible-playbook -i inventory_ec2/ logs.yml
57
+
55
58
Ubuntu images EC2 locator:
56
59
https://cloud-images.ubuntu.com/locator/ec2/
57
60
We need ami-4199282e.
@@ -67,3 +70,4 @@ Things that made me wonder during writing this:
67
70
* No way to specify multiple inventory files, only whole directory or one file.
68
71
* No way to append file to file, except for j2 templates, which doesn't work
69
72
with files outside the template dir, really?
73
+ * Writing yml files makes me nervous.
You can’t perform that action at this time.
0 commit comments