Setting vm.max_map_count during installer
@@ -258,6 +258,32 @@ if [ $ERROR -ne 0 ]; then
exit 1
fi
+echo "[*] Setting vm.max_map_count to 262144" | tee -a $LOGFILE
+sysctl -w vm.max_map_count=262144 >> $LOGFILE 2>&1
+ERROR=$?
+if [ $ERROR -ne 0 ]; then
+ echo "[X] Could not set vm.max_map_count (Error Code: $ERROR)." | tee -a $LOGFILE
+ exit 1
+fi
+
+if ( ! grep -r "^vm.max_map_count" /etc/sysctl* > /dev/null ) ; then
+ echo "[*] Making vm.max_map_count setting persistent" | tee -a $LOGFILE
+ echo "vm.max_map_count=262144" >> /etc/sysctl.conf >> $LOGFILE 2>&1
+ ERROR=$?
+ if [ $ERROR -ne 0 ]; then
+ echo "[X] Could not make vm.max_map_count persistent (Error Code: $ERROR)." | tee -a $LOGFILE
+ exit 1
+ fi
+else
+ echo "[!] WARNING : existing vm.max_map_count setting found in /etc/systctl.conf - yolo continuing" | tee -a $LOGFILE
+fi
+
+ERROR=$?
+if [ $ERROR -ne 0 ]; then
+ echo "[X] Could not set kibana_system ES password (Error Code: $ERROR)." | tee -a $LOGFILE
+ exit 1
+fi
+
CREDS_kibana_system=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)
echo "[*] Setting kibana_system ES password" | tee -a $LOGFILE
sed -E -i.bak "s/\{\{CREDS_kibana_system\}\}/${CREDS_kibana_system}/g" ${DOCKERENVFILE} >> $LOGFILE 2>&1
