forked from elastic/rally
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·109 lines (88 loc) · 2.7 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env bash
set -e
source .elastic-version
# Start metrics store
docker-compose -f ./metricstore-docker-compose.yml up -d
# Start Elasticsearch
docker-compose up -d
printf "Waiting for clusters to get ready "
# Wait until ES is up
ALL_CLUSTERS_READY=false
while ! $ALL_CLUSTERS_READY; do
curl -s http://localhost:39201 -o /dev/null && curl -s http://localhost:39202 -o /dev/null && ALL_CLUSTERS_READY=true || (printf "." && sleep 5)
done
echo
echo "Accepting trial license on clusters"
curl -sS -o /dev/null -XPOST localhost:39201/_xpack/license/start_trial?acknowledge=true
curl -sS -o /dev/null -XPOST localhost:39202/_xpack/license/start_trial?acknowledge=true
# Configure leader remote on the following cluster
echo "Configure remotes on follower"
curl -sS -o /dev/null -H 'Content-Type: application/json' -X PUT localhost:39202/_cluster/settings -d @- <<-EOF
{
"persistent" : {
"cluster" : {
"remote" : {
"leader" : {
"seeds" : [
"leader-node01:9300"
]
}
}
}
}
}
EOF
echo "Set auto-follow pattern on follower for every index on leader"
curl -sS -o /dev/null -H 'Content-Type: application/json' -X PUT localhost:39202/_ccr/auto_follow/geonames -d @- <<-EOF
{
"remote_cluster" : "leader",
"leader_index_patterns" :
[
"*"
],
"follow_index_pattern" : "{{leader_index}}-copy"
}
EOF
# Create target-hosts file for Rally
cat >ccr-target-hosts.json <<'EOF'
{
"default": [
"127.0.0.1:39201"
],
"cluster_a": [
"127.0.0.1:39202"
]
}
EOF
# Create Rally metricstore ini file
cat >~/.rally/rally-metricstore.ini <<EOF
[meta]
config.version = 17
[system]
env.name = local
[node]
root.dir = ${HOME}/.rally/benchmarks
src.root.dir = ${HOME}/.rally/benchmarks/src
[source]
remote.repo.url = https://github.com/elastic/elasticsearch.git
elasticsearch.src.subdir = elasticsearch
[benchmarks]
local.dataset.cache = ${HOME}/.rally/benchmarks/data
[reporting]
datastore.type = elasticsearch
datastore.host = 127.0.0.1
datastore.port = 19200
datastore.secure = False
datastore.user = elastic
datastore.password = notinuse
[tracks]
default.url = https://github.com/elastic/rally-tracks
[teams]
default.url = https://github.com/elastic/rally-teams
[defaults]
preserve_benchmark_candidate = False
[distributions]
release.cache = true
EOF
# Start Rally
esrally --configuration-name=metricstore --target-hosts=./ccr-target-hosts.json --pipeline=benchmark-only --on-error=abort --track=geonames --challenge=append-no-conflicts-index-only --track-params="ingest_percentage:20,number_of_shards:3" --telemetry="ccr-stats" --telemetry-params="ccr-stats-sample-interval:1"