mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 01:02:46 +01:00
Add memory restrictions
This commit is contained in:
@@ -12,7 +12,6 @@ role:
|
||||
eval:
|
||||
fleet:
|
||||
heavynode:
|
||||
helixsensor:
|
||||
idh:
|
||||
import:
|
||||
manager:
|
||||
|
||||
@@ -562,7 +562,7 @@ check_requirements() {
|
||||
req_cores=4
|
||||
req_nics=2
|
||||
elif [[ $is_standalone ]]; then
|
||||
req_mem=24
|
||||
req_mem=16
|
||||
req_cores=4
|
||||
req_nics=2
|
||||
elif [[ $is_manager ]]; then
|
||||
@@ -586,7 +586,7 @@ check_requirements() {
|
||||
req_cores=4
|
||||
req_nics=1
|
||||
elif [[ $is_heavynode ]]; then
|
||||
req_mem=24
|
||||
req_mem=16
|
||||
req_cores=4
|
||||
req_nics=2
|
||||
elif [[ $is_idh ]]; then
|
||||
@@ -651,6 +651,17 @@ check_requirements() {
|
||||
|
||||
if [[ $total_mem_hr -lt $req_mem ]]; then
|
||||
whiptail_requirements_error "memory" "${total_mem_hr} GB" "${req_mem} GB"
|
||||
if [[ $is_standalone || $is_heavynode ]]; then
|
||||
echo "This install type will fail with less than $req_mem GB of memory"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
if [[ $is_standalone || $is_heavynode ]]; then
|
||||
if [[ $total_mem_hr -gt 15 && $total_mem_hr -lt 24 ]]; then
|
||||
low_mem=true
|
||||
else
|
||||
low_mem=false
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -956,9 +967,7 @@ docker_seed_registry() {
|
||||
|
||||
if ! [ -f /nsm/docker-registry/docker/registry.tar ]; then
|
||||
if [ "$install_type" == 'IMPORT' ]; then
|
||||
container_list 'so-import'
|
||||
elif [ "$install_type" == 'HELIXSENSOR' ]; then
|
||||
container_list 'so-helix'
|
||||
container_list 'so-import'
|
||||
else
|
||||
container_list
|
||||
fi
|
||||
@@ -1217,7 +1226,7 @@ ls_heapsize() {
|
||||
fi
|
||||
|
||||
case "$install_type" in
|
||||
'MANAGERSEARCH' | 'HEAVYNODE' | 'HELIXSENSOR' | 'STANDALONE')
|
||||
'MANAGERSEARCH' | 'HEAVYNODE' | 'STANDALONE')
|
||||
LS_HEAP_SIZE='1000m'
|
||||
;;
|
||||
'EVAL')
|
||||
@@ -1699,7 +1708,11 @@ drop_install_options() {
|
||||
echo "INTERFACE=$INTERFACE" >> /opt/so/install.txt
|
||||
NODETYPE=${install_type^^}
|
||||
echo "NODETYPE=$NODETYPE" >> /opt/so/install.txt
|
||||
echo "CORECOUNT=$lb_procs" >> /opt/so/install.txt
|
||||
if [[ $low_mem == "true" ]]; then
|
||||
echo "CORECOUNT=1" >> /opt/so/install.txt
|
||||
else
|
||||
echo "CORECOUNT=$lb_procs" >> /opt/so/install.txt
|
||||
fi
|
||||
echo "LSHOSTNAME=$HOSTNAME" >> /opt/so/install.txt
|
||||
echo "LSHEAP=$LS_HEAP_SIZE" >> /opt/so/install.txt
|
||||
echo "CPUCORES=$num_cpu_cores" >> /opt/so/install.txt
|
||||
|
||||
Reference in New Issue
Block a user