Kafka clusters that you can connect to
A Kafka data source in Cloudera SQL Stream Builder (SSB) can point to a Kafka cluster on a Cloudera Base on premises cluster, in the same Anywhere Cloud compute cluster as Cloudera Streaming Analytics, in another Anywhere Cloud compute cluster, or outside Anywhere Cloud. What you enter for the brokers, the protocol, and the truststore depends on where the Kafka cluster runs.
SSB does not create a Kafka data source for you, and the Cloudera Streaming Analytics engine has no dependency on a Kafka engine. You register every Kafka cluster yourself, as a Kafka data source of your project. In every case, the brokers must be reachable from the SSB pod and from the Flink pods of your jobs, which run in the namespace of the Cloudera Streaming Analytics engine.
Kafka on a Cloudera Base on premises cluster
Connect the Cloudera Base Connector to the Cloudera Manager of the Cloudera Base on premises cluster, so that SSB and its jobs get the Kerberos and Hadoop configuration of that cluster. Then register the brokers as a Kafka data source:
- Brokers (Comma-separated List): the hostnames and ports of the Kafka brokers of the cluster. The hostnames must resolve from the Anywhere Cloud compute cluster.
- Protocol: the protocol of the broker listener, usually SASL/SSL or SASL/PLAINTEXT.
- SASL Mechanism: KERBEROS. The editor does not display a username or password for this mechanism.
- Truststore: for SSL listeners, the CA certificates of the Kafka cluster. Upload the truststore as a project file and select it with Use Project File.
For more information, see Adding data sources from Cloudera Base on premises clusters.
Kafka from Cloudera Streams Messaging on Anywhere Cloud
SSB connects to a Kafka cluster of Cloudera Streams Messaging as an external Kafka client, through the
external listener of the cluster. The external listener uses OAuth authentication over TLS
(SASL_SSL with OAUTHBEARER). You enter the same settings
whether the Kafka cluster runs in the same Anywhere Cloud compute cluster as Cloudera Streaming Analytics or in
another compute cluster.
Before you add the data source, complete the following tasks:
- Download the client configuration bundle of the Kafka cluster from the Client Configurations tab in Cloudera Surveyor, and generate client credentials. The bundle contains external.properties, kafka-ca.crt, and oauth-ca.crt. For the steps, see Connecting Kafka clients in the Cloudera Streams Messaging documentation.
- Check the Ranger policies of the Kafka cluster. The client credentials are bound to the Anywhere Cloud Console user who generates them, and Apache Ranger authorizes your jobs as that user. The user needs Kafka policies for the topics and consumer groups that your jobs use. For more information, see Configuring Ranger authorization for Kafka.
- Upload kafka-ca.crt and oauth-ca.crt to your project as project files.
Then add the Kafka data source with the following values:
- Brokers (Comma-separated List): the value of
bootstrap.serversin external.properties, for example[***KAFKA-INSTANCE***].[***CLUSTER-DOMAIN***]:8443 - Protocol: SASL/SSL
- SASL Mechanism: OAUTHBEARER
- OAuth Token Endpoint URL: the value of
sasl.oauthbearer.token.endpoint.urlin external.properties - Client ID: the
client_idof your client credentials - Client Secret: the
client_secretof your client credentials - Use default TrustStore: off
- Kafka truststore: the kafka-ca.crt project file, with Kafka TrustStore Type set to PEM
- OAuth truststore: the oauth-ca.crt project file, with OAuth TrustStore Type set to PEM
For the fields of the data source, see Configuring Kafka authentication.
Kafka in another Anywhere Cloud compute cluster
A Kafka cluster of Cloudera Streams Messaging in another compute cluster is reachable like any other engine. Whether the brokers are reachable from the compute cluster of Cloudera Streaming Analytics depends on the configuration of the Kafka cluster. Use the same settings as for a Kafka cluster in the same compute cluster, with the bootstrap address and the CA certificates from the client configuration bundle of that Kafka cluster. Anywhere Cloud does not mirror the Kafka services into the compute cluster of Cloudera Streaming Analytics, because the Cloudera Streaming Analytics engine has no dependency on a Kafka engine.
Kafka outside Anywhere Cloud
A Kafka cluster outside Anywhere Cloud, such as a managed Kafka service, works when its brokers are reachable from the Anywhere Cloud compute cluster network.
- Brokers (Comma-separated List): the public or private bootstrap addresses of the service.
- Protocol and SASL Mechanism: usually SASL/SSL with PLAIN, SCRAM-SHA-512, or OAUTHBEARER.
- Truststore: for brokers with certificates from a public CA, keep Use default TrustStore on. For a private CA, upload the truststore as a project file.
The default truststore
Use default TrustStore is available for the SSL and SASL/SSL protocols. On Anywhere Cloud, the engine does not configure a default truststore for SSB. The option therefore uses the default CA certificates of the Java runtime. These certificates include public CAs, but not the internal CAs of Anywhere Cloud or of your organization. For brokers with certificates from such a CA, turn the option off and select a truststore.
For more information, see Adding a Kafka data source and Configuring Kafka authentication.
