Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed installation tutorial for storm

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the "detailed installation tutorial of storm" related knowledge, in the actual case operation process, many people will encounter such a dilemma, and then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!

This article demonstrates installing a stand-alone storm system and running the built-in sample program. There are four steps:

Install the Java environment

Install Zookeeper

Install Storm (stand-alone)

Run Storm instance-WordCount

Install the Java environment

[root@localhost strom] # yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel

Env does not have a JAVA_HOME variable, so configure it yourself. Look for the jdk installation directory.

[root@localhost strom] # find /-name java-1.7.0-openjdk/usr/lib/jvm/java-1.7.0-openjdk

Edit .bashrc in the / root directory

[root@localhost ~] # vi .bashrc # .bashrc # Source global definitionsif [- f / etc/bashrc]; then. Add the JAVA_HOME variable export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk at the end of the / etc/bashrcfi# file

Make the environment variable effective

[root@localhost ~] # source .bashrc

Check if there is a JAVA_HOME variable

[root@localhost ~] # env | grep JAVAJAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk

Install Zookeeper

Download zookeeper-3.4.6.tar.gz, upload it to the server, and decompress it

[root@localhost strom] # tar-zxf zookeeper-3.4.6.tar.gz

Go to the conf folder of zookeeper

[root@localhost conf] # cp zoo_sample.cfg zoo.cfg then vi zoo.cfg modifies the dataDir directory to the directory you want # example sakes.dataDir=/home/strom/zookeeper-3.4.6/data

Start zookeeper

[root@localhost bin] #. / zkServer.sh startJMX enabled by defaultUsing config: / home/strom/zookeeper-3.4.6/bin/../conf/zoo.cfgStarting zookeeper... STARTED

Install Storm (stand-alone)

Download the apache-storm-0.9.6.tar.gz upload server and extract it

[root@localhost strom] # tar-zxf apache-storm-0.9.6.tar.gz

Enter the conf directory of storm and modify the storm.yaml file. Change the address to 127.0.0.1 and change the port of the pencil UI to 8888.

[root@localhost conf] # vi storm.yamlstorm.zookeeper.servers:- "127.0.0.1" #-"server2" # nimbus.host: "127.0.0.1" ui.port: 8888

Start storm nimbus, storm supervisor, storm ui in the bin directory in turn

[root@localhost bin] #. / storm nimbusRunning: / usr/lib/jvm/java-1.7.0-openjdk/bin/j . -Dlogback.configurationFile=/home/strom/apache-storm-0.9.6/logback/cluster.xml backtype.storm.daemon.nimbus [root@localhost bin] #. / storm supervisorRunning: / usr/lib/jvm/java-1.7.0-openjdk/bin/java-server-Dstorm.options=-Dstorm.home=/home/strom/apache-storm-0.9.6-Dstorm.log.dir=/home/strom/apache-storm-0.9.6/logs-Djava.library.path=/usr/ Local/lib:/opt/local/lib:/usr/lib-Dstorm.conf.file=-cp / home/strom/apache-storm-0.9.6/lib/storm-core-0.9.6.jar:/home/strom/apache-storm-0.9.6/lib/clojure-1.5.1.jar:/home/strom/apache-storm-0.9.6/lib/clj-time-0.4.1.jar:/home/strom/apache-storm-.name=supervisor. Log-Dlogback.configurationFile=/home/strom/apache-storm-0.9.6/logback/cluster.xml backtype.storm.daemon.supervisor [root@bogon bin] #. / storm uiRunning: / usr/lib/jvm/java-1.7.0-openjdk/bin/java-server-Dstorm.options=-Dstorm.home=/home/strom/apache-storm-0.9.6-Dstorm.log.dir=/home/strom/apache-storm-0.9.6conf-Xmx768m-Dlogfile.name=ui.log-Dlogback .organizationFile = / home/strom/apache-storm-0.9.6/logback/cluster.xml backtype.storm.ui.core

Enter IP:8888 in the browser to open the UI interface.

If the access to UI cannot be opened, usually the firewall is not turned off. Try to turn off the firewall temporarily by systemctl stop firewalld.

The following figure depicts the relationship between several roles

Run Storm instance-WordCount

Run the built-in example, and the sample program constantly takes the following statement as the data source, and then counts the number of times words appear. Followed by grep the is the number of times the filter statistics are about the word the. The program shuts down automatically after 10 seconds of execution.

{

"the cow jumped over the moon"

"an apple a day keeps the doctor away"

"four score and seven years ago"

"snow white and the seven dwarfs", "i am at two with nature"

}

[root@bogon apache-storm-0.9.6] #. / bin/storm jar. / examples/storm-starter/storm-starter-topologies-0.9.6.jar storm.starter.WordCountTopology | grep 'Thread- [0-9] *-count' | grep the33663 [Thread-11-count] INFO backtype.storm.daemon.executor-Processing received message source: split:7, stream: default, id: {}, ["the"] 33663 [Thread-11-count] INFO backtype.storm.daemon.task-Emitting: count default [the 1] 33672 [Thread-11-count] INFO backtype.storm.daemon.executor-Processing received message source: split:6, stream: default, id: {}, ["the"] 33672 [Thread-11-count] INFO backtype.storm.daemon.task-Emitting: count default [the, 2] 33678 [Thread-11-count] INFO backtype.storm.daemon.executor-Processing received message source: split:6, stream: default, id: {} ["the"] 33678 [Thread-11-count] INFO backtype.storm.daemon.task-Emitting: count default [the, 3]

Other versions of the installation package may not be installed successfully. Please download the installation package strictly according to the version in this article. The operating system is Redhat7.6. The error I encountered when installing other versions is

Error: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain

If you develop your own storm program, you need to create a maven project, write spout,bolt according to storm requirements, then package and upload, and run the test.

This is the end of the detailed installation tutorial for storm. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report