一、确定安装storm版本,这里默认安装storm2.1.0
二、搭建storm集群步骤开始(Here's a summary of the steps for setting up a Storm cluster:)
-
安装一个Zookeeper集群(一般3台足够)(Set up a Zookeeper cluster)
(问题:单机需要装Zookeeper么)Zookeeper需要加入监控(It’s critical that you run Zookeeper under supervision, since Zookeeper is fail-fast and will exit the process if it encounters any error case. See here for more details.)
Zookeeper需要安装压缩Zookeeper数据和日志(It’s critical that you set up a cron to compact Zookeeper’s data and transaction logs. The Zookeeper daemon does not do this on its own, and if you don’t set up a cron, Zookeeper will quickly run out of disk space. See here for more details.)
-
安装依赖包(Install dependencies on Nimbus and worker machines)
Java 8+ (Apache Storm 2.x is tested through travisci against a java 8 JDK)
Python 2.6.6 (Python 3.x should work too,but is not tested as part of our CI enviornment) -
下载解压strom的release包 (_Download and extract a Storm release to Nimbus
and worker machines _)wget http://mirror.bit.edu.cn/apache/storm/apache-storm-2.1.0/apache-storm-2.1.0.tar.gz
-
填写相应的配置 (Fill in mandatory configurations into storm.yaml)
1) 设置storm依赖的zk集群storm.zookeeper.servers: - "111.222.333.444" - "555.666.777.888"
2)设置storm.local.dir(The Nimbus and Supervisor daemons require a directory on the local disk to store small amounts of state (like jars, confs, and things like that). You should create that directory on each machine, give it proper permissions, and then fill in the directory location using this config.)
For example:storm.local.dir: "/mnt/storm"
3)设置主备nimbus机子(_nimbus.seeds: The worker nodes need to know which machines are the candidate of master in order to download topology jars and confs. _)
For example:nimbus.seeds: ["111.222.333.44"]
4)设置supervisor的slots端口(supervisor.slots.ports: For each worker machine, you configure how many workers run on that machine with this config. Each worker uses a single port for receiving messages, and this setting defines which ports are open for use. If you define five ports here, then Storm will allocate up to five workers to run on this machine. If you define three ports, Storm will only run up to three. By default, this setting is configured to run 4 workers on the ports 6700, 6701, 6702, and 6703.)
For example:supervisor.slots.ports: - 6700 - 6701 - 6702 - 6703
⚠️如果Zookeeeper集群使用的端口跟默认的不同,那么需要设置storm.zookeeper.port
(If the port that your Zookeeper cluster uses is different than the default, you should set storm.zookeeper.port as well.) -
运行daemons监控 (Launch daemons under supervision using"storm" script and a supervisor of your choice)
-
安装DRPC服务器(可选)Setup DRPC servers (Optional)
三、启动Storm进程
1、启动Nimbus。Run the command bin/storm nimbus under supervision on the master machine.
bin/storm nimubs &
2、启动Supervisor: Run the command bin/storm supervisor under supervision on each worker machine. The supervisor daemon is responsible for starting and stopping worker processes on that machine.
bin/storm supervisor &
3、启动UI: Run the Storm UI (a site you can access from the browser that gives diagnostics on the cluster and topologies) by running the command “bin/storm ui” under supervision. The UI can be accessed by navigating your web browser to http://{ui host}:8080.
bin/storm ui &
4、UI界面如下
四、查看log
log日志在storm包的logs文件夹中
来源:CSDN
作者:sonia_liss
链接:https://blog.csdn.net/sonia_liss/article/details/103524073