您好,登錄后才能下訂單哦!
這篇文章主要講解了“Storm0.9.4的安裝步驟”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“Storm0.9.4的安裝步驟”吧!
環境:三臺虛擬機,系統是CentOS6.5
1.關閉防火墻,配置hosts,添加集群中主機和IP的映射關系
[grid@hadoop4 ~]$ cat /etc/hosts 127.0.0.1 localhost ::1 localhost 192.168.0.106 hadoop4 192.168.0.107 hadoop5 192.168.0.108 hadoop6
2.安裝Java(JDK6或以上版本),配置JAVA_HOME 、CLASSPATH環境變量
[grid@hadoop4 ~]$ cat .bash_profile JAVA_HOME=/usr/java/jdk1.7.0_72 JRE_HOME=$JAVA_HOME/jre PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib export JAVA_HOME JRE_HOME PATH CLASSPATH
3.安裝python
先確定你系統自帶的Python版本,如果是2.6.6或者以上的不需要安裝
[grid@hadoop4 ~]$ python Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
4.搭建Zookeeper集群
##下載解壓## [grid@hadoop4 ~]$ wget http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz [grid@hadoop4 ~]$ tar -zxf zookeeper-3.4.6.tar.gz ##修改配置文件## [grid@hadoop4 ~]$ cd zookeeper-3.4.6/conf/ [grid@hadoop4 conf]$ cp -p zoo_sample.cfg zoo.cfg [grid@hadoop4 conf]$ vi zoo.cfg # The number of milliseconds of each tick tickTime=2000 ##服務器心跳時間,單位毫秒 # The number of ticks that the initial # synchronization phase can take initLimit=10 ##投票選擇新leader的初始化時間 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 ##leader與follower心跳檢測最大容忍時間,響應超過syncLimit*tickTime,leader認為follwer死掉,從服務器列表中刪除follwer # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/home/grid/zookeeper-3.4.6/data ##數據目錄,需要手動創建 # dataLogDir= ##日志目錄,不指定將使用和dataDir相同的設置 # the port at which the clients will connect clientPort=2181 ##監聽client連接的端口 ##server.id=host:port:port,id是一個數字,表示這是第幾號server,這個id也會被寫到myid文件中;host是zookeeper服務器ip或主機名;第一個port是leader與follwer通訊所使用的端口;第二個port是選舉leader時所使用的端口 server.1=hadoop4:2888:3888 server.2=hadoop5:2888:3888 server.3=hadoop6:2888:3888 # the maximum number of client connections. # increase this if you need to handle more clients #maxClientCnxns=60 # # Be sure to read the maintenance section of the # administrator guide before turning on autopurge. # # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance # # The number of snapshots to retain in dataDir #autopurge.snapRetainCount=3 # Purge task interval in hours # Set to "0" to disable auto purge feature #autopurge.purgeInterval=1 ##手動創建數據目錄## [grid@hadoop4 conf]$ cd /home/grid/zookeeper-3.4.6 [grid@hadoop4 zookeeper-3.4.6]$ mkdir data ##分發zookeeper## [grid@hadoop4 zookeeper-3.4.6]$ cd .. [grid@hadoop4 ~]$ scp -rp zookeeper-3.4.6 grid@hadoop5:/home/grid/ [grid@hadoop4 ~]$ scp -rp zookeeper-3.4.6 grid@hadoop6:/home/grid/ ##在數據目錄下創建myid文件,寫入id號,用來標識當前主機## [grid@hadoop4 ~]$ echo "1" > zookeeper-3.4.6/data/myid [grid@hadoop5 ~]$ echo "2" > zookeeper-3.4.6/data/myid [grid@hadoop6 ~]$ echo "3" > zookeeper-3.4.6/data/myid ##啟動zookeeper## [grid@hadoop4 ~]$ zookeeper-3.4.6/bin/zkServer.sh start [grid@hadoop5 ~]$ zookeeper-3.4.6/bin/zkServer.sh start [grid@hadoop6 ~]$ zookeeper-3.4.6/bin/zkServer.sh start ##查看zookeeper狀態## [grid@hadoop4 ~]$ zookeeper-3.4.6/bin/zkServer.sh status JMX enabled by default Using config: /home/grid/zookeeper-3.4.6/bin/../conf/zoo.cfg Mode: follower [grid@hadoop5 ~]$ zookeeper-3.4.6/bin/zkServer.sh status JMX enabled by default Using config: /home/grid/zookeeper-3.4.6/bin/../conf/zoo.cfg Mode: leader [grid@hadoop6 ~]$ zookeeper-3.4.6/bin/zkServer.sh status JMX enabled by default Using config: /home/grid/zookeeper-3.4.6/bin/../conf/zoo.cfg Mode: follower
5.安裝Storm
##下載解壓## [grid@hadoop4 ~]$ wget http://mirrors.cnnic.cn/apache/storm/apache-storm-0.9.4/apache-storm-0.9.4.tar.gz [grid@hadoop4 ~]$ tar -zxf apache-storm-0.9.4.tar.gz [grid@hadoop4 ~]$ mv apache-storm-0.9.4 storm-0.9.4 ##修改配置項## [grid@hadoop4 conf]$ vim storm.yaml # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ########### These MUST be filled in for a storm configuration ##集群使用的Zookeeper集群地址 storm.zookeeper.servers: - "hadoop4" - "hadoop5" - "hadoop6" storm.zookeeper.port: 2181 # ##集群的Nimbus機器的地址 nimbus.host: "hadoop4" ##Nimbus和Supervisor迚程用于存儲少量狀態,如jars、 confs等的本地磁盤目錄,需要提前創建該目錄并給以足夠的訪問權限 storm.local.dir: "/home/grid/storm-0.9.4/data" ##對于每個Supervisor工作節點,需要配置該工作節點可以運行的worker數量。每個worker占用一個單獨的端口用于接收消息,該配置選項即用于定義哪些端口是可被worker使用。默認情況下,每個節點上可運行4個workers,分別在6700、 6701、 6702和6703端口上。 supervisor.slots.ports: - 6700 - 6701 - 6702 - 6703 # # # ##### 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" ## Metrics Consumers # topology.metrics.consumer.register: # - class: "backtype.storm.metric.LoggingMetricsConsumer" # parallelism.hint: 1 # - class: "org.mycompany.MyMetricsConsumer" # parallelism.hint: 1 # argument: # - endpoint: "metrics-collector.mycompany.org" ## 有關的其他配置項可以參看:https://github.com/nathanmarz/storm/blob/master/conf/defaults.yaml ## ##創建數據目錄## [grid@hadoop4 conf]$ cd /home/grid/storm-0.9.4/ [grid@hadoop4 storm-0.9.4]$ mkdir data ##分發Storm## [grid@hadoop4 ~]$ scp -rp storm-0.9.4/ grid@hadoop5:/home/grid/ [grid@hadoop4 ~]$ scp -rp storm-0.9.4/ grid@hadoop6:/home/grid/ ##編輯環境變量## [grid@hadoop4 ~]$ vim .bash_profile export STORM_HOME=/home/grid/storm-0.9.4 export PATH=$PATH:$STORM_HOME/bin [grid@hadoop4 ~]$ source .bash_profile ##啟動Storm(確保zookeeper已經啟動)## [grid@hadoop4 ~]$ storm nimbus & ##在主節點上運行Nimbus后臺程序 [grid@hadoop5 ~]$ storm supervisor & ##在工作節點上運行Supervisor后臺程序 [grid@hadoop6 ~]$ storm supervisor & [grid@hadoop4 ~]$ storm ui & ##在主節點上運行UI程序,啟動后可以在瀏覽器上輸入http://主節點的ip:port (默認8080端口) [grid@hadoop4 ~]$ storm logviewer & ##在主節點上運行LogViewer程序,啟動后在UI上通過點擊相應的Woker來查看對應的工作日志 [grid@hadoop4 ~]$ jps 2959 QuorumPeerMain 3310 logviewer 3414 Jps 3228 nimbus 3289 core [grid@hadoop5 ~]$ jps 2907 QuorumPeerMain 3215 Jps 3154 supervisor [grid@hadoop6 ~]$ jps 3248 Jps 2935 QuorumPeerMain 3186 supervisor
感謝各位的閱讀,以上就是“Storm0.9.4的安裝步驟”的內容了,經過本文的學習后,相信大家對Storm0.9.4的安裝步驟這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。