教程:http://ifeve.com/getting-started-with-stom-index/
安裝:http://shiyanjun.cn/archives/934.htmlhtml
1:機器分配
系統:centos 6.5
nimbus 節點:192.168.136.129
supervisor 節點:192.168.136.130/131
軟件分配置:zookeeper 、zeromq 、jzmq 、依賴包:12九、130、131
storm-nimbus:129
storm-supervisor:130、131
準備工做:
修改別名:vim /etc/hosts
192.168.136.129 hadoop1
192.168.136.130 hadoop2
192.168.136.131 hadoop3
修改主機名(每臺機器各不一樣):vim /etc/sysconfig/network
HOSTNAME=hadoop1
關閉iptables和SELinux(查看selinux狀態:/usr/sbin/sestatus -v )
service iptables stop && chkconfig iptables off
setenforce 0
vim /etc/selinux/config
SELINUX=disabled
禁用ipv6(重啓後ifconfig | grep -i inet6 無輸出便可)
vim /etc/sysconfig/network
NETWORKING_IPV6=no
vim /etc/hosts
註釋:::1 localhost localhost6 localhost6.localdomain6
vim /etc/modprobe.d/dist.conf
增長:alias net-pf-10 off
alias ipv6 off
打通ssh
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
hadoop1上執行:scp ~/.ssh/authorized_keys root@hadoop2:~/.ssh/
scp ~/.ssh/authorized_keys root@hadoop3:~/.ssh/
2:安裝
1):下載:http://storm.apache.org/downloads.html
wget http://apache.fayea.com/storm/apache-storm-0.10.0/apache-storm-0.10.0.tar.gz
wget http://apache.fayea.com/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz
wget http://download.zeromq.org/zeromq-2.1.7.tar.gz
安裝依賴:yum install gcc-c++ -y
yum install libtool -y
yum install libuuid-devel.x86_64 -y
2):安裝zookeeper
tar -zxvf zookeeper-3.3.6.tar.gz && cd zookeeper-3.3.6/conf
建立 vim zoo.cfg
tickTime=2000
dataDir=/var/zookeeper
clientPort=2181
initLimit=10
syncLimit=5
server.1=hadoop1:2887:3887
server.2=hadoop2:2887:3887
server.3=hadoop3:2887:3887linux
dataDir 是zookeeper用來存放文件的目錄,保證用戶有讀寫權限:mkdir /var/zookeeper && chmod 755 /var/zookeeper 啓動:./zkServer.sh start
驗證:echo ruok|nc localhost 2181 返回imok即成功
問題:
報:/var/zookeeper/myid file is missing
解決:第臺機器上執行: echo 1 > /var/zookeeper/myid (每臺機器數字不一樣)
問題:IllegalArgumentException: serverid is not a number
myid 爲數字,而且要與zoo.cfg中的server.n對應c++
3):安裝zeromq
tar -zxvf zeromq-2.1.7.tar.gz && cd zeromq-2.1.7
./configure
make
make install
4):安裝jzmq
yum -y install git
git config --global user.name author #將用戶名設爲author
git config --global user.email author@corpmail.com #將用戶郵箱設爲author@corpmail.com
git clone https://github.com/nathanmarz/jzmq.git && cd jzmq
./autogen.sh
./configure
make
make install
5):安裝storm
tar -zxvf apache-storm-0.10.0.tar.gz && cd apache-storm-0.10.0
編輯: vim conf/storm.yaml(主機只用配置zookeeper,supervisor需要所有配置)
hadoop1上配置
storm.zookeeper.servers:
- "hadoop1"
- "hadoop2"
- "hadoop3"
ui.port: 8082
hadoop2/3上配置
storm.zookeeper.servers:
- "hadoop1"
- "hadoop2"
- "hadoop3"
nimbus.host: "hadoop1"
storm.local.dir: "/root/storm/workdir"
supervisor.slots.ports:
- 6700
- 6701
- 6702
storm.zookeeper.servers:zookeeper地址,可有多個
nimbus.host:jobtrank地址 supervisor.slots. ports:tasktrank上可運行的work所佔用的端口,可有多個
ui.port:重定向ui的端口git
mkdir -p /root/storm/workdir && chmod 755 /root/storm/workdir
6):啓動
啓動nimbus(啓一個) : bin/storm nimbus >/dev/null 2>&1 &
啓動supervisor(在每一個tasktrank上運行): bin/storm supervisor >/dev/null 2>&1 &
啓動ui: bin/storm ui >/dev/null 2>&1 & github
啓動後可在ie中查看狀態:http://192.168.136.129:8082/index.html
7):測試
http://isuifengfei.iteye.com/blog/1998269apache