簡體   English   中英

在KAFKA中啟用SSL時獲取SSL握手錯誤

[英]Getting SSL handshake error while Enabling SSL in KAFKA

當我啟動生產者推送數據時,我得到SSL握手失敗,做了以下設置:

1. Followed steps as per 
    https://docs.confluent.io/2.0.0/kafka/ssl.html to create keystore
2.  Started zookeeper with default settings
3.  Made below changes in kafka server properties:
    a.  listeners=SSL://hostName:9092
    b.  ssl.keystore.location =/home/kafka_2.12- 
       2.2.0/kafka.server.keystore.jks
    c.  ssl.keystore.password =keystore
    d.  ssl.key.password =keystore
    e.  ssl.truststore.location =/home/kafka_2.12- 
       2.2.0/kafka.server.truststore.jks
    f.  ssl.truststore.password =keystore
    g.  ssl.endpoint.identification.algorithm=HTTPS
    h.  advertised.listeners=SSL://hostName:9092
    i.  inter.broker.listener.name=SSL
    j.  listener.security.protocol.map=SSL:SSL

完成上述步驟后,我能夠啟動kafka服務器並啟動服務器。

Command bin/zookeeper-shell.sh localhost:2181 <<< "get /brokers/ids/0" gave below output that means broker id 0 was up and listening  on 
SSL://hostName:9092
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is disabled
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
{"listener_security_protocol_map":{"SSL":"SSL"},"endpoints": 
["SSL://hostName:9092"]
 ,"jmx_port":-1,"host":null,"timestamp":"1559106754150" 
 ,"port":-1,"version":4}
cZxid = 0x425
ctime = Wed May 29 10:42:34 IST 2019
mZxid = 0x425
mtime = Wed May 29 10:42:34 IST 2019
pZxid = 0x425
cversion = 0
dataVersion = 1
aclVersion = 0
ephemeralOwner = 0x1004d6fe052000a
dataLength = 159
numChildren = 0

但是當我啟動kafka生產者推送數據時,我在kafka服務器控制台上遇到了SSL握手錯誤

要啟動生產者bin / kafka-console-producer.sh --broker-list hostName:9092 --topic test3

[2019-05-29 10:45:57,808] INFO [SocketServer brokerId=0] Failed 
authentication with /101.101.101.101 (SSL handshake failed) 
(org.apache.kafka.common.network.Selector)
[2019-05-29 10:45:58,143] INFO [SocketServer brokerId=0] Failed 
authentication with /101.101.101.101 (SSL handshake failed) 
(org.apache.kafka.common.network.Selector)
[2019-05-29 10:45:58,728] INFO [SocketServer brokerId=0] Failed 
authentication with /101.101.101.101 (SSL handshake failed) 
(org.apache.kafka.common.network.Selector)
[2019-05-29 10:45:59,613] INFO [SocketServer brokerId=0] Failed 
authentication with /101.101.101.101 (SSL handshake failed) 
(org.apache.kafka.common.network.Selector)
[2019-05-29 10:46:00,600] INFO [SocketServer brokerId=0] Failed 
authentication with /101.101.101.101 (SSL handshake failed) 
(org.apache.kafka.common.network.Selector)
[2019-05-29 10:46:01,688] INFO [SocketServer brokerId=0] Failed 
authentication with /101.101.101.101 (SSL handshake failed) 
(org.apache.kafka.common.network.Selector)
[2019-05-29 10:46:02,928] INFO [SocketServer brokerId=0] Failed 
authentication with /101.101.101.101 (SSL handshake failed) 
(org.apache.kafka.common.network.Selector)

注意:Kafka代理服務器和生產者位於同一主機上

期望生產者應該將數據推送到在同一本地主機上運行的代理。 來自另一個節點的消費者應該能夠消費。 我們啟用SSL時應加密數據

正在使用單向握手。 現在通過實施雙向握手解決了這個問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM