This guide walks you through the steps to connect to a Kafka cluster on DigitalOcean using Kadeck. By following these instructions, you'll be able to set up a secure connection to your Kafka cluster and start managing your topics seamlessly.
Prerequisites
- A Kafka cluster on DigitalOcean.
- Kadeck installed on your machine.
Step 1: Obtain the Connection Details
After creating your Kafka cluster on DigitalOcean, you will receive the necessary connection details. These typically include:
- `bootstrap.servers`: The address of your Kafka cluster ("service uri").
- `security.protocol`: The security protocol, usually `SASL_SSL`.
- `sasl.mechanism`: The SASL mechanism, typically `SCRAM-SHA-256`.
- `sasl.jaas.config`: The JAAS configuration, including your username and password.
Example:
bootstrap.servers=db-kafka-****-do-user-****.db.ondigitalocean.com:25073
security.protocol=SASL_SSL
sasl.mechanism=SCRAM-SHA-256
sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="doadmin" password="YOUR_PASS";
Step 2: Use the Connection Wizard for Apache Kafka properties
Replace the placeholders with your credentials and use the Connection Wizard for Apache Kafka properties.
Step 3: Download the CA Certificate
To establish a secure SSL connection, download the CA certificate provided by DigitalOcean.
Step 4: Create a Truststore
You need to import the CA certificate into a Java KeyStore (JKS) file, which Kadeck uses to establish a secure connection. Run the following command in your terminal to create the truststore:
keytool -import -alias mycacert -file ca-certificate.crt -keystore truststore.jks -storepass your_password
Replace `your_password` with a strong password of your choice.
1. In the "Truststore" section, click on "Browse file" and select the `truststore.jks` file you created.
2. Enter the password you used for the truststore (`your_password` in the example above).
Step 5: Test the Connection
Click on "Test Connection." If everything is set up correctly, you should receive a success message.
Troubleshooting
If the connection fails, it is likely due to an issue with the truststore or the password used for it. You can verify the truststore and its password with the following command:
keytool -list -v -keystore truststore.jks
You will be prompted to enter the password for the truststore. Ensure that it matches the password you provided during the creation of the truststore.
Conclusion
Following these steps should allow you to connect to your Kafka cluster on DigitalOcean using Kadeck without any issues. If you encounter further problems, double-check your truststore and credentials.