SlideShare une entreprise Scribd logo
1  sur  9
Address:
Flat No 204, Annapurna Block
Aditya Enclave, Ameerpet
Hyderabad - 500038
Telangana, India.
Quick Contact:
info@OrienIT.com
+91 040 6514 2345
+91 970 320 2345
Blogs
http://kalyanbigdatatraining.blogspot.com
http://www.kalyanhadooptraining.com/
www.orienit.com
The plugin enables us to reliably
and efficiently stream large
amounts of data/logs onto HBase
using the Phoenix API.
Apache Kafka is a distributed,
partitioned, replicated commit log
service. It provides the
functionality of a messaging
system, but with a unique design.
So, at a high level, producers send
messages over the network to the
Kafka cluster which in turn serves
them up to consumers like this:
Apache Kafka Plugin
We are providing PhoenixConsumer to
recieves the messages from Kafka
Producer.
9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
Prerequisites:
Phoenix 4.8.0+
Kafka 0.9.0.0+
Installation & Setup:
Download and build Phoenix 4.8.0+
Follow the instructions as specified here to
build the project as the Kafka plugin.
9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
Create a kafka-consumer-regex.properties file with below properties
serializer=regex
serializer.rowkeyType=uuid
serializer.regex=([^,]*),([^,]*),([^,]*)
serializer.columns=c1,c2,c3
jdbcUrl=jdbc:phoenix:localhost
table=SAMPLE1
ddl=CREATE TABLE IF NOT EXISTS SAMPLE1
(uid VARCHAR NOT NULL,c1 VARCHAR,c2 VARCHAR,c3
VARCHAR CONSTRAINT pk PRIMARY KEY(uid))
bootstrap.servers=localhost:9092
topics=topic1,topic2
poll.timeout.ms=100
Phoenix Consumer for RegexEventSerializer Example:
9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
serializer=json
serializer.rowkeyType=uuid
serializer.columns=c1,c2,c3
jdbcUrl=jdbc:phoenix:localhost
table=SAMPLE2
ddl=CREATE TABLE IF NOT EXISTS SAMPLE2(uid VARCHAR
NOT NULL,c1 VARCHAR,c2 VARCHAR,c3 VARCHAR
CONSTRAINT pk PRIMARY KEY(uid))
bootstrap.servers=localhost:9092
topics=topic1,topic2
poll.timeout.ms=100
Phoenix Consumer for JsonEventSerializer Example:
Create a kafka-consumer-json.properties file with below properties
9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
Phoenix Consumer Execution Procedure:
Start the Kakfa Producer then send some messages
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic topic1
Start the PhoenixConsumer using below command
HADOOP_CLASSPATH=$(hbase classpath):/path/to/hbase/conf hadoop
jar phoenix-kafka-<version>-minimal.jar
org.apache.phoenix.kafka.consumer.PhoenixConsumerTool --file
/data/kafka-consumer.properties
The input file must be present on HDFS (not the local filesystem where
the command is being run).
9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
Configuration:
Property Name Default Description
bootstrap.servers List of Kafka servers used to bootstrap connections to
Kafka. This list should be in the form
host1:port1,host2:port2,…
topics List of topics to use as input for this connector. This list
should be in the form topic1,topic2,…
poll.timeout.ms 100 Default poll timeout in millisec
batchSize 100 Default number of events per transaction
zookeeper Quorum Zookeeper quorum of the HBase cluster
table The name of the table in HBase to write to.
ddl The CREATE TABLE query for the HBase table where the
events will be upserted to. If specified, the query will be
executed. Recommended to include the IF NOT EXISTS
clause in the ddl.
9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
Configuration:
Property Name Default Description
serializer Event serializers for processing the Kafka
Message.This Plugin supports all Phoenix Flume
Event Serializers. Like regex, json
serializer.regex (.*) The regular expression for parsing the message.
serializer.columns The columns that will be extracted from the Flume
event for inserting into HBase.
serializer.headers Headers of the Flume Events that go as part of the
UPSERT query. The data type for these columns
are VARCHAR by default.
serializer.rowkeyType A custom row key generator . Can be one of
timestamp,date,uuid,random and nanotimestamp.
This should be configured in cases where we need a
custom row key value to be auto generated and set
for the primary key column.
9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
9703202345
Website: www.orienit.com
Facebook: https://www.facebook.com/OrienITinstitute/
Twitter: https://twitter.com/Orien_IT

Contenu connexe

En vedette

Strata+Hadoop 2017 San Jose - The Rise of Real Time: Apache Kafka and the Str...
Strata+Hadoop 2017 San Jose - The Rise of Real Time: Apache Kafka and the Str...Strata+Hadoop 2017 San Jose - The Rise of Real Time: Apache Kafka and the Str...
Strata+Hadoop 2017 San Jose - The Rise of Real Time: Apache Kafka and the Str...confluent
 
Distributed stream processing with Apache Kafka
Distributed stream processing with Apache KafkaDistributed stream processing with Apache Kafka
Distributed stream processing with Apache Kafkaconfluent
 
Data Pipelines Made Simple with Apache Kafka
Data Pipelines Made Simple with Apache KafkaData Pipelines Made Simple with Apache Kafka
Data Pipelines Made Simple with Apache Kafkaconfluent
 
Current and Future of Apache Kafka
Current and Future of Apache KafkaCurrent and Future of Apache Kafka
Current and Future of Apache KafkaJoe Stein
 
Being Ready for Apache Kafka - Apache: Big Data Europe 2015
Being Ready for Apache Kafka - Apache: Big Data Europe 2015Being Ready for Apache Kafka - Apache: Big Data Europe 2015
Being Ready for Apache Kafka - Apache: Big Data Europe 2015Michael Noll
 
Introduction to Apache Kafka- Part 2
Introduction to Apache Kafka- Part 2Introduction to Apache Kafka- Part 2
Introduction to Apache Kafka- Part 2Knoldus Inc.
 
Apache Kafka
Apache KafkaApache Kafka
Apache KafkaJoe Stein
 
Introduction to Kafka connect
Introduction to Kafka connectIntroduction to Kafka connect
Introduction to Kafka connectKnoldus Inc.
 
I Heart Log: Real-time Data and Apache Kafka
I Heart Log: Real-time Data and Apache KafkaI Heart Log: Real-time Data and Apache Kafka
I Heart Log: Real-time Data and Apache KafkaJay Kreps
 
Introduction to Apache Kafka- Part 1
Introduction to Apache Kafka- Part 1Introduction to Apache Kafka- Part 1
Introduction to Apache Kafka- Part 1Knoldus Inc.
 
JustGiving – Serverless Data Pipelines, API, Messaging and Stream Processing
JustGiving – Serverless Data Pipelines,  API, Messaging and Stream ProcessingJustGiving – Serverless Data Pipelines,  API, Messaging and Stream Processing
JustGiving – Serverless Data Pipelines, API, Messaging and Stream ProcessingLuis Gonzalez
 
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Amazon Web Services
 
Presto at Twitter
Presto at TwitterPresto at Twitter
Presto at TwitterBill Graham
 
Multi-Datacenter Kafka - Strata San Jose 2017
Multi-Datacenter Kafka - Strata San Jose 2017Multi-Datacenter Kafka - Strata San Jose 2017
Multi-Datacenter Kafka - Strata San Jose 2017Gwen (Chen) Shapira
 
Twitter Heron in Practice
Twitter Heron in PracticeTwitter Heron in Practice
Twitter Heron in PracticeBill Graham
 
Best Digital Marketing Companies-Services in Pune | 3DOT Technologies
Best Digital Marketing Companies-Services in Pune | 3DOT TechnologiesBest Digital Marketing Companies-Services in Pune | 3DOT Technologies
Best Digital Marketing Companies-Services in Pune | 3DOT TechnologiesShrikant Ingle
 

En vedette (17)

Strata+Hadoop 2017 San Jose - The Rise of Real Time: Apache Kafka and the Str...
Strata+Hadoop 2017 San Jose - The Rise of Real Time: Apache Kafka and the Str...Strata+Hadoop 2017 San Jose - The Rise of Real Time: Apache Kafka and the Str...
Strata+Hadoop 2017 San Jose - The Rise of Real Time: Apache Kafka and the Str...
 
Distributed stream processing with Apache Kafka
Distributed stream processing with Apache KafkaDistributed stream processing with Apache Kafka
Distributed stream processing with Apache Kafka
 
Data Pipelines Made Simple with Apache Kafka
Data Pipelines Made Simple with Apache KafkaData Pipelines Made Simple with Apache Kafka
Data Pipelines Made Simple with Apache Kafka
 
Current and Future of Apache Kafka
Current and Future of Apache KafkaCurrent and Future of Apache Kafka
Current and Future of Apache Kafka
 
Apache Kafka at LinkedIn
Apache Kafka at LinkedInApache Kafka at LinkedIn
Apache Kafka at LinkedIn
 
Being Ready for Apache Kafka - Apache: Big Data Europe 2015
Being Ready for Apache Kafka - Apache: Big Data Europe 2015Being Ready for Apache Kafka - Apache: Big Data Europe 2015
Being Ready for Apache Kafka - Apache: Big Data Europe 2015
 
Introduction to Apache Kafka- Part 2
Introduction to Apache Kafka- Part 2Introduction to Apache Kafka- Part 2
Introduction to Apache Kafka- Part 2
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Introduction to Kafka connect
Introduction to Kafka connectIntroduction to Kafka connect
Introduction to Kafka connect
 
I Heart Log: Real-time Data and Apache Kafka
I Heart Log: Real-time Data and Apache KafkaI Heart Log: Real-time Data and Apache Kafka
I Heart Log: Real-time Data and Apache Kafka
 
Introduction to Apache Kafka- Part 1
Introduction to Apache Kafka- Part 1Introduction to Apache Kafka- Part 1
Introduction to Apache Kafka- Part 1
 
JustGiving – Serverless Data Pipelines, API, Messaging and Stream Processing
JustGiving – Serverless Data Pipelines,  API, Messaging and Stream ProcessingJustGiving – Serverless Data Pipelines,  API, Messaging and Stream Processing
JustGiving – Serverless Data Pipelines, API, Messaging and Stream Processing
 
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
 
Presto at Twitter
Presto at TwitterPresto at Twitter
Presto at Twitter
 
Multi-Datacenter Kafka - Strata San Jose 2017
Multi-Datacenter Kafka - Strata San Jose 2017Multi-Datacenter Kafka - Strata San Jose 2017
Multi-Datacenter Kafka - Strata San Jose 2017
 
Twitter Heron in Practice
Twitter Heron in PracticeTwitter Heron in Practice
Twitter Heron in Practice
 
Best Digital Marketing Companies-Services in Pune | 3DOT Technologies
Best Digital Marketing Companies-Services in Pune | 3DOT TechnologiesBest Digital Marketing Companies-Services in Pune | 3DOT Technologies
Best Digital Marketing Companies-Services in Pune | 3DOT Technologies
 

Dernier

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 

Dernier (20)

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 

Apache kafka plugin - ORIEN IT

  • 1. Address: Flat No 204, Annapurna Block Aditya Enclave, Ameerpet Hyderabad - 500038 Telangana, India. Quick Contact: info@OrienIT.com +91 040 6514 2345 +91 970 320 2345 Blogs http://kalyanbigdatatraining.blogspot.com http://www.kalyanhadooptraining.com/ www.orienit.com
  • 2. The plugin enables us to reliably and efficiently stream large amounts of data/logs onto HBase using the Phoenix API. Apache Kafka is a distributed, partitioned, replicated commit log service. It provides the functionality of a messaging system, but with a unique design. So, at a high level, producers send messages over the network to the Kafka cluster which in turn serves them up to consumers like this: Apache Kafka Plugin We are providing PhoenixConsumer to recieves the messages from Kafka Producer. 9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
  • 3. Prerequisites: Phoenix 4.8.0+ Kafka 0.9.0.0+ Installation & Setup: Download and build Phoenix 4.8.0+ Follow the instructions as specified here to build the project as the Kafka plugin. 9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
  • 4. Create a kafka-consumer-regex.properties file with below properties serializer=regex serializer.rowkeyType=uuid serializer.regex=([^,]*),([^,]*),([^,]*) serializer.columns=c1,c2,c3 jdbcUrl=jdbc:phoenix:localhost table=SAMPLE1 ddl=CREATE TABLE IF NOT EXISTS SAMPLE1 (uid VARCHAR NOT NULL,c1 VARCHAR,c2 VARCHAR,c3 VARCHAR CONSTRAINT pk PRIMARY KEY(uid)) bootstrap.servers=localhost:9092 topics=topic1,topic2 poll.timeout.ms=100 Phoenix Consumer for RegexEventSerializer Example: 9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
  • 5. serializer=json serializer.rowkeyType=uuid serializer.columns=c1,c2,c3 jdbcUrl=jdbc:phoenix:localhost table=SAMPLE2 ddl=CREATE TABLE IF NOT EXISTS SAMPLE2(uid VARCHAR NOT NULL,c1 VARCHAR,c2 VARCHAR,c3 VARCHAR CONSTRAINT pk PRIMARY KEY(uid)) bootstrap.servers=localhost:9092 topics=topic1,topic2 poll.timeout.ms=100 Phoenix Consumer for JsonEventSerializer Example: Create a kafka-consumer-json.properties file with below properties 9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
  • 6. Phoenix Consumer Execution Procedure: Start the Kakfa Producer then send some messages bin/kafka-console-producer.sh --broker-list localhost:9092 --topic topic1 Start the PhoenixConsumer using below command HADOOP_CLASSPATH=$(hbase classpath):/path/to/hbase/conf hadoop jar phoenix-kafka-<version>-minimal.jar org.apache.phoenix.kafka.consumer.PhoenixConsumerTool --file /data/kafka-consumer.properties The input file must be present on HDFS (not the local filesystem where the command is being run). 9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
  • 7. Configuration: Property Name Default Description bootstrap.servers List of Kafka servers used to bootstrap connections to Kafka. This list should be in the form host1:port1,host2:port2,… topics List of topics to use as input for this connector. This list should be in the form topic1,topic2,… poll.timeout.ms 100 Default poll timeout in millisec batchSize 100 Default number of events per transaction zookeeper Quorum Zookeeper quorum of the HBase cluster table The name of the table in HBase to write to. ddl The CREATE TABLE query for the HBase table where the events will be upserted to. If specified, the query will be executed. Recommended to include the IF NOT EXISTS clause in the ddl. 9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com
  • 8. Configuration: Property Name Default Description serializer Event serializers for processing the Kafka Message.This Plugin supports all Phoenix Flume Event Serializers. Like regex, json serializer.regex (.*) The regular expression for parsing the message. serializer.columns The columns that will be extracted from the Flume event for inserting into HBase. serializer.headers Headers of the Flume Events that go as part of the UPSERT query. The data type for these columns are VARCHAR by default. serializer.rowkeyType A custom row key generator . Can be one of timestamp,date,uuid,random and nanotimestamp. This should be configured in cases where we need a custom row key value to be auto generated and set for the primary key column. 9703202345Blog: http://kalyanbigdatatraining.blogspot.com/ www.orienit.com