Skip to main content

Create an Elasticsearch sink connector

Use an Elasticsearch sink connector to index the changes captured from your source database in Elasticsearch. The connector reads the Kafka topics you choose and writes each topic to an index.

Prerequisites​

Create the connector​

  1. Select Data platform → Workspace management, then select your workspace.

  2. On the Overview tab, under Services, select the CDC card.

  3. Select the Connectors tab, then select Create Connector.

    Connectors tab of a CDC Service with no connector yet and the Create Connector button

  4. On the Connector Information screen, enter a Name, select sink in Type, and select Elastic Search in Database.

    Connector Information screen of the Create Connector form with the Name, Type, and Database fields

  5. Select Next Step. On the Properties screen, enter the connection details, then select Test connection. Next Step becomes available after the test succeeds.

    Database Information section with the URL, Username, and Password fields

  6. On the same screen, choose a Converter class and set the four converter fields. Under Kafka topic, select +, then select the topics to read in the Select topics panel.

    Converter section with the Converter class, Converter key, Converter value, and schema enable fields

    Kafka topic section with the add and clear buttons, a Filter box, and one topic in the list

  7. Select Next Step. On the Additional properties screen, set the fields in the Task, Map table, and Error Tolerance sections.

    Task section with Number of tasks set to 1

    Map table section with Topic 1, the Create new table switch turned on, and an Index named users

    Error Tolerance section with the Mode list

  8. Select Next Step and check the settings on the Review screen.

  9. Select Create.

Connector settings​

Connector information​

FieldRequiredDescription
NameYesThe connector name. Use lowercase letters, digits, and hyphens (-) only. Upper-case letters, _, ., and spaces are rejected with "Name has invalid characters".
TypeYesSelect sink.
DatabaseYesSelect Elastic Search.

Properties​

This connector has no From FPT Database Engine option. Enter the connection details in the Database Information section. See Connection mode for how Test connection works.

FieldRequiredDescription
URLYesThe address of your Elasticsearch cluster, including the scheme, such as https://. Without a scheme, the form shows "URL must be a valid uri".
UsernameYesThe username the connector uses to connect to Elasticsearch.
PasswordYesThe password for that user.
Converter classYesThe converter class for this connector. The portal offers Elasticsearch. The four converter fields stay greyed out until you choose a class. See Converter.
Converter key, Converter key schema enable, Converter value, Converter value schema enableYesHow the connector reads the keys and values of the messages, and whether they carry a schema. With Elasticsearch, Converter key offers only org.apache.kafka.connect.storage.StringConverter and Converter key schema enable only false. Converter value offers only org.apache.kafka.connect.json.JsonConverter, and Converter value schema enable true or false.
Kafka topicYesThe topics to read, up to 100. Select + to open the Select topics panel, select the topics, then select Select. See Topics.

Additional properties​

FieldRequiredDescription
Number of tasksYesThe maximum number of tasks that run in parallel. Default 1. See Tasks max.
Topic 1, Create new table, Index (under Map table)YesThe index that receives the records of each topic. Turn on Create new table and enter a name to create a new index, or turn it off and select an existing index. See Map table.
Mode (under Error Tolerance)YesWhat the connector does with a message that it cannot read or convert. None stops the connector with status Failed. All skips the message and sends it to the topic you enter for failed records. The field has no default. See Error tolerance.

Next steps​