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

Create a sample docker compose file with kafka sasl ssl or sasl_plaintext enabled, to understand the properties needed #7096

Open
andsty opened this issue Oct 28, 2024 · 6 comments
Labels

Comments

@andsty
Copy link

andsty commented Oct 28, 2024

Describe the bug
Not able to fetch data from kafka with sasl_ssl enabled. Not clear documentation on this topic.
To Reproduce
Create a kafka cluster sasl ssl enabled and try to connect nussknacker
Environment (please fill in the following information):

  • OS: [e.g. Ubuntu 18.04]
  • Nussknacker version latest
    -latest
  • Docker image
@andsty andsty added the bug label Oct 28, 2024
@arkadius
Copy link
Member

Hi @andsty . Have you checked this documentation page?

@myrulezzz
Copy link

Hi.Yes i have checked it but it does not mention how to setup my docker-compose with this configuration.I was able to connect with my schema registry but it seems that i kanno connect with my kafka environment because my sasl definition in my docker compose is wrong.How can i reference my jaas config in my docker compose?

@arkadius
Copy link
Member

Ah, I see! In the installation example directory there is an application-customizations.conf file.

You should use it if you want to provide more advanced configuration that is not possible to achieve with only environment variables.

Please try with something like this:

scenarioTypes {
  "streaming" {
    modelConfig {
      components.kafka {
        config {
          kafkaProperties {
            "schema.registry.url": "http://schemaregistry:8081"
            "bootstrap.servers": "broker1:9092,broker2:9092"
            "security.protocol": "SASL_SSL"
            "sasl.mechanism": "PLAIN"
            "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"some_user\" password=\"some_user\";"
          }
        }
      }
    }
  }
}

and let me know if it helped you.

@andsty
Copy link
Author

andsty commented Oct 29, 2024

Ok Trying this configuration in my application yaml file i get the below error in designer logs when i select a topic form ui
2024-10-29 09:39:59.558 [kafka-admin-client-thread | adminclient-5] INFO o.apache.kafka.clients.NetworkClient - [AdminClient clientId=adminclient-5] Node -3 disconnected.
2024-10-29 09:39:59.558 [kafka-admin-client-thread | adminclient-5] INFO o.apache.kafka.clients.NetworkClient - [AdminClient clientId=adminclient-5] Cancelled in-flight METADATA request with correlation id 45 due to node -3 being disconnected (elapsed time since creation: 301ms, elapsed time since send: 301ms, request timeout: 21134ms)

@andsty
Copy link
Author

andsty commented Oct 29, 2024

And i see authorization error on kafka.
Is it possible there is an issue with the format passed in jaas config?

@arkadius
Copy link
Member

arkadius commented Oct 29, 2024

I recommend checking the configuration with some cli tool (e.g. kafka-console-consumer) executed in the same network. Nussknacker passes kafkaProperties to kafka client as they are, without changing anything so it is a low possibility that the problem is on the Nu side.

Example kafka-console-consumer invocation would look like:

./kafka-console-consumer.sh --topic <topic> --bootstrap-server <boostrap-servers> --consumer.config client.properties

And client.properties would contain:

security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="<username>" password="<password>";

See Confluent documentation for more details.

It is important to ensure that kafka-console-consumer was executed from the same network as the Designer. You might achieve that by adding another container for example using kafka image but with changed entrypoint to bash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants