Adding a Kafka data source

Register a Kafka cluster as a data source so that you can create Kafka tables in your project. You provide the brokers, the security protocol, and the credentials.

  • Complete the credentials and the certificates. For more information, see Configuring Kafka authentication.
  • Find out where the Kafka cluster runs, and which addresses and truststore to use. For more information, see Kafka clusters that you can connect to.
  • If you use truststore or keystore files, upload them to the project first. For more information, see Managing project files.

A data source registers the Kafka cluster. To use a topic from the cluster as a source or a sink in your SQL jobs, you then create a Kafka table for the topic. In the Explorer, open the menu of Virtual Tables, and click New Kafka Table. For more information, see Creating Kafka tables with the wizard. You can also create the table with DDL. For more information, see Registering a Kafka data source with DDL.

  1. In the Streaming SQL Console, click Projects in the left navigation pane, and click the name of your project.
    The project opens, with the Explorer panel on the left. To open the Streaming SQL Console, see Accessing Cloudera SQL Stream Builder.
  2. In the Explorer, open the menu of Kafka under Data Sources, and click New Kafka Data Source.
    The New Kafka Data Source editor opens in a tab of the workspace.
  3. In Name, enter a name for the data source.
  4. In Brokers (Comma-separated List), enter the broker addresses, each as [***HOST***]:[***PORT***].
  5. In Protocol, select the security protocol of the broker listener: PLAINTEXT, SSL, SASL/SSL, or SASL/PLAINTEXT.
  6. For SSL or SASL/SSL, configure the TLS stores.
    1. To trust the certificates of the default truststore, keep Use default TrustStore on. Otherwise, turn it off.

      On Anywhere Cloud, the default truststore is the truststore of the Java runtime, which holds the public CA certificates. For brokers with certificates from a private CA, turn the option off and select a truststore.

    2. Under Kafka TrustStore, select a file.
      To use a file that you uploaded to the project, turn on Use Project File, and select the file in TrustStore Project File. Otherwise, enter the path in TrustStore File Path. For more information, see Managing project files.
    3. In Kafka TrustStore Type, select JKS, PKCS12, BCFKS, or PEM.
    4. Optional: Optional: Enter the Kafka TrustStore Password (Optional).
    5. Optional: Optional: If the brokers require client authentication, configure Kafka KeyStore (Optional).
      Select Use Project File and the KeyStore Project File, or enter the KeyStore File Path, and enter the Kafka KeyStore Password (Optional).
  7. For SASL/SSL or SASL/PLAINTEXT, select the SASL Mechanism and enter its credentials.
    For more information, see Configuring Kafka authentication.
  8. Optional: Optional: Under Custom Properties, add Kafka client properties.
    For each one, enter a Property Key and a Property Value.
  9. Click Validate.
    Cloudera SQL Stream Builder (SSB) connects to the brokers. If the connection succeeds, the message Validation was successful, N topic(s) found. is displayed in the editor. If it fails, a validation error is displayed in the editor.
  10. Click Create.
    A notification confirms that the data source was saved. The data source is displayed under Kafka in the Explorer.

To change a data source, click Manage in the menu of Kafka, and click the data source. When you edit, a Modify switch is displayed for fields that hold secrets. Turn it on only when you want to replace the stored value. Click Save to keep the changes.

To remove a data source, open its Controls menu, and click Delete. In the Delete Kafka Data Source dialog, click Delete.