gpt4 book ai didi

linux - 即使在 session 超时后如何使 spring-boot 应用程序保持事件状态

转载 作者:太空狗 更新时间:2023-10-29 12:40:55 26 4
gpt4 key购买 nike

  • 我在远程环境中托管了一台 Linux 机器。
  • 那台机器的详细信息如下:

    LSB 版本::core-4.1-amd64:core-4.1-noarch
    分销商 ID:RedHatEnterpriseServer
    说明:Red Hat Enterprise Linux Server release 7.2 (Maipo)
    发布:7.2
    代号:麦婆

    • 我在那台机器上运行 Spring-Boot 服务使用 mvn spring-boot:run

    • 我正在使用 putty 连接那台机器并执行命令。

我的问题是持续运行该服务。

如果我的 Windows 系统连接到互联网并且我的 PUTTY session 在远程服务上运行正常,但一旦我的 session 超时,远程服务就会停止执行。

有什么方法可以让该服务全天候运行。

最佳答案

您可以使用“屏幕”https://www.digitalocean.com/community/tutorials/how-to-install-and-use-screen-on-an-ubuntu-cloud-server

这将允许您继续运行您的 spring boot 应用程序,即使您的终端/腻子断开连接也是如此:

这是一个备忘单: http://neophob.com/2007/04/gnu-screen-cheat-sheet/

开始。

开始一个新屏幕:

# screen

运行您的 spring boot 应用:

# mvn spring-boot:run

分离您的屏幕:

ctrl a ctrl d

测试您的 spring boot 应用程序是否仍在运行

重新连接到您的屏幕:

# screen -r

这些是基本命令。

关于linux - 即使在 session 超时后如何使 spring-boot 应用程序保持事件状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44735590/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com