前言
真是后知后觉,最近忙也要学习,把以前丢的都要拾起来。原理懂不懂也把环境搭起来学习。
环境
centos7
jdk 1.8
zookeeper 3.4.13
storm 1.2.2
安装
1.zookeeper安装
我装了三台虚拟机,配置如下:
jdk配置
vi /etc/profile
#java config export JAVA_HOME=/opt/jdk/jdk1.8.0_201 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
设置静态ip
vi /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens33 UUID=07864689-6643-454f-9172-d09dfde88267 DEVICE=ens33 ONBOOT=yes IPADDR=192.168.5.201/202/203 GATEWAY=192.168.5.1 DNS1=114.114.114.114 DNS2=8.8.8.8
设置hosts,方便使用
vi /etc/hosts 192.168.5.201 centos01 192.168.5.202 centos02 192.168.5.203 centos03
机器配置好了,我们开始安装zookeeper
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 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/opt/zookeeper/data # the port at which the clients will connect clientPort=2181 # 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 server.0=centos01:2888:3888 server.1=centos02:2888:3888 server.2=centos03:2888:3888
vi /etc/profile # zookeeper export ZK_HOME=/opt/zookeeper/zookeeper-3.4.13 export PATH=$ZK_HOME/bin:$PATH
2.storm安装
nimbus上的配置
########### These MUST be filled in for a storm configuration storm.zookeeper.servers: - "centos01" - "centos02" - "centos03" # # nimbus.seeds: ["host1", "host2", "host3"] # # # ##### These may optionally be filled in: storm.local.dir: "/usr/data/storm" supervisor.slots.ports: - 6700 - 6701 - 6702 nimbus.host: "centos01" ## 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: - "centos01" # - "server2" worker.childopts: "-Xmx2048m"
supervisor上的配置
########### These MUST be filled in for a storm configuration storm.zookeeper.servers: - "centos01" - "centos02" - "centos03" # # nimbus.seeds: ["host1", "host2", "host3"] # # # ##### These may optionally be filled in: storm.local.dir: "/usr/data/storm" supervisor.slots.ports: - 6700 - 6701 - 6702 nimbus.host: "centos01" ## 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: - "centos01" # - "server2" worker.childopts: "-Xmx2048m" ## Metrics Consumers ## max.retain.metric.tuples ## whitelist / blacklist ## - you can specify multiple whitelist / blacklist with regular expression ## expandMapType: expand metric with map type as value to multiple metrics ## - set to true when you would like to apply filter to expanded metrics ## - default value is false which is backward compatible value ## - only effective when expandMapType is set to true # topology.metrics.consumer.register: - "centos02" - "centos03" # # nimbus.seeds: ["host1", "host2", "host3"] # # # ##### These may optionally be filled in: storm.local.dir: "/usr/data/storm" supervisor.slots.ports: - 6700 - 6701 - 6702 nimbus.host: "centos01" ## 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: - "centos01" # - "server2" worker.childopts: "-Xmx2048m"
vi /etc/profile # storm export STORM_HOME=/opt/apache-storm-1.2.2 export PATH=${STORM_HOME}/bin:$PATH
配置好后,我们开始启动吧!
先启动zookeeper
zkServer.sh start [root@centos03 bin]# zkServer.sh status ZooKeeper JMX enabled by default Using config: /opt/zookeeper/zookeeper-3.4.13/bin/../conf/zoo.cfg Mode: leader
再启动storm
nimbus上启动 ./storm nimbus >> /dev/null & storm drpc >> /dev/null & storm ui >> /dev/null & supervisor上启动 storm supervisor >> /dev/null &
在我实体电脑*问http://192.168.5.201:8080时找不到网页,是防火墙的事
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
好了!