MACHINE:
192.168.180.101
192.168.187.16
The software to be prepared includes:
Zookeeper(zookeeper-3.4.4.tar.gz.pdf, storm(storm-0.8.1.zip), jdk
1. Configure zookeeper
Decompress zookeeper and rename zoo_sample.cfg under the conf directory to: zoo. cfg
The modified content is as follows:
# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=/data/zookeeper/datadataLogDir=/data/zookeeper/log# the port at which the clients will connectclientPort=2181## 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=1server.1=192.168.187.16:2888:3888server.2=192.168.180.101:2888:3888
For specific configuration, see:
Http://zookeeper.apache.org/doc/current/zookeeperAdmin.html# SC _configuration
Note the configuration of the last two rows:
Format: server. id = host: port
The id can only be 1-255 digits. At the same time, you must create a file named myid under the dataDir directory with only one line of content: "id"
Every machine that is part of the ZooKeeper ensemble shoshould know about every other machine in the ensemble. You accomplish this with the series of lines of the formServer. id = host: port. The parametersHostAndPortAre straightforward. You attribute the server id to each machine by creating a file named myid, one for each server, which resides in that server's data directory, as specified by the configuration file parameterDataDir.
Then you need to add the environment variable:
Export ZOOKEEPER_HOME =/home/zhxia/apps/db/zookeeper
The environment configurations on the two machines are the same, but the IDs in the myid file are different.
2. Configure storm
Decompress storm
Go to the conf directory and edit the storm. yaml file.
########## These MUST be filled in for a storm configuration storm.zookeeper.servers: - "192.168.187.16" - "192.168.180.101" nimbus.host: "192.168.187.16" storm.local.dir: "/data/storm/data" ##### 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: # - "127.0.0.1" #- "server2"## to nimbus #nimbus.childopts: "-Xmx1024m" ### to supervisor #supervisor.childopts: "-Xmx1024m" ### to worker #worker.childopts: "-Xmx768m"
After the configuration is complete, start zookeeper and storm
Start zookeeper
Bin/zkServer. sh start
Start storm
Bin/storm nimbus
Bin/storm supervisor
Bin/storm ui
Open the browser: http: // localhost: 8080 to check the running status of the cluster.