准备工作
1) 安装java和python(略)
2) 安装zookeeper
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| 略
$ vi zookeeper-3.4.6/conf/zoo.cfg
clientPort=2181
dataDir=/xxx/zookeeper-3.4.6/zkdata
dataLogDir=/xxx/zookeeper-3.4.6/logs
tickTime=2000
maxClientCnxns=60
minSessionTimeout=2*2000 maxSessionTimeout=20*2000
autopurge.purgeInterval=1
autopurge.snapRetainCount=3
initLimit=10
syncLimit=5
server.1=nimbusz:2888:3888 server.2=supervisor01z:2888:3888 server.3=supervisor02z:2888:3888
export ZOO_LOG_DIR=/home/Hadoop/local/logs/zookeeper
dataDir=/data/zookeeper/data dataLogDir=/data/zookeeper/logs
root@nimbusz:~$ echo “1” > ${dataDir}/myid root@supervisor01z:~$ echo “2” > ${dataDir}/myid root@supervisor02z:~$ echo “3” > ${dataDir}/myid
$ zkServer.sh start 或者 zkServer.sh start-foreground $ zkServer.sh status $ zkServer.sh stop
bin/zkCli.sh bin/zkCli.sh -server 172.16.127.129:2181 bin/zkCli.sh -timeout 5000 -r -server 172.16.127.129:2181
|
安装和配置storm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| $ wget http://mirrors.tuna.tsinghua.edu.cn/apache/storm/apache-storm-1.2.2/apache-storm-1.2.2.tar.gz $ tar -zxvf apache-storm-1.2.2.tar.gz -C xxx $ vi /etc/profile ... JAVA_HOME=xxx ZOOKEEPER_HOME=xxx STORM_HOME=xxx PATH=$PATH:$JAVA_HOME/bin:$ZOOKEEPER_HOME/bin:$STORM_HOME/bin ... $ source profile
storm.zookeeper.servers: - "cdh03" - "cdh04" - "cdh05"
storm.local.dir: "/root/zql/storm/localdir"
nimbus.seeds: ["cdh03", "cdh04", "cdh05"]
supervisor.slots.ports: - 6700 - 6701 - 6702 - 6703
drpc.servers: - "server1" - "server2"
scp -r apache-storm-1.2.2/ root@cdh04:/root/zql/storm scp -r apache-storm-1.2.2/ root@cdh05:/root/zql/storm
root@nimbusz: nohup storm nimbus > /dev/null 2>&1 & root@nimbusz: nohup storm ui > /dev/null 2>&1 & root@supervior01: nohup storm supervisor > /dev/null 2>&1 & root@supervior02: nohup storm supervisor > /dev/null 2>&1 &
$ nohup storm logviewer >/dev/null 2>&1 &
|