-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·30 lines (20 loc) · 978 Bytes
/
setup.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
#!/bin/bash
CBASE_ADDR=127.0.0.1
sudo service elasticsearch start
sudo service logstash start
until $(curl --output /dev/null --silent --head --fail http://localhost:9200); do
printf '.'
sleep 5
done
curl -v -u admin:password http://$CBASE_ADDR:8091/pools/default/remoteClusters -d name=elasticsearch -d hostname=$CBASE_ADDR:9091 -d username=admin -d password=password
#curl --retry 10 -XPUT http://localhost:9200/objects/ -d '{"index":{"analysis":{"analyzer":{"default":{"type":"whitespace","tokenizer":"whitespace"}}}}}'
curl -XPUT 'http://localhost:9200/objects/' -d '{
"settings" : {
"number_of_shards" : 5,
"number_of_replicas" : 1
}
}'
sleep 20
curl -v -X POST -u admin:password http://$CBASE_ADDR:8091/controller/createReplication -d fromBucket=objects -d toCluster=elasticsearch -d toBucket=objects -d replicationType=continuous -d type=capi
sudo update-rc.d elasticsearch defaults 95 10
/usr/share/elasticsearch/bin/elasticsearch