File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ go run * .go \
2
+ -C " dbname=postgres user=stas port=5432 sslmode=disable" \
3
+ -C " dbname=postgres user=stas port=5433 sslmode=disable" \
4
+ -C " dbname=postgres user=stas port=5434 sslmode=disable" \
5
+ -g -w 8 -r 1 -n 1000 -a 1000 -b pgshard -i
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ - hosts : clients
4
+ gather_facts : no
5
+ tasks :
6
+
7
+ - name : generate connstrings
8
+ set_fact :
9
+ connstr : " -d 'host={{item}} user=cluster port=15432 dbname=postgres' "
10
+ with_items :
11
+ groups['nodes'] | reverse | batch(nnodes | d(2) | int) | first
12
+ register : connstrs
13
+
14
+ - name : make a list
15
+ set_fact :
16
+ connections : " {{ connstrs.results | map(attribute='ansible_facts.connstr') | join }}"
17
+
18
+ - name : copy transfers binary
19
+ copy : src=transfers.linux dest=~/transfers mode=a+x
20
+
21
+ - hosts : clients[0]
22
+ gather_facts : no
23
+ tasks :
24
+ - name : fill the databases
25
+ shell : " ./transfers {{connections}} -f -g"
26
+ register : transfers_result
27
+ - debug : " var=transfers_result"
28
+
29
+ - hosts : clients
30
+ gather_facts : no
31
+ tasks :
32
+ - name : run transfers
33
+ shell : " ./transfers {{connections}} -s {{runkeys | d('-g -w 60 -m -o -u 10000 -r 0')}} -k {{hostvars[inventory_hostname]['offset']}} "
34
+ register : transfers_result
35
+ - debug : var=transfers_result
36
+
You can’t perform that action at this time.
0 commit comments