HookKafka.md 1.87 KB
Newer Older
1 2
---
name: Kafka
3
route: /HookKafka
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
menu: Documentation
submenu: Hooks
---

import  themen  from 'theme/styles/styled-colors';
import  * as theme  from 'react-syntax-highlighter/dist/esm/styles/hljs';
import SyntaxHighlighter from 'react-syntax-highlighter';
import Img from 'theme/components/shared/Img'


# Apache Atlas Hook for Apache Kafka

## Kafka Model
Kafka model includes the following types:
   * Entity types:
      * kafka_topic
20
         * super-types: DataSet
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
         * attributes: qualifiedName, name, description, owner, topic, uri, partitionCount

Kafka entities are created and de-duped in Atlas using unique attribute qualifiedName, whose value should be formatted as detailed below.
Note that qualifiedName will have topic name in lower case.
<SyntaxHighlighter wrapLines={true} language="shell" style={theme.dark}>
   {`topic.qualifiedName: <topic>@<clusterName>`}
</SyntaxHighlighter>


## Setup
Binary files are present in apache-atlas-<release-version/>-kafka-hook.tar.gz

Copy apache-atlas-kafka-hook-<release-version/>/hook/kafka folder to <atlas package/>/hook/    directory

Copy apache-atlas-kafka-hook-<release-version/>/hook-bin folder to  <atlas package/>/hook-bin directory

## Importing Kafka Metadata
Apache Atlas provides a command-line utility, import-kafka.sh, to import metadata of Apache Kafka topics into Apache Atlas.
This utility can be used to initialize Apache Atlas with topics present in Apache Kafka.
This utility supports importing metadata of a specific topic or all topics.

<SyntaxHighlighter wrapLines={true} language="shell" style={theme.dark}>
{`sage 1: <atlas package>/hook-bin/import-kafka.sh
Usage 2: <atlas package>/hook-bin/import-kafka.sh [-t <topic prefix> OR --topic <topic prefix>]
Usage 3: <atlas package>/hook-bin/import-kafka.sh [-f <filename>]
         File Format:
            topic1
            topic2
            topic3`}
</SyntaxHighlighter>