try to fix :/
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 40s

This commit is contained in:
Your Name
2025-09-20 10:45:09 +12:00
parent 7851aa810b
commit ca15271109
6 changed files with 167 additions and 24 deletions

View File

@@ -19,6 +19,15 @@ if [ "$current_max_map_count" -lt 262144 ]; then
_die "System configuration needs adjustment"
fi
# Check available memory
available_mem=$(free -m | awk '/^Mem:/{print $7}')
if [ "$available_mem" -lt 3000 ]; then
echo "WARNING: Low available memory (${available_mem}MB)"
echo "ELK stack requires at least 3-4GB free memory for proper operation"
echo "Services may take longer to start or fail to start"
echo ""
fi
# Stop any existing containers
bash ./stop.sh || true
@@ -62,27 +71,39 @@ echo "Starting ELK stack..."
docker compose up -d --build || _die "Failed to start ELK stack"
# Wait for services to be ready with polling
echo "Waiting for services to start..."
MAX_WAIT=120 # Maximum 2 minutes
echo "Waiting for services to start (this can take 2-3 minutes on first run)..."
MAX_WAIT=240 # Maximum 4 minutes
WAITED=0
while [ $WAITED -lt $MAX_WAIT ]; do
# Check if all services are running
if bash ./status.sh 2>/dev/null | grep -q "Running"; then
echo "All services are up!"
echo " All services are up!"
break
fi
# Show progress
echo -n "."
# Show progress with time elapsed
if [ $((WAITED % 10)) -eq 0 ] && [ $WAITED -gt 0 ]; then
echo -n " [${WAITED}s]"
else
echo -n "."
fi
sleep 2
WAITED=$((WAITED + 2))
done
echo ""
if [ $WAITED -ge $MAX_WAIT ]; then
echo "Warning: Services took longer than expected to start"
echo "Checking current status..."
echo "Warning: Services are still starting. This is normal on first run."
echo "Current status:"
bash ./status.sh || true
echo ""
echo "You can check the logs with:"
echo " docker logs ${CONTAINER_NAME}_elasticsearch"
echo " docker logs ${CONTAINER_NAME}_logstash"
echo " docker logs ${CONTAINER_NAME}_kibana"
echo ""
echo "The services will continue starting in the background."
fi
# Create custom user