-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinit_elasticsearch_noriver.sh
executable file
·45 lines (32 loc) · 1.29 KB
/
init_elasticsearch_noriver.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
#!/bin/bash
## This script uses Elasticsearch http API to init elasticsearch configurations only (indices and mappings)
##
## You can use first commandline parameter to define Elasticsearch http connector URL base. If not present then OPENSHIFT_JBOSSEAP_IP system property can be used to define IP/domainname part of URL (http protocol and port 15000 is used in this case). If not defined then default is: http://localhost:15000
## You can use optional second commandline parameter to define username for Elasticsearch http connector HTTP basic authentication
## You can use optional third commandline parameter to define password for Elasticsearch http connector HTTP basic authentication
clear
esurl="http://localhost:15000"
if [ -n "${OPENSHIFT_JBOSSEAP_IP}" ]; then
esurl=http://${OPENSHIFT_JBOSSEAP_IP}:15000
fi
if [ -n "$1" ]; then
esurl=$1
fi
if [ -n "$2" ]; then
esusername=$2
fi
if [ -n "$3" ]; then
espassword=$3
fi
echo ========== Initializing Elasticsearch cluster ===========
echo Using Elasticsearch http connector URL base: ${esurl}
pushd index_templates/
./init_templates.sh ${esurl} ${esusername} ${espassword}
popd
pushd indexes/
./init_indexes.sh ${esurl} ${esusername} ${espassword}
popd
pushd mappings/
./init_mappings.sh ${esurl} ${esusername} ${espassword}
popd
echo FINISHED!