在 Windows 服务器上启动 Erlang 应用程序

发布于 2024-09-14 18:07:02 字数 317 浏览 3 评论 0原文

我有一个部署在 Windows Server 2008 服务器上的 Erlang 应用程序。

我的做法是:

  1. 将应用程序文件夹复制到 Erlang lib 目录中。
  2. 打开命令行 (cmd)。执行erl
  3. 在 Erlang shell 中执行 application:start(app_name)

有没有更好的方法来启动应用程序?如何让应用程序在Windows启动时启动?

I have an Erlang application that is deployed on a server with Windows Server 2008.

The way I do this:

  1. Copy application folder in Erlang lib directory.
  2. Open command line (cmd). Execute erl.
  3. Execute application:start(app_name) in Erlang shell.

Are there any better approaches to launch the application? How to make the application to launch on Windows startup?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烟火散人牵绊 2024-09-21 18:07:02

我没有使用 Windows 的经验,但是...

`1。首先,您可能想了解一下 release 的概念在埃尔兰。本质上,

当我们编写了一个或多个应用程序时,我们可能希望创建一个由这些应用程序和 Erlang/OTP 应用程序的子集组成的完整系统。这称为发布。

`2.然后,您可能想要创建一个包含以下内容的脚本:

erl -boot ch_rel-1

本质上您是使用上面创建的启动脚本来启动 Erlang/OTP(只需按照发布页面中的说明进行操作)

`3。本文介绍了如何在 Windows Server 2008 中创建启动脚本(未经测试,只是通过 google 搜索):

http://technet.microsoft.com/en-us/magazine/dd630947.aspx

希望这会有所帮助。好问题。

I have no experience with Windows but...

`1. First of all, you might want to have a look to the concept of release in Erlang. Essentially,

When we have written one or more applications, we might want to create a complete system consisting of these applications and a subset of the Erlang/OTP applications. This is called a release.

`2. Then, you might want to create a script that contains something like:

erl -boot ch_rel-1

Where essentially you're starting Erlang/OTP using a boot script that you created above (just follow the instructions in the releases page)

`3. This article explains how to create startup scripts in Windows Server 2008 (not tested, just googled):

http://technet.microsoft.com/en-us/magazine/dd630947.aspx

Hope this helps. Nice question.

总以为 2024-09-21 18:07:02

也许 rebar 可能会有所帮助。它使得构建应用程序框架和发布变得非常容易。 此处有一个很好的教程。

Perhaps rebar might help. It makes building an app skeleton and release quite easy. A nice tutorial is here.

零時差 2024-09-21 18:07:02

熟悉发行版后,请查看 start_erl 和 erlsrv 的手册页 (erl -man )。我用它们来启动嵌入式系统( http://www.erlang.org/doc/ Embedded/embedded_nt.html )在 Windows 2003 中,希望它在 Windows 2008 中仍然适用于您。
使用 erlsrv 创建服务后,可以通过标准 Windows 命令行和 GUI 工具对其进行管理,例如设置启动模式和重新启动策略。

也许您可以通过提供“-s app_name”作为 erl/start_erl 附加标志来启动您的应用程序,但我没有尝试这样做,因为我必须在嵌入式系统发布方面走很长的路。在这种情况下,请确保您有“start() -> application:start(?MODULE)”。在你的“app_name.erl”中。

After getting familiar with releases, take a look at manual pages (erl -man ) for start_erl and erlsrv. I used them to start embedded system ( http://www.erlang.org/doc/embedded/embedded_nt.html ) in windows 2003, hope it still works for you in windows 2008.
After creating service with erlsrv it is possible to manage it via standard windows command line and GUI tools, e.g. setting start mode and restart policy.

May be you could start just your application by supplying "-s app_name" as erl/start_erl additional flag, but I didn't try that, as I had to go long route with embedded system release. In that case make sure you have "start() -> application:start(?MODULE)." in your "app_name.erl".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文