SUDO='' if [ $(id -u) != 0 ]; then SUDO='sudo' fi if ! hash docker 2>/dev/null; then echo "\"docker\" executable not found. Please install docker." exit 1 fi if ! hash docker-compose 2>/dev/null; then echo "\"docker-compose\" executable not found. Please install docker-compose." exit 1 fi # check kernel parameter # check if vm.max_map_count is at least 262144 on host # this is needed for elasticsearch >5.x ACTUAL_MAX_MAP_COUNT=$(sysctl -n vm.max_map_count) MINIMAL_MAX_MAP_COUNT=262144 if [ "$ACTUAL_MAX_MAP_COUNT" -lt "$MINIMAL_MAX_MAP_COUNT" ]; then echo "vm.max_map_count is too low. This is a kernel parameter used by java which is used by elasticsearch. Elasticsearch won't run if vm.max_map_count is too low." while true; do read -p "Do you wish to increase vm.max_map_count to 262144? " yn case $yn in [Yy]* ) $SUDO sysctl -w "vm.max_map_count=262144"; echo "To make this change permanent after restart: Add \"vm.max_map_count=262144\" to \"/etc/sysctl.conf\""; break;; [Nn]* ) exit 1;; * ) echo "Please answer yes or no.";; esac done fi $SUDO chown 100:101 database cat <