Spring XD - 无法找到名称模块

时间:2015-04-13 18:14:55

标签: spring spring-xd

我在Spring XD中使用了一些自定义模块。我可以在XD的单节点部署中使用“模块上传”而没有问题,但是当在分布式模式下运行时,我有以下例外:

org.springframework.xd.dirt.module.NoSuchModuleException: Could not find module with name 'grobid' and type 'processor'

我正在使用Spring XD 1.1.1.RELEASE创建带有docker的XD集群。以下是导致此异常的命令序列:

server-unknown:>admin config server http://docker:9393
Successfully targeted http://docker:9393
xd:>module upload --type processor --name grobid --file /opt/.../grobid-1.0-SNAPSHOT.jar
Successfully uploaded module 'processor:grobid'
xd:>stream create --name grobidTest --definition "http --port=11001 | grobid --grobidHost=http://${GROBID_PORT_8080_TCP_ADDR}:${GROBID_PORT_8080_TCP_PORT} | processedXml:log"
Created new stream 'grobidTest'
xd:>stream deploy --name grobidTest --properties "module.grobid.count=1"
Deployed stream 'grobidTest'

根据文档我已经设置了一个独立的redis实例,并且在启动XD时没有任何日志,表明它有任何连接问题。

什么可能导致我的模块在shell中无法访问节点,我可以访问它的信息:

xd:>module info --name processor:grobid
Information about processor module 'grobid':

  Option Name  Description                                            Default  Type
  -----------  -----------------------------------------------------  -------  --------
  grobidHost   Grobid Host                                            <none>   String
  outputType   how this module should emit messages it produces       <none>   MimeType
  inputType    how this module should interpret messages it consumes  <none>   MimeType

唯一的问题(我不知道它是否是一个阻止程序)我可以在日志中看到的是当我创建流时我有一些ZK错误被记录:

zk_1      | 2015-04-13 19:55:37,257 [myid:] - INFO  [ProcessThread(sid:0 cport:-1)::PrepRequestProcessor@645] - Got user-level KeeperException when processing sessionid:0x14cb4593f940001 type:create cxid:0x59 zxid:0x36 txntype:-1 reqpath:n/a Error Path:/xd/modules/sink/log/dependencies Error:KeeperErrorCode = NoNode for /xd/modules/sink/log/dependencies
zk_1      | 2015-04-13 19:55:37,273 [myid:] - INFO  [ProcessThread(sid:0 cport:-1)::PrepRequestProcessor@645] - Got user-level KeeperException when processing sessionid:0x14cb4593f940001 type:create cxid:0x64 zxid:0x3c txntype:-1 reqpath:n/a Error Path:/xd/modules/processor/grobid/dependencies Error:KeeperErrorCode = NoNode for /xd/modules/processor/grobid/dependencies
zk_1      | 2015-04-13 19:55:37,289 [myid:] - INFO  [ProcessThread(sid:0 cport:-1)::PrepRequestProcessor@645] - Got user-level KeeperException when processing sessionid:0x14cb4593f940001 type:create cxid:0x6e zxid:0x41 txntype:-1 reqpath:n/a Error Path:/xd/modules/source/http/dependencies Error:KeeperErrorCode = NoNode for /xd/modules/source/http/dependencies

1 个答案:

答案 0 :(得分:1)

Spring XD在https://github.com/spring-projects/spring-xd/commit/208181c9f4693d2ef2e4e0d4065d9d8727fa1601中添加了“共享远程模块注册表”的概念(1.2,在撰写本文时未发布)。这依赖于共享位置,可能是HDFS。

在此之前,如果您要使用具有自定义上载模块的群集,那么您需要以某种方式将模块编写的位置提供给所有容器。传统的做法是使用像NFS这样的东西。

如果您正在使用泊坞窗(而且似乎是,但不确定这是否只在一台主机上),您可以使用Docker data volume进行此操作。

为了澄清,最后两段甚至适用于Spring XD 1.1.x