Skip to content

Commit 866811a

Browse files
committed
fix windows influxdb startup
1 parent 8233c43 commit 866811a

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

scripts/start-influxdb.bat

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

4141
echo Starting InfluxDB...
42-
start /B "" "%INFLUXDB_DIR%\influxd.exe" -config influxdb.conf
43-
if errorlevel 1 (
44-
echo ERROR: Failed to start InfluxDB
45-
exit /b 1
46-
)
42+
powershell -Command "Start-Process -FilePath '%INFLUXDB_DIR%\influxd.exe' -ArgumentList '-config','influxdb.conf' -WindowStyle Hidden"
4743

4844
REM Wait a moment for InfluxDB to start
49-
timeout /t 3 /nobreak >nul
45+
ping 127.0.0.1 -n 4 >nul
5046

5147
REM Verify the process is running
5248
tasklist /FI "IMAGENAME eq influxd.exe" 2>nul | find /I "influxd.exe" >nul
@@ -56,7 +52,7 @@ if errorlevel 1 (
5652
)
5753

5854
echo Waiting for InfluxDB to be ready...
59-
timeout /t 7 /nobreak >nul
55+
ping 127.0.0.1 -n 8 >nul
6056

6157
REM Check if InfluxDB is responding using PowerShell with timeout
6258
set /a max_attempts=30
@@ -66,7 +62,7 @@ powershell -Command "try { $r = Invoke-WebRequest -Uri 'http://localhost:8086/pi
6662
if errorlevel 1 (
6763
set /a attempt+=1
6864
if !attempt! lss %max_attempts% (
69-
timeout /t 1 /nobreak >nul
65+
ping 127.0.0.1 -n 2 >nul
7066
goto :health_check
7167
)
7268
echo WARNING: InfluxDB may not be fully ready yet

scripts/stop-influxdb.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ REM Kill influxd.exe process
99
taskkill /F /IM influxd.exe >nul 2>&1
1010

1111
REM Wait a bit for the process to fully terminate
12-
timeout /t 2 /nobreak >nul
12+
ping 127.0.0.1 -n 3 >nul
1313

1414
echo InfluxDB stopped.

0 commit comments

Comments
 (0)