CentOS 安装 Storm 集群

2018/8/31 源自  CentOS

wget http://download.zeromq.org/zeromq-2.1.7.tar.gz
wget ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.21/util-linux-2.21.1.tar.gz
wget http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz

tar zxvf util-linux-2.21.1.tar.gz
cd util-linux-2.21.1
./configure --without-ncurses
make && make install
cd ..
tar zxvf zeromq-2.1.7.tar.gz
cd zeromq-2.1.7
./configure -prefix=/usr/local/
make && make install
cd ..
git clone https://github.com/nathanmarz/jzmq.git
cd jzmq/
./autogen.sh
./configure
make && make install
cd ..
tar zxvf Python-2.6.6.tgz
cd Python-2.6.6
./configure
make && make install
python -V
cd ..
yum -y install unzip
unzip storm-0.8.2.zip

conf/storm.yaml配置文件如下:

########### These MUST be filled in for a storm configuration
storm.zookeeper.servers:
    - "10.132.19.253"
    - "10.132.49.128"
    - "10.160.30.188"

storm.local.dir: "/opt/app/storm"
nimbus.host: "10.132.19.253"
supervisor.slots.ports:
    - 6700
    - 6701
    - 6702
    - 6703
worker.childopts: "-Xmx2048m"
# ##### These may optionally be filled in:
#   
## List of custom serializations
# topology.kryo.register:
#     - org.mycompany.MyType
#     - org.mycompany.MyType2: org.mycompany.MyType2Serializer
#
## List of custom kryo decorators
# topology.kryo.decorators:
#     - org.mycompany.MyDecorator
#
## Locations of the drpc servers
# drpc.servers:
#     - "server1"
#     - "server2"

环境变量:
export PATH=\(JAVA_HOME/bin:\)JAVA_HOME/jre/bin:/opt/app/storm/bin:$PATH
export PATH

如果更改了storm.yaml文件,重启nimbus即可

Nimbus: 在Storm主控节点上启动Nimbus
storm nimbus >/dev/null 2>&1 &
UI: 在Storm主控节点上启动UI后台程序
storm ui >/dev/null 2>&1 &
启动后可以通过UI观察集群的worker资源使用情况、Topologies的运行状态等信息。
Supervisor: 在Storm各个工作节点上启动Supervisor
storm supervisor >/dev/null 2>&1 &
http://10.132.19.253:8080

host需要在/etc/hosts指定名称,不然会显示localhost,格式如下
127.0.0.1 mq-1 localhost
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.132.19.253 mq-1
10.132.49.128 mq-2
10.160.30.188 mq-3