Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support kafka with security certification #186

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

Nicole00
Copy link
Contributor

@Nicole00 Nicole00 commented Dec 5, 2023

close #185

support kerberos, SASL, SASL_PLAINTEXT.

How to use:

  • if the kafka is not security certificated, then just config the following common configs:

      service:"127.0.0.1:9092"
      topic:"test"
      interval.seconds:10
      startingOffsets:earliest
      maxOffsetsPerTrigger:0
    
  • if the kafka is security certificated by Kerberos, then add the following configs on the base of common configs:

    securityProtocol:SASL_PLAINTEXT
    mechanism:GASSAPI
    kerberos:true
    kerberosServiceName:kafka
    

When submit the exchange to spark, we need to config the kafka_client_jaas.conf and the krb5.conf for driver and executor :

spark-submit --master xxx \
 --conf "spark.driver.extraJavaOptions=-Djava.security.auth.login.config=/path/kafka_client_jaas.conf -Djava.security.krb5.conf=/path/krb5.conf" \
--conf "spark.executor.extraJavaOptions=-Djava.security.auth.login.config=path//kafka_client_jaas.conf -Djava.security.krb5.conf=path/krb5.conf" \
--files /local/path/to/kafka_client_jaas.conf,/local/path/to/kafka.keytab,/local/path/to/krb5.conf \
--class  com.vesoft.nebula.exchange.Exchange  \
nebula-exchange-2.4-3.0-SNAPSHOT.jar -c application.conf
  • if the kafka is security certificated by other security protocol, then just add the following configs on the base of common configs:

    securityProtocol:SASL_PLAINTEXT
    mechanism:GASSAPI
    

When submit the exchange to spark, we need to config the kafka_client_jaas.conf and the krb5.conf for driver and executor :

 spark-submit --master xxx \
 --conf "spark.driver.extraJavaOptions=-Djava.security.auth.login.config=/path/kafka_client_jaas.conf" \
 --conf "spark.executor.extraJavaOptions=-Djava.security.auth.login.config=path//kafka_client_jaas.conf" \
 --files /local/path/to/kafka_client_jaas.conf \
 --class  com.vesoft.nebula.exchange.Exchange  \
 nebula-exchange-2.4-3.0-SNAPSHOT.jar -c application.conf

@Nicole00
Copy link
Contributor Author

Nicole00 commented Dec 6, 2023

description for parameters:

securityProtocol:              optional, String type, no default value. the security protocol for kafka
mechanism:                     optional, String type, no default value. the sasl mechanism for kafka
kerberos:true                  optional, boolean type, default value is false. if the security mechanism is 'kerberos'
kerberosServiceName:           optional, String type, no default value. the kerberos service name,  if the kerberos config is true, then kerberosServiceName must be config too.

@Nicole00 Nicole00 merged commit c372132 into vesoft-inc:master Dec 6, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc affected PR: improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support kafka with security certification
2 participants