Skip to content
This repository was archived by the owner on Feb 11, 2020. It is now read-only.

Commit b238fbe

Browse files
committed
Add index name and replica count configurablity to add_replica
1 parent eed74b7 commit b238fbe

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

add_replica.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
set -eu
44

5-
echo "setting replica count to 1 on pelas index in $cluster_url"
5+
index_name="${index_name:-pelias}"
6+
replica_count="${replica_count:-1}"
67

7-
curl -XPUT "$cluster_url/pelias/_settings" -d '{
8-
"index" : {
9-
"number_of_replicas" : 1
10-
}
11-
}'
8+
echo "setting replica count to $replica_count on $index_name index in $cluster_url"
9+
10+
curl -XPUT "$cluster_url/$index_name/_settings" -d "{
11+
\"index\" : {
12+
\"number_of_replicas\" : $replica_count
13+
}
14+
}"

0 commit comments

Comments
 (0)