CentOS 6에서 Storm 설치 및 테스트 프로그램 실행

2017. 8. 2. 18:21서버 프로그래밍

1. Zookeeper 설치 및 실행

$ wget  HYPERLINK "http://apache.mirror.cdnetworks.com/zookeeper/stable/zookeeper-3.4.10.tar.gz"http://apache.mirror.cdnetworks.com/zookeeper/stable/zookeeper-3.4.10.tar.gz


$ tar xzvf zookeeper-3.4.10.tar.gz 


$ cd zookeeper-3.4.10

$ cd conf

$ cp zoo_sample.cfg zoo.cfg


$ ./bin/zkServer.sh start


2. Storm 설치 및 실행

$ wget  HYPERLINK "http://apache.mirror.cdnetworks.com/storm/apache-stome-1.1.0/apache-storm-1.1.0.tar.gz"http://apache.mirror.cdnetworks.com/storm/apache-stome-1.1.0/apache-storm-1.1.0.tar.gz


$ tar xzvf apache-storm-1.1.0.tar.gz


$ ./bin/storm nimbus


$ ./bin/storm supervisor


$ ./bin/storm list

WordCountTopology.zip

HelloTopology.zip


Running: /usr/java/jdk1.8.0_65/bin/java -client -Ddaemon.name= -Dstorm.options= -Dstorm.home=/home/eduuser/apache-storm-1.1.0 -Dstorm.log.dir=/home/eduuser/apache-storm-1.1.0/logs -Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib -Dstorm.conf.file= -cp /home/eduuser/apache-storm-1.1.0/lib/minlog-1.3.0.jar:/home/eduuser/apache-storm-1.1.0/lib/kryo-3.0.3.jar:/home/eduuser/apache-storm-1.1.0/lib/servlet-api-2.5.jar:/home/eduuser/apache-storm-1.1.0/lib/log4j-slf4j-impl-2.8.jar:/home/eduuser/apache-storm-1.1.0/lib/ring-cors-0.1.5.jar:/home/eduuser/apache-storm-1.1.0/lib/disruptor-3.3.2.jar:/home/eduuser/apache-storm-1.1.0/lib/storm-core-1.1.0.jar:/home/eduuser/apache-storm-1.1.0/lib/log4j-core-2.8.jar:/home/eduuser/apache-storm-1.1.0/lib/log4j-api-2.8.jar:/home/eduuser/apache-storm-1.1.0/lib/storm-rename-hack-1.1.0.jar:/home/eduuser/apache-storm-1.1.0/lib/slf4j-api-1.7.21.jar:/home/eduuser/apache-storm-1.1.0/lib/reflectasm-1.10.1.jar:/home/eduuser/apache-storm-1.1.0/lib/asm-5.0.3.jar:/home/eduuser/apache-storm-1.1.0/lib/objenesis-2.1.jar:/home/eduuser/apache-storm-1.1.0/lib/log4j-over-slf4j-1.6.6.jar:/home/eduuser/apache-storm-1.1.0/lib/clojure-1.7.0.jar:/home/eduuser/apache-storm-1.1.0/conf:/home/eduuser/apache-storm-1.1.0/bin org.apache.storm.command.list

3669 [main] INFO  o.a.s.u.NimbusClient - Found leader nimbus : localhost:6627

No topologies running.


3. Storm에서 Java 프로그램 실행

$ ./bin/storm jar /home/eduuser/workspace/HelloTopology/target/HelloTopology-0.0.1-SNAPSHOT.jar dev.kdata.hellotopology.HelloTopologyLocal HelloTopologyLocal


$ ./bin/storm jar /home/eduuser/workspace/WordCountTopology/target/WordCountTopology-0.0.1-SNAPSHOT.jar dev.kdata.wordcounttopology.WordCountTopologyLocal WordCountTopology >>result.txt


$ vi result.txt


16591 [SLOT_1027] INFO  o.a.s.d.worker - Terminating messaging context

16591 [SLOT_1027] INFO  o.a.s.d.worker - Shutting down executors

16592 [SLOT_1027] INFO  o.a.s.d.executor - Shutting down executor ReportBolt:[2 2]

16593 [Thread-18-ReportBolt-executor[2 2]] INFO  o.a.s.util - Async loop interrupted!

16594 [Thread-17-disruptor-executor[2 2]-send-queue] INFO  o.a.s.util - Async loop interrupted!

--- FILAL COUNT ---

a:2

book:2

read:1

write:1

--------------------

16597 [SLOT_1027] INFO  o.a.s.d.executor - Shut down executor ReportBolt:[2 2]

16599 [SLOT_1027] INFO  o.a.s.d.executor - Shutting down executor SentenceSpout:[3 3]

16599 [Thread-19-disruptor-executor[3 3]-send-queue] INFO  o.a.s.util - Async loop interrupted!

16605 [Thread-20-SentenceSpout-executor[3 3]] INFO  o.a.s.util - Async loop interrupted!

16606 [SLOT_1027] INFO  o.a.s.d.executor - Shut down executor SentenceSpout