update
This commit is contained in:
@@ -54,7 +54,7 @@ function Usage {
|
||||
|
||||
function RestoreConf {
|
||||
if [ -z "$(ls config/)" ]; then
|
||||
Print Restore default config files and quit ...
|
||||
Print Restoring default config files and quit ...
|
||||
tar zxf config.tgz
|
||||
exit
|
||||
fi
|
||||
@@ -63,36 +63,36 @@ function RestoreConf {
|
||||
function ModifyConf {
|
||||
local kv=
|
||||
local conf='config/elasticsearch.yml'
|
||||
Print Modify $conf ...
|
||||
Print Modifying $conf ...
|
||||
while read kv; do
|
||||
[ -z "$kv" ] && break
|
||||
sed -i "/^${kv%%=*}: /d" $conf
|
||||
echo "${kv/=/: }" >> $conf
|
||||
done <<< "$(env | grep '^_CONF_' | sed 's/_CONF_//')"
|
||||
Print Remove path.data and path.log in $conf ...
|
||||
Print Removing path.data and path.log in $conf ...
|
||||
sed -i -e '/^path\.data/d' -e '/^path\.logs/d' $conf
|
||||
if grep -q '^cluster\.initial_master_nodes' $conf; then
|
||||
[ -z "$(ls data/)" -a -n "${ELASTIC_PASSWORD:-}" ] && BOOTSTRAP=1 && return 0
|
||||
Print Remove cluster.initial_master_nodes in $conf ...
|
||||
Print Removing cluster.initial_master_nodes in $conf ...
|
||||
sed -i '/^cluster\.initial_master_nodes/d' $conf
|
||||
fi
|
||||
}
|
||||
|
||||
function InstallPlugin {
|
||||
for f in $(ls -d offline-plugins/*.zip 2>/dev/null); do
|
||||
Print Install plugins from offline file: $f ...
|
||||
Print Installing plugins from offline file: $f ...
|
||||
./bin/elasticsearch-plugin install file://$f
|
||||
mv $f $f.installed
|
||||
done
|
||||
}
|
||||
|
||||
function ChangeOwner {
|
||||
Print Change file owner ...
|
||||
chown -R es.es config/ data/ logs/ plugins/
|
||||
Print Changing file owner ...
|
||||
chown -R es:es config/ data/ logs/ plugins/
|
||||
}
|
||||
|
||||
function ChangeSysConf {
|
||||
Print Change system conf ...
|
||||
Print Changing system conf ...
|
||||
echo 262144 > /proc/sys/vm/max_map_count || Print Not specified "--privileged".
|
||||
}
|
||||
|
||||
@@ -125,12 +125,13 @@ ${REMOTE_MONITORING_USER_PASSWORD:-$ELASTIC_PASSWORD}
|
||||
}
|
||||
|
||||
function StartProc {
|
||||
Print Start elasticsearch ...
|
||||
Print Starting elasticsearch ...
|
||||
su - es -c "
|
||||
export ES_JAVA_OPTS='${ES_JAVA_OPTS:-}'
|
||||
/opt/es/bin/elasticsearch -Epath.data=/opt/es/data -Epath.logs=/opt/es/logs
|
||||
" &> /dev/null &
|
||||
PIDS="$PIDS $!"
|
||||
Print Elasticsearch started.
|
||||
[ -z "$BOOTSTRAP" ] || SetupPassword
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user