Skip to content

Commit 92d970a

Browse files
authored
Merge pull request #225905 from sreekzz/patch-139
Removed 3.6 related content
2 parents 5ddc32a + aeae1d7 commit 92d970a

File tree

2 files changed

+23
-53
lines changed

2 files changed

+23
-53
lines changed

articles/hdinsight/kafka/apache-kafka-ssl-encryption-authentication.md

Lines changed: 23 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: Apache Kafka TLS encryption & authentication - Azure HDInsight
3-
description: Set up TLS encryption for communication between Kafka clients and Kafka brokers as well as between Kafka brokers. Set up SSL authentication of clients.
3+
description: Set up TLS encryption for communication between Kafka clients and Kafka brokers, Set up SSL authentication of clients.
44
ms.service: hdinsight
55
ms.topic: how-to
66
ms.custom: hdinsightactive
7-
ms.date: 03/31/2022
7+
ms.date: 02/03/2023
88
---
99

1010
# Set up TLS encryption and authentication for Apache Kafka in Azure HDInsight
@@ -14,9 +14,6 @@ This article shows you how to set up Transport Layer Security (TLS) encryption,
1414
> [!Important]
1515
> There are two clients which you can use for Kafka applications: a Java client and a console client. Only the Java client `ProducerConsumer.java` can use TLS for both producing and consuming. The console producer client `console-producer.sh` does not work with TLS.
1616
17-
> [!Note]
18-
> HDInsight Kafka console producer with version 1.1 does not support SSL.
19-
2017
## Apache Kafka broker setup
2118

2219
The Kafka TLS broker setup will use four HDInsight cluster VMs in the following way:
@@ -30,7 +27,6 @@ The Kafka TLS broker setup will use four HDInsight cluster VMs in the following
3027
The summary of the broker setup process is as follows:
3128

3229
1. The following steps are repeated on each of the three worker nodes:
33-
3430
1. Generate a certificate.
3531
1. Create a cert signing request.
3632
1. Send the cert signing request to the Certificate Authority (CA).
@@ -62,7 +58,7 @@ Use the following detailed instructions to complete the broker setup:
6258
cd ssl
6359
```
6460

65-
1. On each of the worker nodes, execute the following steps using the code snippet below.
61+
1. On each of the worker nodes, execute the following steps using the code snippet.
6662
1. Create a keystore and populate it with a new private certificate.
6763
1. Create a certificate signing request.
6864
1. SCP the certificate signing request to the CA (headnode0)
@@ -72,8 +68,17 @@ Use the following detailed instructions to complete the broker setup:
7268
keytool -keystore kafka.server.keystore.jks -certreq -file cert-file -storepass "MyServerPassword123" -keypass "MyServerPassword123"
7369
scp cert-file sshuser@HeadNode0_Name:~/ssl/wnX-cert-sign-request
7470
```
75-
76-
1. On the CA machine run the following command to create ca-cert and ca-key files:
71+
> [!Note]
72+
> FQDN_WORKER_NODE is Fully Qualified Domain Name of worker node machine.You can get that details from /etc/hosts file in head node
73+
74+
For example,
75+
```
76+
wn0-espkaf.securehadooprc.onmicrosoft.com
77+
wn0-kafka2.zbxwnwsmpcsuvbjqbmespcm1zg.bx.internal.cloudapp.net
78+
```
79+
:::image type="content" source="./media/apache-kafka-ssl-encryption-authentication/etc-hosts.png" alt-text="Screenshot showing etc hosts output." border="true":::
80+
81+
1. On the CA machine, run the following command to create ca-cert and ca-key files:
7782

7883
```bash
7984
openssl req -new -newkey rsa:4096 -days 365 -x509 -subj "/CN=Kafka-Security-CA" -keyout ca-key -out ca-cert -nodes
@@ -125,32 +130,17 @@ To complete the configuration modification, do the following steps:
125130
126131
:::image type="content" source="./media/apache-kafka-ssl-encryption-authentication/editing-configuration-ambari.png" alt-text="Editing Kafka ssl configuration properties in Ambari" border="true":::
127132
128-
1. Under **Custom kafka-broker** set the **ssl.client.auth** property to `required`. This step is only required if you are setting up authentication and encryption.
133+
1. Under **Custom kafka-broker** set the **ssl.client.auth** property to `required`.
129134
135+
136+
> [!Note]
137+
> Note: This step is only required if you are setting up authentication and encryption.
138+
130139
:::image type="content" source="./media/apache-kafka-ssl-encryption-authentication/editing-configuration-ambari2.png" alt-text="Editing kafka ssl configuration properties in Ambari" border="true":::
131140
132-
1. For HDI version 3.6, go to Ambari UI and add the following configurations under **Advanced kafka-env** and the **kafka-env template** property.
133-
134-
```bash
135-
# Configure Kafka to advertise IP addresses instead of FQDN
136-
IP_ADDRESS=$(hostname -i)
137-
echo advertised.listeners=$IP_ADDRESS
138-
sed -i.bak -e '/advertised/{/advertised@/!d;}' /usr/hdp/current/kafka-broker/conf/server.properties
139-
echo "advertised.listeners=PLAINTEXT://$IP_ADDRESS:9092,SSL://$IP_ADDRESS:9093" >> /usr/hdp/current/kafka-broker/conf/server.properties
140-
echo "ssl.keystore.location=/home/sshuser/ssl/kafka.server.keystore.jks" >> /usr/hdp/current/kafka-broker/conf/server.properties
141-
echo "ssl.keystore.password=MyServerPassword123" >> /usr/hdp/current/kafka-broker/conf/server.properties
142-
echo "ssl.key.password=MyServerPassword123" >> /usr/hdp/current/kafka-broker/conf/server.properties
143-
echo "ssl.truststore.location=/home/sshuser/ssl/kafka.server.truststore.jks" >> /usr/hdp/current/kafka-broker/conf/server.properties
144-
echo "ssl.truststore.password=MyServerPassword123" >> /usr/hdp/current/kafka-broker/conf/server.properties
145-
```
146-
147-
1. Here is the screenshot that shows Ambari configuration UI with these changes.
148-
149-
For HDI version 3.6:
141+
1. Here's the screenshot that shows Ambari configuration UI with these changes.
150142

151-
:::image type="content" source="./media/apache-kafka-ssl-encryption-authentication/editing-configuration-kafka-env.png" alt-text="Editing kafka-env template property in Ambari" border="true":::
152-
153-
For HDI version 4.0:
143+
For HDI version 4.0 or 5.0
154144

155145
:::image type="content" source="./media/apache-kafka-ssl-encryption-authentication/editing-configuration-kafka-env-four.png" alt-text="Editing kafka-env template property in Ambari four" border="true":::
156146

@@ -208,7 +198,7 @@ These steps are detailed in the following code snippets.
208198
ssl.truststore.password=MyClientPassword123
209199
```
210200
211-
1. Start the admin client with producer and consumer options to verify that both producers and consumers are working on port 9093. Please refer to [Verification](apache-kafka-ssl-encryption-authentication.md#verification) section below for steps needed to verify the setup using console producer/consumer.
201+
1. Start the admin client with producer and consumer options to verify that both producers and consumers are working on port 9093. Refer to [Verification](apache-kafka-ssl-encryption-authentication.md#verification) section for steps needed to verify the setup using console producer/consumer.
212202
213203
## Client setup (with authentication)
214204
@@ -222,7 +212,7 @@ The following four steps summarize the tasks needed to complete the client setup
222212
1. Switch to the CA machine (active head node) to sign the client certificate.
223213
1. Go to the client machine (standby head node) and navigate to the `~/ssl` folder. Copy the signed cert to client machine.
224214
225-
The details of each step are given below.
215+
The details of each step are given.
226216
227217
1. Sign in to the client machine (standby head node).
228218
@@ -327,26 +317,6 @@ Run these steps on the client machine.
327317
/usr/hdp/current/kafka-broker/bin/kafka-console-consumer.sh --bootstrap-server <FQDN_WORKER_NODE>:9093 --topic topic1 --consumer.config ~/ssl/client-ssl-auth.properties --from-beginning
328318
```
329319

330-
### Kafka 1.1
331-
332-
1. Create a topic if it doesn't exist already.
333-
334-
```bash
335-
/usr/hdp/current/kafka-broker/bin/kafka-topics.sh --zookeeper <ZOOKEEPER_NODE_0>:2181 --create --topic topic1 --partitions 2 --replication-factor 2
336-
```
337-
338-
1. Start console producer and provide the path to client-ssl-auth.properties as a configuration file for the producer.
339-
340-
```bash
341-
/usr/hdp/current/kafka-broker/bin/kafka-console-producer.sh --broker-list <FQDN_WORKER_NODE>:9092 --topic topic1
342-
```
343-
344-
1. Open another ssh connection to client machine and start console consumer and provide the path to `client-ssl-auth.properties` as a configuration file for the consumer.
345-
346-
```bash
347-
$ /usr/hdp/current/kafka-broker/bin/kafka-console-consumer.sh --bootstrap-server <FQDN_WORKER_NODE>:9093 --topic topic1 --consumer.config ~/ssl/client-ssl-auth.properties --from-beginning
348-
```
349-
350320
## Next steps
351321

352322
* [What is Apache Kafka on HDInsight?](apache-kafka-introduction.md)
162 KB
Loading

0 commit comments

Comments
 (0)