Coder Social home page Coder Social logo

kafka-spark-elasticsearch's Introduction

Kafka-spark-ElasticSearch

Pre-requisites: You system should have zookeeper, Kafka, Spark, MySQL or any database (I did use mySQL) Before running below program,

  1. Start mySQL
  2. Create database - bootcamp
  3. Create table - employee
  4. Insert data into table - columns => number,name,salary

Below are the steps to run the Kafka-spark-ElasticSearch program.

  1. Start the zookeeper
  2. Satrt the kafka server
  3. Start the kafka connector a.I have used the Kafka JDBC Connector to pump the data in Kafka topic.
  4. To run the kafka connector from CMD -> a.C:\kafka_2.11-1.0.0>.\bin\windows\connect-standalone.bat .\config\connect-standalone.properties .\config\connect-mysql-source-increment.properties 5.Below is my kafka connector property file. NOTE: I did use "incrementing" mode. You can ignore # lines. a.Example:connect-mysql-source-increment.properties //// name=test-source-mysql-jdbc-incr connector.class=io.confluent.connect.jdbc.JdbcSourceConnector tasks.max=1 connection.url=jdbc:mysql://localhost:3306/bootcamp?user=root&password=1234 #query=SELECT * FROM EMPLOYEE table.types=TABLE table.blacklist= table.whitelist=employee mode=incrementing incrementing.column.name=number topic.prefix=mySQLIncrementData- #Below property is used to have a time gap to hit the database and fetch new data -> 20 seconds poll.interval.ms=20000 /////
  5. Once you have the data in Kafka topic, You can check with kafka consumer whether data has been produced or not.
  6. Use the sparkstructuredstreaming program to read the data from topic and process it and load data into elasticsearch. a.Reference class -> KafkaConnectorSparkStreamEsDemo

kafka-spark-elasticsearch's People

Contributors

gkpavan001 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.