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