mxivideo/troubleshoot-postgres.bat

42 lines
706 B
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
echo PostgreSQL Docker 故障排除脚本
echo ================================
echo.
echo 1. 停止现有服务...
docker-compose down
echo.
echo 2. 清理容器和网络...
docker system prune -f
echo.
echo 3. 检查端口占用...
netstat -ano | findstr :5432
netstat -ano | findstr :5433
echo.
echo 4. 检查 Docker 状态...
docker version
echo.
echo 5. 重新启动服务(使用端口 5433...
docker-compose up -d
echo.
echo 6. 等待服务启动...
timeout /t 10
echo.
echo 7. 检查服务状态...
docker-compose ps
echo.
echo 8. 查看日志...
docker-compose logs postgres
echo.
echo 故障排除完成!
echo 如果仍有问题,请检查上面的日志输出。
pause