简体   繁体   English

玩! 框架2.2.2 DIY构建在openshift上失败

[英]play! framework 2.2.2 diy build failed on openshift

i have downloaded play 2.2.2 zip file. 我已经下载了Play 2.2.2 zip文件。

and added action_hooks for start/stop. 并添加了用于启动/停止的action_hooks。

but the build was failed due to the following info: 但由于以下信息,构建失败:

  play-2.2.2/framework/build: line 23: 320514 Killed
  "$JAVA" ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M
   -XX:ReservedCodeCacheSize=192m
   -XX:+CMSClassUnloadingEnabled
   -XX:MaxPermSize=512M ${JAVA_OPTS} 
   -Dfile.encoding=UTF-8 
   -Dplay.version="${PLAY_VERSION}" 
   -Dplay.home=`dirname $0` 
   -Dsbt.boot.properties=`dirname $0`/sbt/sbt.boot.properties
   -Dsbt.scala.version=${SBT_SCALA_VERSION} 
   ${PLAY_OPTS} -jar `dirname $0`/sbt/sbt-launch.jar "$@"
 remote: -------------------------
 remote: Git Post-Receive Result: failure
 remote: Activation status: failure

how can i make it work? 我该如何运作? thanks! 谢谢!

This is a little late, but you would have to set -Xmx1536M to a limit your current gear supports (like 512M with standard small gear size). 这有点晚了,但您必须将-Xmx1536M设置为当前齿轮支持的极限(例如标准小齿轮尺寸的512M)。

To accomplish this, you can alter the file play-2.2.2/framework/build to adapt this setting. 为此,您可以更改文件play-2.2.2/framework/build以适应此设置。

Otherwise, the supervising openshift process will ungracefully kill your build process as it consumes a lot of memory. 否则,监督openshift进程会不合时宜地终止您的构建过程,因为它会占用大量内存。

UPDATE: 更新:

I faced the same issues today and ran into the need to solve this properly so I investigated possible solutions a bit further: 今天,我面临着同样的问题,并遇到了正确解决此问题的需求,因此我进一步研究了可能的解决方案:

  1. The play command appends _JAVA_OPTIONS to each commands it runs. play命令将_JAVA_OPTIONS附加到它运行的每个命令。 So setting environment variable _JAVA_OPTIONS => -Xmx=512M removes the build failure on smaller gears without having to modify anything 因此,设置环境变量_JAVA_OPTIONS => -Xmx = 512M可以消除较小齿轮的构建故障,而无需进行任何修改

  2. Setting PLAY_OPTS as well appends a string to each of the commands so I can mix and match different environment variables with an appropriate openshift.conf file. 设置PLAY_OPTS也会在每个命令后附加一个字符串,这样我就可以使用合适的openshift.conf文件来混合和匹配不同的环境变量。

To sum this up and revise my initial answer: 总结一下并修改我的初始答案:

  1. set environment variable _JAVA_OPTIONS to contain a appropriate memory limit Java flag like -Xmx=512M , where 512M should match small gear sizes 将环境变量_JAVA_OPTIONS设置为包含适当的内存限制Java标志,例如-Xmx=512M ,其中512M应该匹配小齿轮

  2. customize any further Play! 自定义任何其他Play! behaviour with an additional enviroment variable PLAY_OPTS 附加环境变量PLAY_OPTS行为

This should work just fine with Play! 这在Play上应该可以正常工作! 2.2.2-I dont know if it does with the upcoming 2.3. 2.2.2-我不知道它是否适用于即将发布的2.3。 But that's another story as the play cartridge would have to be rewritten to only work with sbt. 但这是另一回事,因为必须重写播放盒才能只使用sbt。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM