如何启动两个播放应用程序实例? [英] How to start two instances of play application?

查看:174
本文介绍了如何启动两个播放应用程序实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在不同的端口部署相同播放应用程序的两个实例,并通过前面的nginx在之间进行负载平衡。

I'm trying to deploy two instances of same play application in different ports and load balance between then through nginx in front.

根据手册,要启动多个游戏实例,这些是命令。

As per the manual, to start multiple instances of play, these are the commands.

$ start -Dhttp.port=9998
$ start -Dhttp.port=9999

但是,如果我给了那些,第一个命令正确启动我的应用程序在端口9998,但第二个命令无法通过提供以下消息来执行此操作。

But, if I gave those, the first command properly starts my application in port 9998, but the second commands fails to do so by giving following message.

This application is already running (Or delete /play/app/folder/RUNNING_PID file)

我正在使用Ubuntu 12.05。

I'm using Ubuntu 12.05.

那么,如何启动单个播放实例的多个实例?

So, how can I start multiple instances of single play instance?

推荐答案

$ start -Dhttp.port=9998 -Dpidfile.path=/path/to/app1/pidfile
$ start -Dhttp.port=9999 -Dpidfile.path=/path/to/app2/pidfile

只需确保传递给每个应用程序的两个pidfile路径都是d ifferent。

Just make sure the two pidfile paths that you pass to each app are different.

这里记录了:

http://www.playframework.com/documentation/2.2.x/ProductionConfiguration

这篇关于如何启动两个播放应用程序实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆