Git Product home page Git Product logo

apache-storm-example's Introduction

Simple apache storm playground

It contains one spout and one bolt. One spout is fetching data from redis and sending to a bolt. After success processing in bolt it is returned back to a spout and inserted into redis "team" list.

Prerequites

  1. Run redis instance on port 7777 ( easiest way as a docker container with a following command:

docker run -d -p 7777:6379 redis

How to start topology

There are two ways to start this topology in local mode using LocalCluster(). In that case you don't need to have nimbus, supervisor and zookeper running separately.

If you want to submit topology using StormSubmitter then you should start: all components mentioned above ( zookeeper, nimbus and supervisor ).

It is recommended that you try to submit topology and start storm UI to get insight about topology from various useful information that is provided in storm ui.

Local mode

From the project root run following commands:

#1 mvn clean

#2 mvn package

#3 storm jar target/mainModule-1.0-SNAPSHOT.jar storm.StormTopology local

Submit topology

Before packaging your topology you should ensure that you are having nimbus, zookeper, supervisor up and running.

  1. Install ZooKeeper https://www.tutorialspoint.com/apache_storm/apache_storm_installation.htm

  2. In above url you will find instructions for storm installation. Anyway I recommend that you use brew for installing storm

brew install storm

Configure your storm:

 storm.zookeeper.servers:
  - "localhost"
 storm.local.dir: “/path/to/storm/data(any path)”
 nimbus.host: "localhost"
 supervisor.slots.ports:
 - 6700
 - 6701
 - 6702
 - 6703
 ui.port: 4444

After storm is installed and ZooKeeper is up and running in a 3 terminal windows run following commands:

storm supervisor

storm nimbus

storm ui

If everything is ok if you visit http://localhost:4444 you should see something like this:

Alt text From the project root run following commands:

#1 mvn clean

#2 mvn package

#3 storm jar target/mainModule-1.0-SNAPSHOT.jar storm.StormTopology

apache-storm-example's People

Watchers

James Cloos avatar Haris avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.