VanillaSoftwareProcess 实体在 Apache Brooklyn 中不起作用

VanillaSoftwareProcess Entity does not work in Apache Brooklyn

我有最后一个 Apache Brooklyn (24.08.2015),版本:0.8.0-SNAPSHOT,当我尝试此处的蓝图示例时:https://brooklyn.incubator.apache.org/v/latest/yaml/custom-entities.html

name: Simple Netcat Server Example
location: localhost
services:
- type: brooklyn.entity.basic.VanillaSoftwareProcess
  name: Simple Netcat Server
  launch.command: |
    echo hello | nc -l 4321 &
    echo $! > $PID_FILE

  # The following overrides demonstrate the use of a custom shell environment as well as
  # check-running and stop commands. These are optional; default behavior will "do the
  # right thing" with the pid file automatically.

  env:                  { CHECK_MARKER: "checkRunning", STOP_MARKER: "stop" }
  checkRunning.command: echo $CHECK_MARKER >> DATE && test -f "$PID_FILE" && ps -p `cat $PID_FILE` >/dev/null
  stop.command:         echo $STOP_MARKER  >> DATE && test -f "$PID_FILE" && { kill -9 `cat $PID_FILE`; rm /tmp/vanilla.pid; }

# can also define download.url, in which case the launch command defaults to ./start.sh in that (archive) file

当我尝试使用 Apache Brooklyn 创建应用程序时,出现内部错误。我调试了应用程序,得到的异常如下 (PlanToSpecFactory.java):

java.lang.UnsupportedOperationException: Deployment plan item org.apache.brooklyn.camp.spi.pdp.Service@62abec8e[name=Simple Netcat Server,description=,serviceType=brooklyn.entity.basic.VanillaSoftwareProcess,characteristics=[],customAttributes={launch.command=echo hello | nc -l 4321 & echo $! > $PID_FILE , env={CHECK_MARKER=checkRunning, STOP_MARKER=stop}, checkRunning.command=echo $CHECK_MARKER >> DATE && test -f "$PID_FILE" && ps -p cat $PID_FILE >/dev/null, stop.command=echo $STOP_MARKER

DATE && test -f "$PID_FILE" && { kill -9 cat $PID_FILE; rm /tmp/vanilla.pid; }}] cannot be matched

debug.log

中的痕迹

DEBUG o.a.b.c.plan.PlanToSpecFactory [brooklyn-jetty-server-8443-qtp1119923741-24]: Plan could not be transformed; failure will be propagated (other transformers tried = []): [java.lang.IllegalArgumentException: Transformer for Brooklyn OASIS CAMP interpreter gave an error creating this plan]

知道为什么吗?过去这行得通

(我想 post 在 Apache Brooklyn 的邮件列表中,但是我得到一个错误,我无法联系到任何人)

最新的 SNAPSHOT 版本进行了重大重构,将包名称更改为 org.apache.brooklyn.*。这可能就是为什么您的布鲁克林版本再也找不到 VanillaSoftwareProcess 的原因了。

基于 Github repository,此实体现在位于此处:org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess