add opensearch addons
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
#!/command/execlineb -S0
|
||||
# Prevent restart loops; allow clean exit
|
||||
exit 0
|
@@ -0,0 +1,33 @@
|
||||
#!/command/with-contenv bash
|
||||
set -euo pipefail
|
||||
OPTIONS_FILE=/data/options.json || true
|
||||
NODE_NAME="os-data-1"
|
||||
HEAP="5g"
|
||||
CLUSTER_NAME="hass-opensearch-cluster"
|
||||
HTTP_PORT=9201
|
||||
TRANSPORT_PORT=9301
|
||||
NODE_ROLES="data,ingest"
|
||||
|
||||
# override from options.json if present
|
||||
if [ -f "$OPTIONS_FILE" ]; then
|
||||
NODE_NAME=$(jq -r '.node_name // "os-data-1"' "$OPTIONS_FILE" 2>/dev/null || echo "os-data-1")
|
||||
HEAP=$(jq -r '.opensearch_heap // "5g"' "$OPTIONS_FILE" 2>/dev/null || echo "5g")
|
||||
CLUSTER_NAME=$(jq -r '.cluster_name // "hass-opensearch-cluster"' "$OPTIONS_FILE" 2>/dev/null || echo "hass-opensearch-cluster")
|
||||
HTTP_PORT=$(jq -r '.http_port // 9201' "$OPTIONS_FILE" 2>/dev/null || echo 9201)
|
||||
TRANSPORT_PORT=$(jq -r '.transport_port // 9301' "$OPTIONS_FILE" 2>/dev/null || echo 9301)
|
||||
NODE_ROLES=$(jq -r '.node_roles // ["data,ingest"] | join(",")' "$OPTIONS_FILE" 2>/dev/null || echo "data,ingest")
|
||||
fi
|
||||
|
||||
export OPENSEARCH_JAVA_OPTS="-Xms$5g -Xmx$5g"
|
||||
|
||||
echo "[s6-run] Starting OpenSearch node: $os-data-1 roles:$data,ingest heap:$5g http:$9201 transport:$9301"
|
||||
|
||||
exec /usr/share/opensearch/bin/opensearch \
|
||||
-E cluster.name=$hass-opensearch-cluster \
|
||||
-E node.name=$os-data-1 \
|
||||
-E node.roles=[$data,ingest] \
|
||||
-E http.port=$9201 \
|
||||
-E transport.port=$9301 \
|
||||
-E network.host=0.0.0.0 \
|
||||
-E discovery.seed_hosts=os-master,os-data-1,os-data-2,os-coord-1,os-coord-2 \
|
||||
-E cluster.initial_master_nodes=os-master
|
Reference in New Issue
Block a user