Skip to content

Commit e20ed1d

Browse files
update: rework howto kafka-connect-debezium-mtls-pg (#930)
Co-authored-by: Harshini Rangaswamy <[email protected]>
1 parent 64af7bf commit e20ed1d

File tree

2 files changed

+76
-64
lines changed

2 files changed

+76
-64
lines changed

@

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
fix: broken link
2+
3+
# Please enter the commit message for your changes. Lines starting
4+
# with '#' will be ignored, and an empty message aborts the commit.
5+
#
6+
# Date: Wed Jul 2 16:21:57 2025 +0200
7+
#
8+
# On branch DOC-1450-update-stream-reactor-connector-docs-for-version-9-0-2-compatibility
9+
# Changes to be committed:
10+
# modified: docs/products/kafka/kafka-connect/howto/cassandra-streamreactor-sink.md
11+
# modified: docs/products/kafka/kafka-connect/howto/influx-sink.md
12+
# modified: docs/products/kafka/kafka-connect/howto/redis-streamreactor-sink.md
13+
#

docs/products/kafka/kafka-connect/howto/kafka-connect-debezium-tls-pg.md

Lines changed: 63 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,45 @@
22
title: Integrate Aiven for Apache Kafka® Connect with PostgreSQL using Debezium with mutual TLS
33
---
44

5-
Integrate Aiven for Apache Kafka Connect with PostgreSQL using Debezium with mutual TLS (mTLS) to enhance security with mutual authentication.
5+
Integrate Aiven for Apache Kafka® Connect with PostgreSQL using Debezium with mutual TLS (mTLS) to enhance security with mutual authentication.
66

77
This configuration establishes a secure and efficient data synchronization channel
8-
between Aiven for Apache Kafka Connect and a PostgreSQL database.
8+
between Aiven for Apache Kafka® Connect and a PostgreSQL database.
99

1010
## Prerequisites
1111

12-
Before you begin, ensure you have the following:
13-
14-
- Access to an Aiven for Apache Kafka service with
15-
[Apache Kafka Connect](/docs/products/kafka/kafka-connect/howto/enable-connect)
16-
enabled.
12+
- Access to an Aiven for Apache Kafka® and Aiven for Apache Kafka® Connect service.
1713
- Administrative access to a PostgreSQL database with SSL enabled.
18-
- The following SSL certificates and keys obtained from your PostgreSQL database:
19-
- SSL client certificate: The public certificate for client authentication.
20-
- SSL root certificate: The certificate of the Certificate Authority (CA) that signed
21-
the servers' and clients' certificates.
22-
- SSL client key: The client's private key is used to encrypt the data sent to the
23-
server.
24-
For additional details, see
25-
[Certificate requirements](/docs/platform/concepts/tls-ssl-certificates#certificate-requirements).
14+
- The following SSL certificates and keys from your PostgreSQL database:
15+
- Client certificate: Public certificate for client authentication.
16+
- Root certificate: Certificate authority (CA) certificate used to sign the server
17+
and client certificates.
18+
- Client key: Private key for encrypting data sent to the server.
19+
20+
For additional details, see [Certificate requirements](/docs/platform/concepts/tls-ssl-certificates#certificate-requirements).
2621

2722
### For CloudSQL PostgreSQL databases
2823

29-
If you're integrating with a CloudSQL database, perform these additional steps only if
30-
they are not already configured:
24+
If you are using CloudSQL, complete these additional steps if they are not already
25+
configured:
3126

32-
- **IP whitelisting**: Whitelist Aiven's IP addresses to allow connections
33-
from Apache Kafka Connect to reach your CloudSQL database.
34-
- **Configure WAL and logical decoding**:
35-
- To capture database change events, `set cloudsql.logical_decoding` to `on`.
36-
- To configure the Write-Ahead Log (WAL) for logical replication, set
37-
`cloudsql.enable_pglogical` to` on`.
38-
- Restart the CloudSQL instance to apply changes.
39-
- **Activate the `pgoutput` extension**: In your
40-
CloudSQL instance, enable the extension Debezium uses for logical decoding:
27+
- **Allow Aiven IP addresses**: Whitelist Aiven IP addresses to enable connections
28+
from Apache Kafka Connect to your CloudSQL instance.
29+
30+
- **Enable WAL and logical decoding**:
31+
- Set `cloudsql.logical_decoding` to `on` to capture database change events.
32+
- Set `cloudsql.enable_pglogical` to `on` to configure the Write-Ahead Log (WAL)
33+
for logical replication.
34+
- Restart the CloudSQL instance to apply the changes.
35+
- **Enable the `pgoutput` extension**
36+
In your CloudSQL instance, enable the extension that Debezium uses for logical decoding:
4137

4238
```SQL
4339
CREATE EXTENSION pgoutput;
4440
```
4541

46-
- **Verify SSL certificates**: After whitelisting IPs, ensure your SSL configuration is
47-
correct by testing the database connection:
42+
- **Verify SSL configuration**: After whitelisting IP addresses, test the SSL
43+
connection to ensure your certificates are configured correctly:
4844

4945
```bash
5046
psql "sslmode=verify-ca \
@@ -57,18 +53,34 @@ they are not already configured:
5753
dbname=<YOUR_DB_NAME>"
5854
```
5955

60-
- **Set Debezium output plugin**: Use `pgoutput` or `decoderbufs` as the `plugin.name` in
61-
your Debezium connector for logical decoding.
56+
- **Set the Debezium output plugin**: Set the `plugin.name` field in the connector
57+
configuration to either `pgoutput` or `decoderbufs`.
6258

63-
:::note
64-
Starting with Debezium 2.5, the `wal2json` plugin is deprecated. You can use
65-
either `pgoutput` or `decoderbufs` as the recommended replacement plugin.
66-
:::
59+
:::note
60+
Starting with Debezium 2.5, the `wal2json` plugin is deprecated. Use `pgoutput` or
61+
`decoderbufs` as the recommended replacement.
62+
:::
63+
64+
## Limitations
65+
66+
- The integration is not yet available in the Aiven Console. Use the Aiven CLI or Aiven
67+
API instead.
68+
- A dedicated Aiven for Apache Kafka® Connect service is required. Enabling Kafka Connect
69+
within the same Aiven for Apache Kafka® service is not supported for this integration.
70+
- The `kafka_connect_postgresql` integration type is not yet available in the Aiven
71+
Console.
72+
- Delivering SSL keys to Aiven for Apache Kafka Connect is asynchronous. There may be a
73+
delay of up to five minutes between creating the integration and using the keys.
74+
- Mutual authentication in `verify-full` SSL mode is not supported in the Apache Kafka
75+
setup. The `verify-ca` mode remains secure because the Certificate Authority (CA) is
76+
unique to the instance.
77+
- For CloudSQL PostgreSQL databases, enable logical decoding and the `pgoutput`
78+
extension to ensure replication compatibility.
6779

6880
## Variables
6981

70-
The following table lists the variables for the configuration steps. Replace them with
71-
your actual environment values in the provided code snippets:
82+
Replace the placeholders in the following table with values from your environment. Use
83+
these values in the configuration steps and code snippets.
7284

7385
| Variable | Description |
7486
|-------------------------------|----------------------------------------------------|
@@ -83,8 +95,8 @@ your actual environment values in the provided code snippets:
8395

8496
## Configure the integration
8597

86-
1. Verify your existing Aiven for Apache Kafka service is active and accessible.
87-
If you don't have one, create an Apache Kafka cluster using this command:
98+
1. Verify that your Aiven for Apache Kafka® service is active and accessible. If you do
99+
not have a Kafka service, create one:
88100

89101
```bash
90102
avn service create <kafka_cluster_name> \
@@ -100,8 +112,9 @@ your actual environment values in the provided code snippets:
100112
manually create topics before starting the connector.
101113
:::
102114

103-
1. Create an Apache Kafka Connect service and configure it to communicate with your
104-
Aiven for Apache Kafka service:
115+
1. Verify that your Aiven for Apache Kafka® Connect service is active and accessible. If
116+
you do not have one, use the following command to create it and connect it to your
117+
Kafka service:
105118

106119
```bash
107120
avn service create <kafka_connect_name> \
@@ -111,10 +124,10 @@ your actual environment values in the provided code snippets:
111124
--project $PROJECT
112125
```
113126

114-
1. Create an external PostgreSQL integration endpoint to represent your PostgreSQL
115-
database. Use the following JSON configuration and replace the placeholders:
127+
1. Create an external PostgreSQL integration endpoint. This endpoint represents your
128+
PostgreSQL database. Replace the placeholders in the following JSON configuration:
116129

117-
```bash
130+
```bash
118131
INTEGRATION_CONFIG=$(cat <<-END
119132
{
120133
"ssl_mode": "verify-ca",
@@ -136,7 +149,7 @@ your actual environment values in the provided code snippets:
136149
137150
```
138151
139-
1. Retrieve endpoint ID of the integration endpoint you just created using this command:
152+
1. Retrieve the ID of the external PostgreSQL integration endpoint:
140153
141154
```bash
142155
INTEGRATION_ENDPOINT_ID=$(
@@ -146,7 +159,7 @@ your actual environment values in the provided code snippets:
146159
)
147160
```
148161
149-
1. Connect PostgreSQL endpoint to Apache Kafka Connect:
162+
1. Integrate the Apache Kafka® Connect service with the external PostgreSQL endpoint:
150163
151164
```bash
152165
avn service integration-create \
@@ -157,7 +170,7 @@ your actual environment values in the provided code snippets:
157170
```
158171
159172
1. Create the Debezium connector configuration to monitor your PostgreSQL database.
160-
Replace the placeholders with your PostgreSQL and Apache Kafka Connect information:
173+
Replace the placeholders with your PostgreSQL and Apache Kafka® Connect information:
161174
162175
```bash
163176
CONNECTOR_CONFIG=$(cat <<-END
@@ -189,7 +202,7 @@ your actual environment values in the provided code snippets:
189202
--config "$CONNECTOR_CONFIG"
190203
```
191204
192-
where,
205+
Parameters:
193206
194207
- `name`: The connector instance name. For example, `debezium-postgres-connector`.
195208
- `connector.class`: The class of the PostgreSQL connector.
@@ -204,28 +217,14 @@ your actual environment values in the provided code snippets:
204217
- `topic.prefix`: The prefix for Kafka topics receiving database change events.
205218
- `database.tcpKeepAlive`: If set to `true`, it prevents database connection timeouts
206219
during inactivity.
207-
- `transforms` and `transforms.unwrap.type`: he data transformations.
220+
- `transforms` and `transforms.unwrap.type`: The data transformations.
208221
`ExtractNewRecordState` extracts the latest data state. These transformations are
209222
optional and should be used based on your specific requirements.
210223
211224
## Verification
212225
213-
Confirm the following after completing the setup:
226+
After completing the setup, confirm the following:
214227
215228
1. Apache Kafka Connect establishes a secure SSL connection with the PostgreSQL database.
216229
1. Apache Kafka topics exist as expected, whether created automatically or manually.
217-
1. Data is correctly streaming into topics using the naming pattern
218-
`{connector_name}.{database_name}.{table_name}`.
219-
220-
## Limitations
221-
222-
- The process of delivering SSL keys to Apache Kafka Connect is asynchronous.
223-
Therefore, a delay of approximately five minutes may occur from the creation of
224-
the integration to the operational use of the keys.
225-
- The Apache Kafka setup does not support mutual authentication in `verify-full` SSL mode.
226-
However, the `verify-ca` mode is secure since the Certificate Authority (CA) is
227-
specific to the instance.
228-
- For CloudSQL PostgreSQL databases, ensure logical decoding and the `pgoutput` extension
229-
are enabled for replication compatibility.
230-
- As of Debezium 2.5, `wal2json` is deprecated. It is recommended to use `pgoutput`
231-
or `decoderbufs` for WAL output plugins.
230+
1. Data is streaming into topics using the naming pattern `{connector_name}.{database_name}.{table_name}`.

0 commit comments

Comments
 (0)