Skip to content

Commit 1f0ec85

Browse files
committed
try to fix starting influxdb on windows
1 parent 235e273 commit 1f0ec85

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

scripts/start-influxdb.bat

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,30 @@ if not exist "%INFLUXDB_DIR%\influxd.exe" (
3939
)
4040

4141
echo Starting InfluxDB...
42-
start /B "%INFLUXDB_DIR%\influxd.exe" -config influxdb.conf
42+
start /B "" "%INFLUXDB_DIR%\influxd.exe" -config influxdb.conf
4343
if errorlevel 1 (
4444
echo ERROR: Failed to start InfluxDB
4545
exit /b 1
4646
)
4747

48+
REM Wait a moment for InfluxDB to start
49+
timeout /t 3 /nobreak >nul
50+
51+
REM Verify the process is running
52+
tasklist /FI "IMAGENAME eq influxd.exe" 2>nul | find /I "influxd.exe" >nul
53+
if errorlevel 1 (
54+
echo ERROR: InfluxDB process is not running
55+
exit /b 1
56+
)
57+
4858
echo Waiting for InfluxDB to be ready...
49-
timeout /t 10 /nobreak >nul
59+
timeout /t 7 /nobreak >nul
5060

51-
REM Check if InfluxDB is responding
61+
REM Check if InfluxDB is responding using PowerShell with timeout
5262
set /a max_attempts=30
5363
set /a attempt=0
5464
:health_check
55-
curl -s http://localhost:8086/ping >nul 2>&1
65+
powershell -Command "try { $r = Invoke-WebRequest -Uri 'http://localhost:8086/ping' -TimeoutSec 1 -UseBasicParsing -ErrorAction Stop; if ($r.StatusCode -eq 204) { exit 0 } else { exit 1 } } catch { exit 1 }" >nul 2>&1
5666
if errorlevel 1 (
5767
set /a attempt+=1
5868
if !attempt! lss %max_attempts% (

0 commit comments

Comments
 (0)