Giter VIP home page Giter VIP logo

votecount-aggregator-using-spark-streaming's Introduction

Spark Streaming with Kafka, Hbase:

Make sure the zoo-keeper is started: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Start the kafka broker: sudo bin/kafka-server-start.sh config/server.properties +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Create a topic : [cloudera@quickstart kafka_2.10-0.8.2.0]$ sudo ./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic spark-topic +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= To List the topics: ./bin/kafka-topics.sh --list --zookeeper localhost:2181 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= To start a kafka producer ./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic spark-topic +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= To build the project, run the below sbt command [cloudera@quickstart VotingMachine]$ pwd /home/cloudera/VotingMachine [cloudera@quickstart VotingMachine]$ sbt assembly

To import the project to ecilpse, run below command to conver to a eclipse project

/home/cloudera/VotingMachine [cloudera@quickstart VotingMachine]$ sbt eclipse

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= To Start the application, run below command

spark-submit --class my.example.SparkKafka.KafkaVoteCount --master local[2] /home/cloudera/VotingMachine/target/scala-2.10/VotingMachine.jar localhost:2181 KafkaVoteCount spark-topic 1

Pre-requestites:

  • Kafka topic and producer has to be Up and running.
  • Hbase thrift server and zookeeper should be running. Because the spark program connects to Hbase thrift server via zookeeper.
  • Hbase table and Column family has to be created. (Refer hbase.ddl) +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

votecount-aggregator-using-spark-streaming's People

Contributors

charlsjoseph avatar

Watchers

 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.