2017-07-16 55 views
1

我們使用Vert.X庫開發REST服務層以接收來自多個來源的消息。部分要求是在高可用性(HA)模式下運行REST Verticle。我們遵循vert.x核心手冊來實現VertX集羣在分佈式集羣中運行(3個節點開始)。以分佈模式運行由hazelcast緩存支持的vert.x集羣

根據相關文檔,我們沒有依賴關係如下

  1. 包括hazelcast庫

    io.vertx vertx-hazelcast 3.3.0

  2. 創建脂肪罐子使用以下清單條目並在classpath中添加資源文件夾,該文件夾需要加載配置。我們把hazelcast-default.xml中從vertx-例子從GitHub

    log4j.properties config.json hazelcast-default.xml中 io.vertx.core.Launcher com.msg .verticles.RootVerticle 資源/

  3. 創建以股代息噸文件來觸發發射

    Java的罐子-Xmx2048m -Xms512m消息-1.0-SNAPSHOT.jar -ha -D配置=資源/ config.json

啓動器未能對拾取hazelcast默認。res來自resurce文件夾,並停止以下例外。不知道我在這裏錯過了什麼。

$> Java的罐子-Xmx2048m -Xms512m消息-1.0-SNAPSHOT.jar-HA-D配置=資源/ config.json

Jul 16, 2017 7:20:26 PM io.vertx.core.impl.launcher.commands.RunCommand 
INFO: Starting clustering... 
Jul 16, 2017 7:20:27 PM io.vertx.core.impl.launcher.commands.RunCommand 
INFO: No cluster-host specified so using address 127.0.0.1 
Jul 16, 2017 7:20:28 PM io.vertx.spi.cluster.hazelcast.HazelcastClusterManager 
WARNING: Cannot find cluster configuration on 'vertx.hazelcast.config' system property, on the classpath, or specified programmatically. Using default hazelcast configuration 
Jul 16, 2017 7:20:28 PM com.hazelcast.config.XmlConfigLocator 
INFO: Loading 'hazelcast-default.xml' from classpath. 
Jul 16, 2017 7:20:28 PM com.hazelcast.config.AbstractXmlConfigHelper 
WARNING: Name of the hazelcast schema location incorrect using default 
Jul 16, 2017 7:20:28 PM io.vertx.core.impl.VertxImpl 
SEVERE: Failed to join cluster 
com.hazelcast.core.HazelcastException: org.xml.sax.SAXParseException; schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. 
     at com.hazelcast.util.ExceptionUtil.peel(ExceptionUtil.java:73) 
+0

@Rao - 你設法解決上述問題,因爲我遇到了類似的問題:( –

回答

0

按照documentation of Hazelcast cluster manager你需要指定你的Hazelcast配置一個名爲cluster.xml的文件(或者嵌入到你的fatjar的根目錄或者你的類路徑中的一個目錄中)。

+0

事件則hazelcast庫未能解析XML –

+0

@NageswaraRao你可以發表你的Hazelcast配置XML驗證 –

+0

?看起來,您忘記在您的cluster.xml中指定架構 – Nolequen