SlideShare a Scribd company logo
1 of 7
Download to read offline
www.bisptrainings.com
Kafka Connectivity with AWS S3 Storage
Sno Date Modification Author Verified By
1 2019/08/06 Initial Document Nishtha Sumit Goyal
www.bisptrainings.com
Table of Contents
Introduction.......................................................................................................................................... 3
Objective............................................................................................................................................ 3
Solutions:........................................................................................................................................... 3
Step1 Get Kafka .................................................................................................................................... 3
Step 2: Create a S3 bucket:................................................................................................................... 5
Step 3: Connect with S3 bucket............................................................................................................ 5
Step 4: Go into docker bash ................................................................................................................. 6
Step 5: Creating Kafka topic ................................................................................................................. 6
Step 6: Start Kafka console producer ................................................................................................... 6
Step 7: Start Kafka Console Consumer ................................................................................................. 7
Step 8: Type in something in the producer console............................................................................. 7
www.bisptrainings.com
Introduction
Kafka is a distributed streaming platform that is used publish and subscribe to streams of records. Kafka
gets used for fault tolerant storage. Kafka replicates topic log partitions to multiple servers. Kafka is
designed to allow your apps to process records as they occur. Kafka is fast, uses IO efficiently by batching,
compressing records. Kafka gets used for decoupling data streams. Kafka is used to stream data into data
lakes, applications and real-time stream analytic systems.
An Amazon S3 bucket is a public cloud storage resource available in Amazon Web Services' (AWS)
Simple Storage Service (S3), an object storage offering. Amazon S3 buckets, which are similar to file
folders, store objects, which consist of data and its descriptive metadata.
Objective
The main objective of this project is that we input some text in Kafka producer console and it will
automatically appear in our s3 bucket as a JSON file
Solutions:
Note: In this document we explain step by step Implementation between kafka and s3 storage (To store
message).
Step1 Get Kafka
Run the following command
docker run -p 2181:2181 
-p 3030:3030 
-p 8081-8083:8081-8083 
-p 9581-9585:9581-9585 
-p 9092:9092 
-e AWS_ACCESS_KEY_ID=your_aws_access_key_without_quotes 
-e AWS_SECRET_ACCESS_KEY=your_aws_secret_key_without_quotes 
-e ADV_HOST=127.0.0.1 
landoop/fast-data-dev:latest-
www.bisptrainings.com
In addition to that, you should see it loads quite a lot of services including Zookeeeper, broker, schema registry,
rest proxy, connect. That is where we are opening various ports.
After about two minutes you should be able to go to http://127.0.0.1:3030 to see the Kafka connect UI.
www.bisptrainings.com
Step 2: Create a S3 bucket:
The next step is to connect to the S3 bucket since we will be uploading our files to s3 bucket. Login to your aws
account and create your bucket.
Step 3: Connect with S3 bucket
From the User interface, click enter at Kafka connect UI . Once you are there, click New connector.
After you click new connector, you will see a lot of connector that you can connect to. Since we want to connect to
S3, click the Amazon S3 icon. And you can see that you are presented with some settings with lots of errors.
In order to get rid of the error, we need to change the following settings. From the following list, you need to change
your s3.region as your bucket may not be in Sydney and your s3.bucket.name to the bucket you have created.
name=S3SinkConnector
connector.class=io.confluent.connect.s3.S3SinkConnector
s3.region=ap-southeast-2
format.class=io.confluent.connect.s3.format.json.JsonFormat
topics.dir=topics
flush.size=1
topics=name of your topic
tasks.max=1
value.converter=org.apache.kafka.connect.storage.StringConverter
storage.class=io.confluent.connect.s3.storage.S3Storage
key.converter=org.apache.kafka.connect.storage.StringConverter
s3.bucket.name=your s3 bucket name
www.bisptrainings.com
Once you fill up all the details and click create, you should see it similar to what I have.
Step 4: Go into docker bash
In order to open the bash inside the docker, we will need the docker id. To get the id, we can do a docker ps
docker ps
This will give you a list of docker container that is running.
If you notice from the image, I have only one container running with the ID ‘66bf4d3ffa46 ’. To open the bash inside
there, we can now type in the following command.
docker exec -it 66bf4d3ffa46 /bin/bash
This will get the us in the bash and we can now create our topic, producer and consumer
root@fast-data-dev / $
Step 5: Creating Kafka topic
The Kafka cluster stores streams of records in categories called topics.
So if we don’t have a topic, we can’t stream our records, or for our case type a message and send it through.
Step 6: Start Kafka console producer
To create messages, we will need to start our Kafka producer console. To create Kafka console producer, we will use
the following command. Once you press enter, you should see a > appear on the screen expecting you to type
something.
www.bisptrainings.com
Step 7: Start Kafka Console Consumer
To check if the message that you are typing is actually going through, lets open a consumer console. To do that, we
will open a new terminal window and go in the same docker container by doing the following
Step 8: Type in something in the producer console
If we now type anything in the kafka-console-producer, it will appear in the console consumer and create a json file
in S3. Download it the file and you will see what you typed!

More Related Content

Similar to Apache Kafka with AWS s3 storage

ScrumDesk API Getting Started
ScrumDesk API  Getting StartedScrumDesk API  Getting Started
ScrumDesk API Getting StartedScrumDesk
 
How to Become Cloud Backup Provider
How to Become Cloud Backup ProviderHow to Become Cloud Backup Provider
How to Become Cloud Backup ProviderCloudian
 
How to become cloud backup provider
How to become cloud backup providerHow to become cloud backup provider
How to become cloud backup providerCLOUDIAN KK
 
Flask Pykafka integration and Setup
Flask Pykafka integration and SetupFlask Pykafka integration and Setup
Flask Pykafka integration and SetupRati Sharma
 
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...Cloudian
 
Mvc music store tutorial - v3.0
Mvc music store   tutorial - v3.0Mvc music store   tutorial - v3.0
Mvc music store tutorial - v3.0Elmore Miranda
 
Appsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation SlidesAppsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation SlidesAppsecco
 
Aspnet mtwaa using_storage_tables_queues_and_blobs
Aspnet mtwaa using_storage_tables_queues_and_blobsAspnet mtwaa using_storage_tables_queues_and_blobs
Aspnet mtwaa using_storage_tables_queues_and_blobsSteve Xu
 
Awsgsg wah-linux
Awsgsg wah-linuxAwsgsg wah-linux
Awsgsg wah-linuxSebin John
 
Awsgsg wah-linux
Awsgsg wah-linuxAwsgsg wah-linux
Awsgsg wah-linuxSebin John
 
Deploying Deep Learning Algorithm On AWS Cloud Platform.pdf
Deploying Deep Learning Algorithm On AWS Cloud Platform.pdfDeploying Deep Learning Algorithm On AWS Cloud Platform.pdf
Deploying Deep Learning Algorithm On AWS Cloud Platform.pdfLaveshLalwani1
 
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20..."AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...Vadym Kazulkin
 
Monitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and KibanaMonitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and KibanaQbox
 
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
10 Lessons Learned from using Kafka with 1000 microservices - java global summit10 Lessons Learned from using Kafka with 1000 microservices - java global summit
10 Lessons Learned from using Kafka with 1000 microservices - java global summitNatan Silnitsky
 
Openstack Cloud Administrator Guide
Openstack Cloud Administrator GuideOpenstack Cloud Administrator Guide
Openstack Cloud Administrator GuideRajaram M
 

Similar to Apache Kafka with AWS s3 storage (20)

ScrumDesk API Getting Started
ScrumDesk API  Getting StartedScrumDesk API  Getting Started
ScrumDesk API Getting Started
 
How to Become Cloud Backup Provider
How to Become Cloud Backup ProviderHow to Become Cloud Backup Provider
How to Become Cloud Backup Provider
 
How to become cloud backup provider
How to become cloud backup providerHow to become cloud backup provider
How to become cloud backup provider
 
Flask Pykafka integration and Setup
Flask Pykafka integration and SetupFlask Pykafka integration and Setup
Flask Pykafka integration and Setup
 
CloudStack S3
CloudStack S3CloudStack S3
CloudStack S3
 
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
How to become cloud backup provider with Cloudian HyperStore and CloudBerry L...
 
Mvc music store tutorial - v3.0
Mvc music store   tutorial - v3.0Mvc music store   tutorial - v3.0
Mvc music store tutorial - v3.0
 
Appsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation SlidesAppsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation Slides
 
Magento Hosting on AWS
Magento Hosting on AWS Magento Hosting on AWS
Magento Hosting on AWS
 
Aspnet mtwaa using_storage_tables_queues_and_blobs
Aspnet mtwaa using_storage_tables_queues_and_blobsAspnet mtwaa using_storage_tables_queues_and_blobs
Aspnet mtwaa using_storage_tables_queues_and_blobs
 
Knowledge base
Knowledge baseKnowledge base
Knowledge base
 
Aws tkv-ug
Aws tkv-ugAws tkv-ug
Aws tkv-ug
 
Awsgsg wah-linux
Awsgsg wah-linuxAwsgsg wah-linux
Awsgsg wah-linux
 
Awsgsg wah-linux
Awsgsg wah-linuxAwsgsg wah-linux
Awsgsg wah-linux
 
Deploying Deep Learning Algorithm On AWS Cloud Platform.pdf
Deploying Deep Learning Algorithm On AWS Cloud Platform.pdfDeploying Deep Learning Algorithm On AWS Cloud Platform.pdf
Deploying Deep Learning Algorithm On AWS Cloud Platform.pdf
 
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20..."AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
"AWS Fargate: Containerization meets Serverless" at AWS User Group Cologne 20...
 
Monitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and KibanaMonitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
Monitoring Docker Containers with Metricbeat, Elasticsearch, and Kibana
 
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
10 Lessons Learned from using Kafka with 1000 microservices - java global summit10 Lessons Learned from using Kafka with 1000 microservices - java global summit
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
 
Openstack Cloud Administrator Guide
Openstack Cloud Administrator GuideOpenstack Cloud Administrator Guide
Openstack Cloud Administrator Guide
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 

More from Rati Sharma

Oracle FCCS Getting Started Guide II
Oracle FCCS Getting Started Guide IIOracle FCCS Getting Started Guide II
Oracle FCCS Getting Started Guide IIRati Sharma
 
Getting Started with Visualforce
Getting Started with VisualforceGetting Started with Visualforce
Getting Started with VisualforceRati Sharma
 
Oracle fccs creating new application
Oracle fccs creating new applicationOracle fccs creating new application
Oracle fccs creating new applicationRati Sharma
 
Oracle PBCS Calculating Depreciation
Oracle PBCS Calculating DepreciationOracle PBCS Calculating Depreciation
Oracle PBCS Calculating DepreciationRati Sharma
 
Display contact using aura and Ligtning components (apex and visualforce) con...
Display contact using aura and Ligtning components (apex and visualforce) con...Display contact using aura and Ligtning components (apex and visualforce) con...
Display contact using aura and Ligtning components (apex and visualforce) con...Rati Sharma
 
Oracle PBCS Sales driver for retail Business
Oracle PBCS Sales driver for retail BusinessOracle PBCS Sales driver for retail Business
Oracle PBCS Sales driver for retail BusinessRati Sharma
 
Getting started with oracle eprcs
Getting started with oracle eprcsGetting started with oracle eprcs
Getting started with oracle eprcsRati Sharma
 
Sales quota planning creating application
Sales quota planning creating applicationSales quota planning creating application
Sales quota planning creating applicationRati Sharma
 
Oracle Enterprise PBCS Driver Based Planning and Budgeting
Oracle Enterprise PBCS Driver Based Planning and BudgetingOracle Enterprise PBCS Driver Based Planning and Budgeting
Oracle Enterprise PBCS Driver Based Planning and BudgetingRati Sharma
 
Oracle strategic workforce planning cloud (hcmswp)
Oracle strategic workforce planning cloud (hcmswp)Oracle strategic workforce planning cloud (hcmswp)
Oracle strategic workforce planning cloud (hcmswp)Rati Sharma
 
Python nltk synonyms and antonyms
Python nltk synonyms and antonymsPython nltk synonyms and antonyms
Python nltk synonyms and antonymsRati Sharma
 

More from Rati Sharma (11)

Oracle FCCS Getting Started Guide II
Oracle FCCS Getting Started Guide IIOracle FCCS Getting Started Guide II
Oracle FCCS Getting Started Guide II
 
Getting Started with Visualforce
Getting Started with VisualforceGetting Started with Visualforce
Getting Started with Visualforce
 
Oracle fccs creating new application
Oracle fccs creating new applicationOracle fccs creating new application
Oracle fccs creating new application
 
Oracle PBCS Calculating Depreciation
Oracle PBCS Calculating DepreciationOracle PBCS Calculating Depreciation
Oracle PBCS Calculating Depreciation
 
Display contact using aura and Ligtning components (apex and visualforce) con...
Display contact using aura and Ligtning components (apex and visualforce) con...Display contact using aura and Ligtning components (apex and visualforce) con...
Display contact using aura and Ligtning components (apex and visualforce) con...
 
Oracle PBCS Sales driver for retail Business
Oracle PBCS Sales driver for retail BusinessOracle PBCS Sales driver for retail Business
Oracle PBCS Sales driver for retail Business
 
Getting started with oracle eprcs
Getting started with oracle eprcsGetting started with oracle eprcs
Getting started with oracle eprcs
 
Sales quota planning creating application
Sales quota planning creating applicationSales quota planning creating application
Sales quota planning creating application
 
Oracle Enterprise PBCS Driver Based Planning and Budgeting
Oracle Enterprise PBCS Driver Based Planning and BudgetingOracle Enterprise PBCS Driver Based Planning and Budgeting
Oracle Enterprise PBCS Driver Based Planning and Budgeting
 
Oracle strategic workforce planning cloud (hcmswp)
Oracle strategic workforce planning cloud (hcmswp)Oracle strategic workforce planning cloud (hcmswp)
Oracle strategic workforce planning cloud (hcmswp)
 
Python nltk synonyms and antonyms
Python nltk synonyms and antonymsPython nltk synonyms and antonyms
Python nltk synonyms and antonyms
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 

Apache Kafka with AWS s3 storage

  • 1. www.bisptrainings.com Kafka Connectivity with AWS S3 Storage Sno Date Modification Author Verified By 1 2019/08/06 Initial Document Nishtha Sumit Goyal
  • 2. www.bisptrainings.com Table of Contents Introduction.......................................................................................................................................... 3 Objective............................................................................................................................................ 3 Solutions:........................................................................................................................................... 3 Step1 Get Kafka .................................................................................................................................... 3 Step 2: Create a S3 bucket:................................................................................................................... 5 Step 3: Connect with S3 bucket............................................................................................................ 5 Step 4: Go into docker bash ................................................................................................................. 6 Step 5: Creating Kafka topic ................................................................................................................. 6 Step 6: Start Kafka console producer ................................................................................................... 6 Step 7: Start Kafka Console Consumer ................................................................................................. 7 Step 8: Type in something in the producer console............................................................................. 7
  • 3. www.bisptrainings.com Introduction Kafka is a distributed streaming platform that is used publish and subscribe to streams of records. Kafka gets used for fault tolerant storage. Kafka replicates topic log partitions to multiple servers. Kafka is designed to allow your apps to process records as they occur. Kafka is fast, uses IO efficiently by batching, compressing records. Kafka gets used for decoupling data streams. Kafka is used to stream data into data lakes, applications and real-time stream analytic systems. An Amazon S3 bucket is a public cloud storage resource available in Amazon Web Services' (AWS) Simple Storage Service (S3), an object storage offering. Amazon S3 buckets, which are similar to file folders, store objects, which consist of data and its descriptive metadata. Objective The main objective of this project is that we input some text in Kafka producer console and it will automatically appear in our s3 bucket as a JSON file Solutions: Note: In this document we explain step by step Implementation between kafka and s3 storage (To store message). Step1 Get Kafka Run the following command docker run -p 2181:2181 -p 3030:3030 -p 8081-8083:8081-8083 -p 9581-9585:9581-9585 -p 9092:9092 -e AWS_ACCESS_KEY_ID=your_aws_access_key_without_quotes -e AWS_SECRET_ACCESS_KEY=your_aws_secret_key_without_quotes -e ADV_HOST=127.0.0.1 landoop/fast-data-dev:latest-
  • 4. www.bisptrainings.com In addition to that, you should see it loads quite a lot of services including Zookeeeper, broker, schema registry, rest proxy, connect. That is where we are opening various ports. After about two minutes you should be able to go to http://127.0.0.1:3030 to see the Kafka connect UI.
  • 5. www.bisptrainings.com Step 2: Create a S3 bucket: The next step is to connect to the S3 bucket since we will be uploading our files to s3 bucket. Login to your aws account and create your bucket. Step 3: Connect with S3 bucket From the User interface, click enter at Kafka connect UI . Once you are there, click New connector. After you click new connector, you will see a lot of connector that you can connect to. Since we want to connect to S3, click the Amazon S3 icon. And you can see that you are presented with some settings with lots of errors. In order to get rid of the error, we need to change the following settings. From the following list, you need to change your s3.region as your bucket may not be in Sydney and your s3.bucket.name to the bucket you have created. name=S3SinkConnector connector.class=io.confluent.connect.s3.S3SinkConnector s3.region=ap-southeast-2 format.class=io.confluent.connect.s3.format.json.JsonFormat topics.dir=topics flush.size=1 topics=name of your topic tasks.max=1 value.converter=org.apache.kafka.connect.storage.StringConverter storage.class=io.confluent.connect.s3.storage.S3Storage key.converter=org.apache.kafka.connect.storage.StringConverter s3.bucket.name=your s3 bucket name
  • 6. www.bisptrainings.com Once you fill up all the details and click create, you should see it similar to what I have. Step 4: Go into docker bash In order to open the bash inside the docker, we will need the docker id. To get the id, we can do a docker ps docker ps This will give you a list of docker container that is running. If you notice from the image, I have only one container running with the ID ‘66bf4d3ffa46 ’. To open the bash inside there, we can now type in the following command. docker exec -it 66bf4d3ffa46 /bin/bash This will get the us in the bash and we can now create our topic, producer and consumer root@fast-data-dev / $ Step 5: Creating Kafka topic The Kafka cluster stores streams of records in categories called topics. So if we don’t have a topic, we can’t stream our records, or for our case type a message and send it through. Step 6: Start Kafka console producer To create messages, we will need to start our Kafka producer console. To create Kafka console producer, we will use the following command. Once you press enter, you should see a > appear on the screen expecting you to type something.
  • 7. www.bisptrainings.com Step 7: Start Kafka Console Consumer To check if the message that you are typing is actually going through, lets open a consumer console. To do that, we will open a new terminal window and go in the same docker container by doing the following Step 8: Type in something in the producer console If we now type anything in the kafka-console-producer, it will appear in the console consumer and create a json file in S3. Download it the file and you will see what you typed!