Update Storm编程模型详解.md

This commit is contained in:
heibaiying 2019-04-16 17:18:41 +08:00 committed by GitHub
parent 8a35586f38
commit bf566a48a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -389,7 +389,7 @@ public class LocalWordCountApp {
## 六、提交到服务器集群运行
#### 6.1 代码更改
### 6.1 代码更改
提交到服务器的代码和本地代码略有不同,提交到服务器集群时需要使用`StormSubmitter`进行提交。主要代码如下。
@ -420,7 +420,7 @@ public class ClusterWordCountApp {
}
```
#### 6.2 打包上传
### 6.2 打包上传
打包后上传到服务器任意位置,这里我打包后的名称为`storm-word-count-1.0.jar`
@ -428,7 +428,7 @@ public class ClusterWordCountApp {
# mvn clean package -Dmaven.test.skip=true
```
#### 6.3 提交Topology
### 6.3 提交Topology
使用以下命令提交Topology到集群
@ -441,7 +441,7 @@ storm jar /usr/appjar/storm-word-count-1.0.jar com.heibaiying.wordcount.Cluster
<div align="center"> <img src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/storm-submit-success.png"/> </div>
#### 6.4 查看Topology与停止Topology命令行方式
### 6.4 查看Topology与停止Topology命令行方式
```shell
# 查看所有Topology
@ -453,7 +453,7 @@ storm kill ClusterWordCountApp -w 3
<div align="center"> <img src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/storm-list-kill.png"/> </div>
#### 6.5 查看Topology与停止Topology界面方式
### 6.5 查看Topology与停止Topology界面方式
使用UI界面同样也可进行同样的操作进入WEB UI界面8080端口`Topology Summary`中点击对应Topology 即可进入详情页面进行操作。
@ -469,7 +469,7 @@ storm kill ClusterWordCountApp -w 3
## 七、通用打包方法
#### 1. mvn package的局限性
### 1. mvn package的局限性
上面我们直接使用`mvn package`进行项目打包这对于没有使用外部依赖包的项目是可行的。但如果项目中使用了第三方JAR包就会出现问题因为`package`打包后的JAR中是不含有依赖包的如果此时你提交到服务器上运行就会出现找不到第三方依赖的异常。
@ -508,7 +508,7 @@ private String productData() {
#### 2. 官方推荐的的打包方法
### 2. 官方推荐的的打包方法
>If you're using Maven, the [Maven Assembly Plugin](http://maven.apache.org/plugins/maven-assembly-plugin/) can do the packaging for you. Just add this to your pom.xml:
>
@ -602,4 +602,4 @@ private String productData() {
## 参考资料
1. [Running Topologies on a Production Cluster](http://storm.apache.org/releases/2.0.0-SNAPSHOT/Running-topologies-on-a-production-cluster.html)
2. [Pre-defined Descriptor Files](http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html)
2. [Pre-defined Descriptor Files](http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html)