Connectors

Kafka Connect connectors, their tasks, and their configuration are monitored and managed from the Connectors page in Cloudera Surveyor for Apache Kafka.

Connectors page

The Connectors page lists all connectors on the selected Kafka Connect cluster. Monitor the status and state of each connector and of its tasks. Filter and sort connectors by name, status, state, or type. Add new connectors as needed.

Figure 1. Connectors page

At the top of the page, health summary tiles display the total number of connectors on the selected Kafka Connect cluster categorized by status.

Beneath the tiles, a table displays the following connector attributes:

  • Name – The unique name of the connector on the Kafka Connect cluster. Click to open the Connector Details page.
  • Status – The overall health status of the connector.
  • State – The runtime state of the connector in Kafka Connect, such as Running, Paused, or Failed.
  • Type – The direction in which the connector moves data. A Source connector moves data from an external system into Kafka. A Sink connector moves data from Kafka into an external system.
  • Tasks – The number of tasks of the connector, followed by the number of tasks in each status.
  • Plugin Name – The short name of the connector plugin, which is its class name without the package name. For example, JdbcSinkConnector.

Click Add Connector to add a new connector. Click any connector row to open the Entity Details drawer for quick access to all connector attributes. Click the connector name to go to the Connector Details page.

Connector Details page

The Connector Details page provides information about an individual connector and its tasks. At the top of the page, a summary displays the status, state, type, and task count of the connector, together with the class name of its plugin and its maximum number of tasks. Use the Actions menu at the top right of the page to start, stop, pause, restart, or delete the connector.

Figure 2. Connector Details page

The page organizes connector information through the following tabs:

  • Tasks – View the tasks of the connector, the status and state of each task, and the Kafka Connect worker that runs it. When a task has an error, click View Error in its row to display the error trace. Restart an individual task with the icon on the right side of its row.

  • Configuration – View and edit the configuration properties of the connector. Validate your changes against the connector plugin before you apply them.

  • Topics – View the Kafka topics that the connector has read from or written to.

Adding connectors

Add new connectors to a Kafka Connect cluster in Cloudera Surveyor using the Add Connector option on the Connectors page.

A connector moves data between Kafka and an external system. A source connector reads data from an external system, such as a database, and writes it to Kafka topics. A sink connector reads data from Kafka topics and writes it to an external system. The connector plugin, installed on the Kafka Connect cluster, provides the logic of the connector, and the configuration properties tell the connector what to read and where to write. Kafka Connect divides the work of a connector into tasks, which run in parallel.

In Cloudera Surveyor, you add connectors using the Connectors > Add Connector option, which opens the Add Connector drawer. In the drawer, you name the connector, select its plugin, set its maximum number of tasks, and enter the configuration properties that the plugin requires. Before you create the connector, you can validate the configuration against the plugin. Kafka Connect checks every property and reports missing and invalid values, so you can fix them before the connector starts.

  • You must have the necessary permissions to add and validate connectors in Kafka Connect. In Apache Ranger, the required permissions are as follows:

    • View on the Cluster resource and Create on the Connector resource to add a connector.

    • Validate on the Cluster resource to validate the connector configuration.

  • The plugin of the connector must be installed on the Kafka Connect cluster. You can check the installed plugins on the Plugins tab of the Connect Cluster Details page.

  • The configuration properties of a connector depend on its connector plugin. Check the documentation of the plugin for the properties it requires.

  1. In Cloudera Surveyor, click Connectors.
  2. At the top left, next to the page title, click the Cluster: selector and select your Kafka Connect cluster from the list.
  3. Click Add Connector at the top right of the table.
  4. Configure the following mandatory properties in the Add Connector drawer:
    • Name – The unique name of the connector on the Kafka Connect cluster.

    • Connector Plugin – The source or sink connector plugin installed on the Kafka Connect cluster that the connector runs. The list displays the full class name of each plugin. Type in the field to search the list.

    • Tasks Max – The maximum number of tasks the connector can create, set as the tasks.max property. The value must be at least 1.

  5. Add the configuration properties of the connector in the Properties section.
    1. Click the icon.
    2. Enter the name of the property in the Property Name field and its value in the Property Value field.
    3. Click the icon to confirm your entry.
    4. To edit an existing property, click the icon in its row and change the name or value.
    5. Remove an existing property with the option, or click Clear All to remove all properties.

    The values of properties whose names contain password, secret, token, credential, or passphrase, such as ssl.keystore.password, are treated as sensitive. The value of a sensitive property is masked while you type and displayed as ••••••••. Click the or icon to show or hide the value.

  6. Click Validate.
    The connector configuration is sent to Kafka Connect for validation. Any issues found are highlighted in the form. Fix the problems and click Validate again.
  7. Click Create Connector.
  8. In the Create Connector confirmation dialog, click Create.
    The connector is deployed to the Kafka Connect cluster and starts its tasks right away. A notification reminds you that not all tasks might load immediately. Until they do, the connector remains in the Unknown state.
The connector is created in Kafka Connect. However, the new connector will not be visible in Cloudera Surveyor until the next Kafka Connect snapshot is taken and data from the new snapshot is published to the UI.

Verify that the connector is running. After the connector appears on the Connectors page, click its Name to open the Connector Details page, and check that the state of the connector and of each task on the Tasks tab is Running. If a task is Failed, click View Error in its row to display the error trace.

Updating connector configuration

Update the configuration properties of connectors in Cloudera Surveyor using the Apply Changes option on the Configuration tab of the Connector Details pages.

The configuration properties of a connector determine what the connector does, such as which topics it reads from, which external system it connects to, and how many tasks it can run. In Cloudera Surveyor, you update these properties using the Connectors > Connector Details > Configuration > Apply Changes option. The Configuration tab lists all properties of the connector. You can edit, add, and delete properties, validate the result, and then apply all changes in a single operation. Modified properties are marked with a Modified tag, and changes are staged for review before being applied. If you switch tabs with unsaved changes, a warning is displayed. If you leave the page, your edits are preserved until you return.

You update a connector, for example, to point a sink connector to a new database, or to increase tasks.max so that the connector can process data in more tasks in parallel.

The connector name (name) and the connector plugin (connector.class) are locked. You can change the value of the maximum number of tasks (tasks.max), but you cannot remove it.

  • You must have the necessary permissions to update and validate connectors in Kafka Connect. In Apache Ranger, the required permissions are as follows:

    • View on the Cluster resource and Edit on the Connector resource to update connector configuration.

    • Validate on the Cluster resource to validate the connector configuration.

  1. In Cloudera Surveyor, click Connectors.
  2. At the top left, next to the page title, click the Cluster: selector and select your Kafka Connect cluster from the list.
  3. Click the Name of a connector to open the Connector Details page for that connector.
  4. Go to the Configuration tab.
  5. Edit the properties of the connector.
    • To change the value of a property, click the icon in its row, enter the new value in the Property Value field, and click the icon.

    • To add a property, click the icon, enter the name and value of the property, and click the icon.

    • To remove a property, click the icon in its row. Clear All removes all properties except name, connector.class, and tasks.max.

    • To discard all edits and revert to the currently deployed configuration, click Discard Changes.

    The values of properties whose names contain password, secret, token, credential, or passphrase, such as ssl.keystore.password, are treated as sensitive. The value of a sensitive property is masked while you type and displayed as ••••••••. Click the or icon to show or hide the value.

    Saved sensitive values are never read back. When you edit a sensitive property, leave the value field empty to keep the saved value, or enter a new value to replace it.

  6. Click Validate.
    The connector configuration is sent to Kafka Connect for validation. Any issues found are highlighted in the form. Fix the problems and click Validate again.
  7. Review your changes and click Apply Changes.
  8. In the Connector Configuration Changes confirmation dialog, click Apply.
The configuration is applied to the connector in Kafka Connect. However, the updated configuration will not be visible in Cloudera Surveyor until the next Kafka Connect snapshot is taken and data from the new snapshot is published to the UI.

Managing the connector lifecycle

Start, stop, pause, restart, or delete connectors in Cloudera Surveyor using the Actions menu on the Connector Details page.

A connector runs as a connector instance and a set of tasks on the workers of the Kafka Connect cluster. The connector instance coordinates the work, and the tasks move the data. In Cloudera Surveyor, you control a connector using the Connectors > Connector Details > Actions menu.

Choose the action based on how long you want to interrupt data movement. Pause a connector for a short interruption, for example, while you perform maintenance on the database that a sink connector writes to. Stop a connector for a longer interruption, because a stopped connector releases its tasks. Restart a connector to recover the connector instance from a failure.

  • You must have the necessary permissions to manage connectors in Kafka Connect. In Apache Ranger, the required permissions are as follows:

    • View on the Cluster resource and Manage on the Connector resource to start, stop, pause, and restart a connector.

    • View on the Cluster resource and Delete on the Connector resource to delete a connector.

  • Restarting a connector does not restart its tasks. You must restart tasks individually.
  1. In Cloudera Surveyor, click Connectors.
  2. At the top left, next to the page title, click the Cluster: selector and select your Kafka Connect cluster from the list.
  3. Click the Name of a connector to open the Connector Details page for that connector.
  4. Click Actions at the top right of the page and select an action.

    The menu lists all actions. Actions that do not apply to the current state of the connector are disabled.

    • Start – Starts a stopped connector or resumes a paused connector. Disabled when the connector is Running.

    • Stop – Shuts down the connector and its tasks. Disabled when the connector is Stopped.

    • Pause – Suspends the connector and its tasks. Disabled when the connector is Paused.

    • Restart – Restarts the connector instance. The tasks of the connector are not restarted. Disabled when the connector is Paused or Stopped.

    • Delete – Deletes the connector from the Kafka Connect cluster.

  5. If you selected Delete, type delete in the Delete Connector confirmation dialog and click Delete.
The action is applied to the connector in Kafka Connect. However, the updated state of the connector will not be visible in Cloudera Surveyor until the next Kafka Connect snapshot is taken and data from the new snapshot is published to the UI.

Restarting connector tasks

Restart an individual task of a connector in Cloudera Surveyor from the Tasks tab of the Connector Details page, for example, to recover a task that failed.

The tasks of a connector move the data. Each task can fail independently of the connector and the other tasks. For example, a task fails when the external system it reads from or writes to is unavailable. After you fix the cause of the failure, restart the task on the Connectors > Connector Details > Tasks tab.

  • You must have the necessary permissions to restart connector tasks in Kafka Connect. In Apache Ranger, the required permissions are View on the Cluster resource and Manage on the Connector resource.

  1. In Cloudera Surveyor, click Connectors.
  2. At the top left, next to the page title, click the Cluster: selector and select your Kafka Connect cluster from the list.
  3. Click the Name of a connector to open the Connector Details page for that connector.
    The Tasks tab opens by default.
  4. Click the icon on the right side of the row of the task that you want to restart.
The task is restarted in Kafka Connect. However, the updated state of the task will not be visible in Cloudera Surveyor until the next Kafka Connect snapshot is taken and data from the new snapshot is published to the UI.

Using inline and file-based sensitive data in connector configurations

Store connector credentials using the Secret Service in Anywhere Cloud, share secrets with the Connect cluster's workload identity, and reference them in connector configurations using secret references.

Connectors often read from and write to secured external services and require sensitive data such as passwords, API keys, and TLS certificates to establish a connection. Some connector properties expect file path references rather than inline string values. For example, a connector that uses SSL may require the path to a PEM certificate or a PKCS12 truststore file. The Secret Service in Anywhere Cloud Console addresses both problems. It stores sensitive data securely so that plaintext values never appear in a stored connector configuration. It also provides a way to supply file-based data to a connector.

In Cloudera Surveyor, you can reference data stored in secrets in your connector configuration using a dedicated syntax. You add these references either when creating a new connector or when editing the configuration of an existing connector.

  • A Vault is set up and connected in Anywhere Cloud Console. For instructions, see Configuring secrets.

  • You must have the sensitive data you want to store. For example, the password, certificate, or truststore file the connector needs to connect to its external system.

  • You must have access to a Bash-compatible shell environment with curl.

  1. Get and record your Console domain and session cookie.
    1. Log in to Anywhere Cloud Console.
    2. Look up and record your domain from your Anywhere Cloud Console console URL.
      Your domain is the portion of the URL that comes after console.. For example, if your console URL is https://console.my-awc.cloudera.com, your domain is my-awc.cloudera.com.
    3. Obtain and record the hadoop-jwt session cookie from your browser's developer tools.

      To do this, open browser developer tools and navigate to the Cookies section. Find the hadoop-jwt cookie and record its value.

      To open browser developer tools:

      • Chrome: Press F12 and go to Application > Cookies.
      • Firefox: Press F12 and go to Storage > Cookies.
      • Safari: Press Cmd+Option+I and go to Storage > Cookies.
  2. Find and record your Kafka Connect cluster's workload identity from Cloudera Surveyor.

    The workload identity is the SPIFFE ID the cluster uses to authenticate when it reads secrets. Cloudera Surveyor displays the ID in an instructional hint at the following two locations:

    • In the Add Connector drawer - Connectors > +Add Connector
    • On the Configuration tab of existing connectors - Connectors > Connector > Configuration
  3. Create a secret in Anywhere Cloud Console under Admin Center > Security > Secrets.

    Record the name of the secret you create. Choose the secret type based on the form your sensitive data is in:

    • Key-value pairs for passwords, API keys, and PEM-encoded text. A key-value pairs secret can hold one or more named text entries. Each entry is referenced individually by its key name.
    • Binary file for JKS, PKCS12, and PEM-encoded truststores and keystores. A binary file secret holds a single uploaded file. The content is referenced as a whole, without a key name.
  4. Open a local terminal and capture the values you gathered in environment variables.

    The following command prompts you to enter each value. The cookie value is not displayed as you type.

    printf "Domain: " && read -r DOMAIN; \
      printf "Hadoop JWT cookie: " && read -rs HADOOP_JWT && echo; \
      printf "Secret name: " && read -r SECRET; \
      printf "SPIFFE ID: " && read -r SPIFFE_ID; \
      export DOMAIN HADOOP_JWT SECRET SPIFFE_ID
  5. Share the secret with the Connect cluster's workload identity using the Console API.

    Sharing a secret with an identity can only be done using the API. Sharing grants the Kafka Connect cluster access to the secret. Only the secret's owner can grant access. However, once the secret is shared, any connector running on the Connect cluster can use that secret.

    Run the following command to grant the Connect cluster read access to the secret:

    curl -sS -b "hadoop-jwt=${HADOOP_JWT}" \
      -X POST \
      -H 'Content-Type: application/json' \
      -d "{\"grantee_type\":\"SERVICE\",\"grantee_id\":\"$SPIFFE_ID\",\"permission_level\":\"READ_ONLY\"}" \
      "https://console.${DOMAIN}/api/v1/secret-service/secrets/$SECRET/shares"

    If a connector fails to resolve a secret, the error message includes the SPIFFE ID that the Connect cluster used. Use this to confirm which identity needs access to the secret.

  6. Verify that the secret is shared.
    1. In Anywhere Cloud Console, go to Admin Center > Security > Secrets.
    2. Find your secret and confirm that the SPIFFE ID is listed in the Shared with column.
      If the secret is shared with multiple grantees, not all of them are shown in the column. To see all grantees, click > Share for the secret.
  7. Reference the secret in the connector configuration.

    Enter the secret reference in the Property Value field of any connector configuration property. Select the correct syntax in two steps: first, select the tab that matches the type of secret you created. Then, from that tab, select the syntax variant that matches what the connector property expects. The secret's content as a string, the content as a base64-encoded string, or a path to a file containing the content.

    • Content as a string

      ${awcsecret:[***OWNER***]/[***SECRET NAME***]}

      Resolves to the file's text content as a string. Use for properties that accept certificate or key text directly, such as ssl.truststore.certificates.

    • Content as a base64-encoded string

      ${awcsecret:[***OWNER***]/[***SECRET NAME***]:base64}

      Resolves to the file content as a base64-encoded string. base64 is a literal keyword.

    • Path to a file

      ${awcsecretfile:[***OWNER***]/[***SECRET NAME***]}

      Resolves to a file path. Use for properties that require a file path, such as ssl.truststore.location.

    • Entry value as a string

      ${awcsecret:[***OWNER***]/[***SECRET NAME***]:[***KEY NAME***]}

      Resolves to the text value of the named entry. Use for passwords, API keys, and other string values.

    • Path to a file containing the entry value

      ${awcsecretfile:[***OWNER***]/[***SECRET NAME***]:[***KEY NAME***]}

      Resolves to a file path containing the entry value. Use for file-based properties that expect a path.

    Replace [***OWNER***] with the Console username of the secret's owner and [***SECRET NAME***] with the name of the secret. The owner prefix is optional — omit it if only one secret with that name is shared with this Connect cluster. Replace [***KEY NAME***] with the name of the entry within a key-value pairs secret.

    The following example references a PKCS12 truststore (a binary file secret) and its password (a key-value pairs secret entry):

    ssl.truststore.type=PKCS12
    ssl.truststore.location=${awcsecretfile:alice/iceberg-truststore}
    ssl.truststore.password=${awcsecret:alice/iceberg-tls:password}
    • Files resolved by awcsecretfile references have no extension. If the connector property expects a keystore or truststore file, ensure that your connector configuration also explicitly sets the corresponding store type. That is, the configuration contains an entry such as: ssl.truststore.type=PKCS12. Kafka cannot infer the format from the filename.
    • A changed secret value is picked up on the next connector or task restart.

The secret is shared with your Kafka Connect cluster, and your connector is configured to securely resolve the referenced values at runtime.

Continue configuring your connector. When you are finished, create the new connector or apply the configuration to update an existing one.