LSHEAP and pipeline workers for virt

This commit is contained in:
m0duspwnens
2024-08-28 10:09:42 -04:00
parent 301894f6e8
commit 9ddccba780
4 changed files with 18 additions and 4 deletions

View File

@@ -44,6 +44,10 @@ for i in "$@"; do
ES_HEAP_SIZE="${i#*=}" ES_HEAP_SIZE="${i#*=}"
shift shift
;; ;;
-l=*|--lsheap=*)
LSHEAP="${i#*=}"
shift
;;
-n=*|--mgmtnic=*) -n=*|--mgmtnic=*)
MNIC="${i#*=}" MNIC="${i#*=}"
shift shift
@@ -214,7 +218,7 @@ function add_logstash_to_minion() {
"logstash:"\ "logstash:"\
" enabled: True"\ " enabled: True"\
" config:"\ " config:"\
" pipeline_x_workers: $CPUCORES"\ " pipeline_x_workers: $CORECOUNT"\
" settings:"\ " settings:"\
" lsheap: $LSHEAP"\ " lsheap: $LSHEAP"\
" " >> $PILLARFILE " " >> $PILLARFILE

View File

@@ -28,7 +28,7 @@ def run():
with open("/opt/so/saltstack/local/pillar/hypervisor/" + hv_name + "/" + minionid + ".sls", 'w') as f: with open("/opt/so/saltstack/local/pillar/hypervisor/" + hv_name + "/" + minionid + ".sls", 'w') as f:
yaml.dump(vm_out_data, f, default_flow_style=False) yaml.dump(vm_out_data, f, default_flow_style=False)
rc = call("NODETYPE=" + DATA['NODETYPE'] + " /usr/sbin/so-minion -o=addVirt -m=" + minionid + " -n=" + DATA['MNIC'] + " -i=" + DATA['MAINIP'] + " -a=" + DATA['INTERFACE'] + " -c=" + str(DATA['CORECOUNT']) + " -d='" + DATA['NODE_DESCRIPTION'] + "'", shell=True) rc = call("NODETYPE=" + DATA['NODETYPE'] + " /usr/sbin/so-minion -o=addVirt -m=" + minionid + " -n=" + DATA['MNIC'] + " -i=" + DATA['MAINIP'] + " -a=" + DATA['INTERFACE'] + " -c=" + str(DATA['CPU']) + " -d='" + DATA['NODE_DESCRIPTION'] + "'" + " -e=" + DATA['ES_HEAP_SIZE'] + " -l=" + DATA['LS_HEAP_SIZE'], shell=True)
logging.error('sominion_setup reactor: rc: %s' % rc) logging.error('sominion_setup reactor: rc: %s' % rc)

View File

@@ -14,7 +14,8 @@
{% if nodetype == "searchnode" %} {% if nodetype == "searchnode" %}
{% do DATA.update({'LSHOSTNAME': grains.host}) %} {# we can't use the host grain here because the grain may not be updated yet from the hostname change #}
{% do DATA.update({'LSHOSTNAME': salt['cmd.run']('hostname')}) %}
{# this replicates the function es_heapsize in so-functions #} {# this replicates the function es_heapsize in so-functions #}
{% if total_mem < 8000 %} {% if total_mem < 8000 %}
@@ -31,4 +32,13 @@
{% endif %} {% endif %}
{% do DATA.update({'ES_HEAP_SIZE': ES_HEAP_SIZE}) %} {% do DATA.update({'ES_HEAP_SIZE': ES_HEAP_SIZE}) %}
{% if total_mem >= 32000 or nodetype in ['managersearch','heavynode','standalone'] %}
{% set LS_HEAP_SIZE="1000m" %}
{% elif nodetype == 'eval' %}
{% set LS_HEAP_SIZE="700m" %}
{% else %}
{% set LS_HEAP_SIZE="500m" %}
{% endif %}
{% do DATA.update({'LS_HEAP_SIZE': LS_HEAP_SIZE}) %}
{% endif %} {% endif %}

View File

@@ -19,7 +19,7 @@ create_pillar:
NODETYPE: {{ DATA.NODETYPE }} NODETYPE: {{ DATA.NODETYPE }}
CORECOUNT: {{ DATA.CORECOUNT }} CORECOUNT: {{ DATA.CORECOUNT }}
LSHOSTNAME: {{ DATA.LSHOSTNAME }} LSHOSTNAME: {{ DATA.LSHOSTNAME }}
LSHEAP: {{ DATA.LSHEAP }} LS_HEAP_SIZE: {{ DATA.LSHEAP }}
CPUCORES: {{ DATA.CPUCORES }} CPUCORES: {{ DATA.CPUCORES }}
IDH_MGTRESTRICT: {{ DATA.IDH_MGTRESTRICT }} IDH_MGTRESTRICT: {{ DATA.IDH_MGTRESTRICT }}
IDH_SERVICES: {{ DATA.IDH_SERVICES }} IDH_SERVICES: {{ DATA.IDH_SERVICES }}