前言html
真是後知後覺,最近忙也要學習,把之前丟的都要拾起來。原理懂不懂也把環境搭起來學習。java
環境 express
centos7apache
jdk 1.8centos
zookeeper 3.4.13app
storm 1.2.2tcp
安裝ide
1.zookeeper安裝學習
我裝了三臺虛擬機,配置以下:ui
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
好了!