From df4c084334c93000ecaf5c409732512cb01ba630 Mon Sep 17 00:00:00 2001 From: heibaiying <31504331+heibaiying@users.noreply.github.com> Date: Sat, 20 Apr 2019 12:44:04 +0800 Subject: [PATCH] =?UTF-8?q?Update=20Storm=E4=B8=89=E7=A7=8D=E6=89=93?= =?UTF-8?q?=E5=8C=85=E6=96=B9=E5=BC=8F=E5=AF=B9=E6=AF=94=E5=88=86=E6=9E=90?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes/Storm三种打包方式对比分析.md | 22 ++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/notes/Storm三种打包方式对比分析.md b/notes/Storm三种打包方式对比分析.md index 05a20a9..3d2d4e1 100644 --- a/notes/Storm三种打包方式对比分析.md +++ b/notes/Storm三种打包方式对比分析.md @@ -43,7 +43,12 @@ 以下是包含上面三种情况的一个样例命令: ```shell -./bin/storm jar example/storm-starter/storm-starter-topologies-*.jar org.apache.storm.starter.RollingTopWords blobstore-remote2 remote --jars "./external/storm-redis/storm-redis-1.1.0.jar,./external/storm-kafka/storm-kafka-1.1.0.jar" --artifacts "redis.clients:jedis:2.9.0,org.apache.kafka:kafka_2.10:0.8.2.2^org.slf4j:slf4j-log4j12" --artifactRepositories "jboss-repository^http://repository.jboss.com/maven2,HDPRepo^http://repo.hortonworks.com/content/groups/public/" +./bin/storm jar example/storm-starter/storm-starter-topologies-*.jar \ +org.apache.storm.starter.RollingTopWords blobstore-remote2 remote \ +--jars "./external/storm-redis/storm-redis-1.1.0.jar,./external/storm-kafka/storm-kafka-1.1.0.jar" \ +--artifacts "redis.clients:jedis:2.9.0,org.apache.kafka:kafka_2.10:0.8.2.2^org.slf4j:slf4j-log4j12" \ +--artifactRepositories "jboss-repository^http://repository.jboss.com/maven2, \ +HDPRepo^http://repo.hortonworks.com/content/groups/public/" ``` @@ -92,7 +97,8 @@ maven-assembly-plugin的使用非常简单,只需要在POM.xml中引入即可 ```xml + xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 + http://maven.apache.org/xsd/assembly-2.0.0.xsd"> jar-with-dependencies @@ -150,7 +156,8 @@ assembly.xml文件内容如下: ```xml + xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 + http://maven.apache.org/xsd/assembly-2.0.0.xsd"> jar-with-dependencies @@ -259,9 +266,9 @@ RuntimeException异常。 + implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> @@ -308,7 +315,10 @@ RuntimeException异常。 如果你不排除storm-core,通常会抛出下面的异常: ```properties -Caused by: java.lang.RuntimeException: java.io.IOException: Found multiple defaults.yaml resources. You're probably bundling the Storm jars with your topology jar. [jar:file:/usr/app/apache-storm-1.2.2/lib/storm-core-1.2.2.jar!/defaults.yaml, jar:file:/usr/appjar/storm-hdfs-integration-1.0.jar!/defaults.yaml] +Caused by: java.lang.RuntimeException: java.io.IOException: Found multiple defaults.yaml resources. +You're probably bundling the Storm jars with your topology jar. +[jar:file:/usr/app/apache-storm-1.2.2/lib/storm-core-1.2.2.jar!/defaults.yaml, +jar:file:/usr/appjar/storm-hdfs-integration-1.0.jar!/defaults.yaml] at org.apache.storm.utils.Utils.findAndReadConfigFile(Utils.java:384) at org.apache.storm.utils.Utils.readDefaultConfig(Utils.java:428) at org.apache.storm.utils.Utils.readStormConfig(Utils.java:464)