This repository was archived by the owner on Feb 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 12 files changed +54
-26
lines changed Expand file tree Collapse file tree 12 files changed +54
-26
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ replica_count="${replica_count:-1}"
8
8
9
9
echo " setting replica count to $replica_count on $index_name index in $cluster_url "
10
10
11
- curl -XPUT " $cluster_url /$index_name /_settings" -d " {
12
- \" index\" : {
13
- \" number_of_replicas\" : $replica_count
14
- }
11
+ curl -XPUT " $cluster_url /$index_name /_settings" \
12
+ -H ' Content-Type: application/json' \
13
+ -d " {
14
+ \" index\" : {
15
+ \" number_of_replicas\" : $replica_count
16
+ }
15
17
}"
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ echo "counting all types on $cluster_url"
6
6
7
7
# query for all source values with an aggregation
8
8
# this requires fielddata to be loaded, which takes a bit of memory
9
- curl -s -XPOST " $cluster_url /pelias/_search?size=0" -d ' {
9
+ curl -s -XPOST " $cluster_url /pelias/_search?size=0" \
10
+ -H ' Content-Type: application/json' \
11
+ -d ' {
10
12
"aggs" : {
11
13
"source_count" : { "terms" : { "field" : "source" } }
12
14
}
@@ -15,7 +17,9 @@ curl -s -XPOST "$cluster_url/pelias/_search?size=0" -d '{
15
17
16
18
# query for all layer values with an aggregation
17
19
# this requires fielddata to be loaded, which takes a bit of memory
18
- curl -s -XPOST " $cluster_url /pelias/_search?size=0" -d ' {
20
+ curl -s -XPOST " $cluster_url /pelias/_search?size=0" \
21
+ -H ' Content-Type: application/json' \
22
+ -d ' {
19
23
"aggs" : {
20
24
"layer_count" : { "terms" : { "field" : "layer", "size": 20 } }
21
25
}
Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ set -euo pipefail
4
4
cluster_url=" ${cluster_url:- http:// localhost: 9200} "
5
5
echo " enabling slowlog for searching and indexing on $cluster_url "
6
6
7
- curl -XPUT " $cluster_url /_cluster/settings" -d ' {
7
+ curl -XPUT " $cluster_url /_cluster/settings" \
8
+ -H ' Content-Type: application/json' \
9
+ -d ' {
8
10
"persistent": {
9
11
"index.search.slowlog.threshold.query.warn": "10s",
10
12
"index.search.slowlog.threshold.query.info": "5s",
Original file line number Diff line number Diff line change 3
3
4
4
cluster_url=" ${cluster_url:- http:// localhost: 9200} "
5
5
echo " setting threadpool.bulk.queue_size to 500 on $cluster_url "
6
- curl -XPUT ${cluster_url} /_cluster/settings -d ' { "transient" : { "threadpool.bulk.queue_size" : 500 } }'
6
+ curl -XPUT ${cluster_url} /_cluster/settings \
7
+ -H ' Content-Type: application/json' \
8
+ -d ' { "transient" : { "threadpool.bulk.queue_size" : 500 } }'
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ new_snapshot_name="${new_snapshot_name:-pelias-2017.11.18-001123}"
14
14
read_only=" ${read_only:- true} "
15
15
16
16
# create bucket, only needs to be run once
17
- curl -XPOST " $cluster_url /_snapshot/$es_repo_name " -d " {
17
+ curl -XPOST " $cluster_url /_snapshot/$es_repo_name " \
18
+ -H ' Content-Type: application/json' \
19
+ -d " {
18
20
\" type\" : \" s3\" ,
19
21
\" settings\" : {
20
22
\" bucket\" : \" $s3_bucket \" ,
@@ -26,7 +28,9 @@ curl -XPOST "$cluster_url/_snapshot/$es_repo_name" -d "{
26
28
}"
27
29
28
30
# # import new snapshot with name including timestamp
29
- curl -XPOST " $cluster_url /_snapshot/$es_repo_name /${new_snapshot_name} /_restore" -d " {
31
+ curl -XPOST " $cluster_url /_snapshot/$es_repo_name /${new_snapshot_name} /_restore" \
32
+ -H ' Content-Type: application/json' \
33
+ -d " {
30
34
\" indices\" : \" pelias\" ,
31
35
\" rename_pattern\" : \" pelias\" ,
32
36
\" rename_replacement\" : \" $new_snapshot_name \"
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ index_name="${index_name:-pelias-2017.11.18-001123}"
6
6
7
7
echo " setting pelias alias to $index_name on $cluster_url "
8
8
9
- curl -XPOST " $cluster_url /_aliases" -d " {
9
+ curl -XPOST " $cluster_url /_aliases" \
10
+ -H ' Content-Type: application/json' \
11
+ -d " {
10
12
\" actions\" : [{
11
13
\" add\" : {
12
14
\" index\" : \" $index_name \" ,
Original file line number Diff line number Diff line change 4
4
5
5
cluster_url=" ${cluster_url:- http:// localhost: 9200} "
6
6
7
- curl -s -XPUT " $cluster_url /_cluster/settings" -d ' {
7
+ curl -s -XPUT " $cluster_url /_cluster/settings" \
8
+ -H ' Content-Type: application/json' \
9
+ -d ' {
8
10
"persistent" : {
9
11
"cluster.blocks.read_only" : true
10
12
}
Original file line number Diff line number Diff line change 4
4
5
5
cluster_url=" ${cluster_url:- http:// localhost: 9200} "
6
6
7
- curl -s -XPUT " $cluster_url /_cluster/settings" -d ' {
7
+ curl -s -XPUT " $cluster_url /_cluster/settings" \
8
+ -H ' Content-Type: application/json' \
9
+ -d ' {
8
10
"persistent" : {
9
11
"cluster.blocks.read_only" : false
10
12
}
Original file line number Diff line number Diff line change @@ -22,7 +22,9 @@ s3_bucket="${s3_bucket:-pelias-elasticsearch.nextzen.org}"
22
22
23
23
# create Elasticsearch repository from settings
24
24
set -x
25
- curl -XPOST " $cluster_url /_snapshot/$es_repo_name " -d " {
25
+ curl -XPOST " $cluster_url /_snapshot/$es_repo_name " \
26
+ -H ' Content-Type: application/json' \
27
+ -d " {
26
28
\" type\" : \" s3\" ,
27
29
\" settings\" : {
28
30
\" bucket\" : \" $s3_bucket \" ,
@@ -32,7 +34,9 @@ curl -XPOST "$cluster_url/_snapshot/$es_repo_name" -d "{
32
34
}"
33
35
34
36
# create snapshot
35
- curl -XPUT " $cluster_url /_snapshot/$es_repo_name /$new_snapshot_name " -d ' {
37
+ curl -XPUT " $cluster_url /_snapshot/$es_repo_name /$new_snapshot_name " \
38
+ -H ' Content-Type: application/json' \
39
+ -d ' {
36
40
"indices": "pelias"
37
41
}'
38
42
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -euo pipefail
3
3
4
- curl -XPUT " $cluster_url /twitter?pretty" -H ' Content-Type: application/json ' -d '
5
- {
6
- "settings" : {
7
- "index " : {
8
- "number_of_shards " : 3,
9
- "number_of_replicas " : 2
10
- }
4
+ curl -XPUT " $cluster_url /twitter?pretty" \
5
+ -H ' Content-Type: application/json ' \
6
+ -d ' {
7
+ "settings " : {
8
+ "index " : {
9
+ "number_of_shards " : 3,
10
+ "number_of_replicas" : 2
11
11
}
12
- }
13
- '
12
+ }
13
+ } '
14
14
15
15
curl -XDELETE " $cluster_url /twitter"
You can’t perform that action at this time.
0 commit comments