You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用NSSM将Prefect Server作为Windows服务运行时,无法通过机器IP地址访问服务

使用NSSM将Prefect Server作为Windows服务运行时,无法通过机器IP地址访问服务

我已经在Windows虚拟机上配置好了Prefect Server,让它绑定到机器的IP地址,手动启动测试一切正常,但用NSSM把它注册成Windows服务后,就没法通过IP访问了。先跟大家说下我之前的操作步骤:

手动配置并启动Prefect Server的流程

  • 激活虚拟环境:
    env\Scripts\activate.bat
    
  • 设置Server绑定到机器IP地址:
    (env) prefect config set PREFECT_SERVER_API_HOST='SERVER-IP-ADDRESS'
    
  • 启动Prefect Server:
    (env) prefect server start
    

启动后会出现Prefect的标识:

___ ___ ___ ___ ___ ___ _____ 
| _ \ _ \ __| __| __/ __|_   _| 
|  _/   / _|| _|| _| (__  | |  
|_| |_|_\___|_| |___\___| |_|  

同时会给出后续配置提示:

Configure Prefect to communicate with the server with:

prefect config set PREFECT_API_URL=http://SERVER-IP-ADDRESS:4200/api

View the API reference documentation at http://SERVER-IP-ADDRESS:4200/docs
Check out the dashboard at http://SERVER-IP-ADDRESS:4200

手动运行时,这些地址都能正常访问。

用NSSM配置Windows服务的尝试

为了让Prefect Server能在后台稳定运行,我用NSSM工具将它注册为Windows服务,还写了一个批处理文件来统一启动流程,文件内容如下:

cd C:\Users\username\Documents\Projects\prefect-server\env\Scripts
call activate.bat
prefect.exe server start

我先在命令提示符里手动运行了这个批处理文件,测试下来是正常的,但把它通过NSSM注册成服务后,就没法通过机器IP地址访问服务了,有没有大佬知道问题出在哪?

备注:内容来源于stack exchange,提问作者jsv

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 07:48:04