fluidd/kafka :SASL 身份验证需要配置 SSL

问题描述 投票:0回答:3

我计划将日志发送到我们合作的弹性搜索集群。

我正在使用 td-agent 将日志转发到连接到合作弹性搜索集群的 Kafka 端点。我已经安装了 Fluent-plugin-kafka 插件和 td-agent,以将日志发送到连接到合作弹性搜索集群的 Kafka 端点

插件网址:https://github.com/ Fluent/fluence-plugin-kafka

日志发送路径如下:

logs --> td-agent+fluent-plugin-kafka --> kafka cluster --> elasticsearch --> kibana

问题是,Kafka端点配置为支持SASL身份验证而不支持SSL,由于日志仅通过合作网络路由,我想不需要SSL支持。

我收到以下错误:

  2019-04-30 17:46:39 +0900 [error]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.3.3/bin/fluentd:8:in `<top (required)>'
  2019-04-30 17:46:39 +0900 [error]: #0 /opt/td-agent/embedded/bin/fluentd:23:in `load'
  2019-04-30 17:46:39 +0900 [error]: #0 /opt/td-agent/embedded/bin/fluentd:23:in `<main>'
2019-04-30 17:46:39 +0900 [error]: #0 unexpected error error_class=ArgumentError error="SASL authentication requires that SSL is configured"
  2019-04-30 17:46:39 +0900 [error]: #0 suppressed same stacktrace
2019-04-30 17:46:39 +0900 [info]: Worker 0 finished unexpectedly with status 1
^C

我的 td-agent 配置是:

#
<source>
  @type dummy
  dummy {"hello":"world"}
  tag test
</source>

<match test>
  @type kafka2
  brokers               stg-ageapdsk101.stg.hnd2.bdd.local:9002,stg-ageapdsk102.stg.hnd2.bdd.local:9002,stg-ageapdsk103.stg.hnd2.bdd.local:9002
  principal             '[email protected]'
  keytab                'appuser.keytab'
  client_id             'kafka'
  sasl_over_ssl         false
  get_kafka_client_log  true
  <format>
    @type json
  </format>
  topic_key             'stg_esd_app_elk_1'
  get_kafka_client_log  true

  <buffer topic>
    flush_interval 10s
  </buffer>
</match>

请帮我解决这个问题。

security networking apache-kafka fluentd sasl
3个回答
0
投票

在具有Kerberos身份验证(GSSAPI)的cloudera 6.3环境中,fluidd v1.9.2插件fluid-plugin-kafkav0.13.0、out_kafka2不起作用。作为同一插件中的替代模块,我尝试了 rdkafka2,它现在可以工作了。

详情;

原理和keytab与kafka2相同

rdkafka2 特有的参数 服务名称“卡夫卡”

您可以检查代码,因为它填充了GSSAPI、SASL_PAINTEXT场景的所有必要参数。

if @principal
sasl = true
config[:"sasl.mechanisms"] = "GSSAPI"
config[:"sasl.kerberos.principal"] = @principal
config[:"sasl.kerberos.service.name"] = @service_name if @service_name
config[:"sasl.kerberos.keytab"] = @keytab if @keytab
end

  if ssl && sasl
    security_protocol = "SASL_SSL"
  elsif ssl && !sasl
    security_protocol = "SSL"
  elsif !ssl && sasl
    security_protocol = "SASL_PLAINTEXT"
  else
    security_protocol = "PLAINTEXT"
  end
  config[:"security.protocol"] = security_protocol

除此之外,不要忘记添加环境变量 -Djava.security.auth.login.config=/home/user/jaas.conf 有关 jaas conf 的详细信息,请点击此link


0
投票

这为我解决了这个问题 使用

sasl_over_ssl: false


-3
投票

不要使用 sasl_over_ssl false,而是使用没有值的 ssl_ca_cert
例如
client_id '卡夫卡'
ssl_ca_cert
密钥表'appuser.keytab

谢谢

© www.soinside.com 2019 - 2024. All rights reserved.