2015-10-14 53 views
0

我已經設置了單個節點集羣並嘗試將示例拓撲部署到它。構建用於將jar部署到遠程集羣的胖jar時發生錯誤集羣

我相信將我的拓撲部署到集羣我必須將具有所有依賴關係的jar提交到集羣。

爲此,我創建了一個示例項目併爲其添加了一個簡單的拓撲。

在使用gradle這個生成脂肪的罐子我看到這個錯誤

gradle這個fatjar,給出以下錯誤

Could not expand ZIP '/Users/agarg/.gradle/caches/modules-2/files- 
2.1/org.apache.storm/storm- 
core/0.9.5/d2bf27db853347dcf66990b4514db20a7897303e/storm-core-0.9.5.jar'. 

Could not copy zip entry /Users/agarg/.gradle/caches/modules-2/files- 
2.1/org.apache.storm/storm- 
core/0.9.5/d2bf27db853347dcf66990b4514db20a7897303e/storm-core- 
0.9.5.jar!META-INF/license/LICENSE.base64.txt to '/Users/agarg/Documents/notificationRepo/sample/build/tmp/expandedArchives/storm- 
core-0.9.5.jar_366us3312tpl54tci2fld83fij/META-INF/license/LICENSE.base64.txt'. 

這裏是我的build.gradle文件F0參考:

dependencies { 
    compile group: 'clj-stacktrace' , name: 'clj-stacktrace',version: cljStackTrace 
    compile group: 'org.apache.storm' , name: 'storm-core',version: stormVersion 
} 

task fatJar(type: Jar) { 
manifest { 
    attributes 'Implementation-Title': 'Gradle Jar File Example', 
     'Implementation-Version': version, 
     'Main-Class': 'storm.topology.ExclamationTopology' 
} 
baseName = project.name + '-all' 
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }  } 
with jar 

}

buildscript { 
repositories { 
mavenCentral() 
maven { url 'http://repo.spring.io/snapshot' } 
maven { url 'http://repo.spring.io/milestone' } 
maven { url "https://clojars.org/repo/" } 
maven { url "http://repo.maven.apache.org/maven2" } 

} }

nyone能幫助我什麼地方出錯嗎?

在此先感謝

回答

0

我不熟悉的gradle產出,但是,你並不需要包括「風暴核心」或傳遞依賴於你的脂肪罐子。如果你的遠程jar包含Spout和Bolt類(也許你使用的一些第三方庫不是Storm的一部分),這就足夠了。

+0

感謝Matthias。我設法找到了解決辦法。現在,我可以將我的拓撲提交到遠程集羣。但是由於這種原因,拓撲還沒有開始: java.lang.RuntimeException:找到多個defaults.yaml資源。您可能會將Storm Jars與拓撲jar捆綁在一起。 你有沒有想法如何解決這個問題。我的猜測是我將不得不停止發送其中有default.yml文件的罐子,類似於你在這裏提到的 –

+0

是的。該jar不能包含'defaults.yaml'文件。您應該刪除/排除構建胖罐的風暴依賴關係。 –