<a id="register-connect"></a>

# Register a Confluent Platform Connect Cluster with USM

To monitor and govern your Confluent Platform Connect clusters from Confluent Cloud, you must first register them with Unified Stream Manager (USM).
You can register a Connect cluster using either the Confluent Cloud Console or the Confluent CLI.

New to USM? Start with the [Unified Stream Manager overview](overview.md#cloud-usm-overview) to learn what USM
is and how it connects your Confluent Platform clusters to Confluent Cloud.

#### WARNING
Before you register your Kafka Connect clusters, ensure that sensitive values, such as secrets and credentials, for all connectors
on that cluster are configured only in properties of type `PASSWORD`. For USM, Confluent Platform masks configuration values of type
`PASSWORD` before it sends them as part of the connector metadata to Confluent Cloud. To find which configuration options are of type
`PASSWORD`, see [Self-Managed Connectors for Confluent Platform](https://docs.confluent.io/platform/current/connect/kafka_connectors.html)
for specific connectors.

## Before you begin

* Ensure that you have [registered a Confluent Platform cluster to Confluent Cloud using USM](register/overview.md#cloud-usm-register).
* Get the Kafka cluster details that the Connect worker uses as the metadata cluster.

## Register a Connect cluster

To register a Connect cluster:

### Confluent Cloud Console

1. Log in to your Confluent Platform cluster by using the Confluent Platform CLI.
2. Get the Connect cluster ID by running the following command to list the available Kafka Connect clusters:
   ```bash
   confluent connect cluster list
   ```
3. From the output, copy the ID of the Kafka Connect cluster that you want to register.
4. In the Confluent Cloud Console, navigate to **Environments** and select your environment.
   ![image](images/usm-env.png)
5. In the navigation menu, click **Clusters** and select a Confluent Platform cluster.
   ![image](images/usm-cluster.png)
6. In the navigation menu, click **Connectors**.
   ![image](images/usm-connect-register.png)
7. Click **Register Connect cluster**.
   ![image](images/usm-connect-registerselect.png)
8. Paste the Kafka Connect cluster ID that you copied.
   ![image](images/usm-connector.png)
9. Click **Finish**.

Data from your connectors might take a few minutes to appear in the Confluent Cloud.

Alternatively, if connectors are already running but the cluster isn’t registered, a **Register Connect cluster**
button is also available at the top right of the **Connectors** page.

### Confluent CLI

To register a Confluent Platform Connect cluster, use the `confluent usm connect-cluster register` command.

```bash
confluent usm connect-cluster register <connect_ID> --kafka-cluster-id <cluster-ID> --cloud <cloud-type> --region <region-name>
```

For `--cloud`, specify `aws` or `azure`, and for `--region`, specify a region
from [Configure AWS Private Networking for USM Agents](register/usm-network.md#usm-network) (AWS) or [Configure Azure Private Networking for USM Agents](register/usm-network-azure.md#usm-network-azure) (Azure).

For example, to register a Kafka cluster with ID `4k0R9d1GTS5tI9f4Y2xZ0Q` and connector ID `connect-group-xyz123` in AWS region `us-east-1`:

```bash
confluent usm connect-cluster register connect-group-xyz123 --kafka-cluster-id 4k0R9d1GTS5tI9f4Y2xZ0Q --cloud aws --region us-east-1
```

The following is an example of the output:

```text
+--------------------------------+--------------------------+
| ID                             | usmcc-global-ghijkl67890 |
| Confluent Platform Connect     | connect-group-xyz123     |
| Cluster                        |                          |
| USM Kafka Cluster ID           | usmkc-global-abcdef12356 |
| Confluent Platform Kafka       | 4k0R9d1GTS5tI9f4Y2xZ0Q   |
| Cluster ID                     |                          |
| Cloud                          | AWS                      |
| Region                         | us-east-1                |
| Environment                    | env-stgcqqd737           |
+--------------------------------+--------------------------+
```

To register a Connect cluster in Azure region `centralus`:

```bash
confluent usm connect-cluster register connect-group-xyz123 --kafka-cluster-id 9f4Y2xZ0Q4k0R9d1GTS5tI --cloud azure --region centralus
```

The following is an example of the output:

```text
+--------------------------------+--------------------------+
| ID                             | usmcc-global-lkjihg09876 |
| Confluent Platform Connect     | connect-group-xyz123     |
| Cluster                        |                          |
| USM Kafka Cluster ID           | usmkc-global-fedcba54321 |
| Confluent Platform Kafka       | 9f4Y2xZ0Q4k0R9d1GTS5tI   |
| Cluster ID                     |                          |
| Cloud                          | AZURE                    |
| Region                         | centralus                |
| Environment                    | env-stgcqqd737           |
+--------------------------------+--------------------------+
```

After registration, the **Connectors** page populates with all connectors that are associated with that cluster.

For a complete reference of related commands, see the [confluent usm CLI documentation](https://docs.confluent.io/confluent-cli/current/command-reference/usm/index.html#confluent-usm).

## Register an additional Connect cluster

To register an additional Connect cluster, do the following:

1. Navigate to the **Connectors** page for your registered Confluent Platform cluster.
2. Click **Connector cluster list**.
3. Click **Register Connect cluster**.
4. In your Confluent Platform environment, get the ID of the additional Connect cluster by running the following command:
   ```bash
   confluent connect cluster list
   ```
5. Enter the Confluent Platform Connect cluster ID in the Confluent Cloud Console.
6. Click **Finish**.

## Configure Connect workers for metadata sync

After registering your cluster, the final step is to ensure your Connect workers can securely send metadata to Confluent Cloud.
The required actions depend on your Confluent Platform deployment method.

### For Confluent for Kubernetes or Ansible Playbooks for Confluent Platform deployments

If you deployed Confluent Platform using [Confluent for Kubernetes](https://docs.confluent.io/operator/current/overview.html) or
[Ansible Playbooks](https://docs.confluent.io/ansible/current/overview.html), no additional configuration is needed.
These tools automatically manage the settings required for metadata synchronization. After the registration is complete,
your connector metadata begins to appear in Confluent Cloud.

#### NOTE
Confluent Platform Connect versions `7.9.6`, `7.9.7`, `7.9.8`, `8.1.2`,
`8.1.3`, `8.1.4`, `8.2.0`, `8.2.1`, `8.2.2`, and `8.3.0` have
a known issue that prevents Confluent for Kubernetes and Ansible Playbooks for Confluent Platform deployments from
emitting the metrics required for USM. If connector metrics do
not appear in Confluent Cloud after registration, see
[Issue: Connect metrics are missing from USM](troubleshoot.md#troubleshoot-connect-metrics-missing) to apply the workaround.

### For manual or other deployments

If you installed or manage Confluent Platform manually, you must update the properties file for each Kafka Connect worker in the registered cluster.

1. Open the properties file for each Kafka Connect worker in the cluster that you registered.
2. Confirm that the `bootstrap.servers` property correctly points to the Kafka cluster that the Connect workers use to store connector metadata.
3. Add the following metadata properties to the worker configuration file to enable the metadata events service.
   ```properties
   confluent.connect.metadata.events.enabled=true
   confluent.connect.metadata.events.client.base.url=https://usm-agent.connect.svc.cluster.local:10000
   confluent.connect.metadata.events.ssl.key.password=${file:/mnt/sslcerts/tls-connect/jksPassword.txt:jksPassword}
   confluent.connect.metadata.events.ssl.keystore.location=/mnt/sslcerts/tls-connect/keystore.p12
   confluent.connect.metadata.events.ssl.keystore.password=${file:/mnt/sslcerts/tls-connect/jksPassword.txt:jksPassword}
   confluent.connect.metadata.events.ssl.protocol=TLSv1.2
   confluent.connect.metadata.events.ssl.truststore.location=/mnt/sslcerts/tls-connect/truststore.p12
   confluent.connect.metadata.events.ssl.truststore.password=${file:/mnt/sslcerts/tls-connect/jksPassword.txt:jksPassword}
   ```
4. Save your changes.
5. Perform a rolling restart of your Connect workers. After they restart, the workers send metadata to Confluent Cloud.

<a id="usm-deregister-connect"></a>

## Deregister a Connect cluster

When you deregister a Connect cluster, the cluster is removed as a USM
entity from Confluent Cloud. The USM Agent continues to run in your Confluent Platform
environment and emits events, but Confluent Cloud rejects them because the Confluent Platform cluster
no longer has a corresponding mapping in Confluent Cloud.

To stop these events, remove the USM-specific configuration from
the Connect cluster. After you remove the configuration, you can remove
the USM Agent if no other Kafka or Connect cluster is using the agent.

You can deregister a Connect cluster using the Confluent Cloud Console or the Confluent CLI.

### Confluent Cloud Console

1. In the Confluent Cloud Console, navigate to the **Environments** page and select your environment.
2. In the left navigation, click **Clusters** and select your Confluent Platform cluster.
3. In the left navigation menu, click **Connectors**.
4. On the **Connectors** page, click **Connect cluster list**.
   ![Connectors page showing the Connect cluster list button](images/usm-connect-deregister-connectors.png)
5. In the **Connect cluster list** panel, locate the Connect cluster you want to deregister.
   You can search by name or Confluent Cloud ID, or sort the list by clicking a column header.
   ![Connect cluster list panel showing registered Connect clusters](images/usm-connect-deregister-panel.png)
6. In the row for the cluster you want to deregister, click **Deregister**.
7. In the **Deregister Connect cluster** dialog, enter the cluster name exactly as shown.
   ![Deregister Connect cluster confirmation dialog](images/usm-connect-deregister-dialog.png)
8. Click **Deregister**.

The cluster is removed from the **Connect cluster list**.

### Confluent CLI

1. Log in to the Confluent CLI.
   ```bash
   confluent login
   ```
2. Get the **Environment ID** using the following steps:
   1. In the Confluent Cloud Console, navigate to the **Environments** page and select your environment.
   2. Click the **Details** tab and copy the ID from the **About** section.
3. Run the list command to see all USM registered Connect clusters in your environment.
   This allows you to find the specific `USM_CONNECT_CLUSTER_ID` required for deregistration.
   ```bash
   confluent usm connect-cluster list --environment <YOUR_ENVIRONMENT_ID>
   ```

   From the output, identify the Connect cluster you want to remove and copy its ID.
   A `USM_CONNECT_CLUSTER_ID` always starts with the prefix `usmcc-`.
4. Use the `confluent usm connect-cluster deregister` command with the `usmcc-` ID you copied.
   ```bash
   confluent usm connect-cluster deregister <USM_CONNECT_CLUSTER_ID> --environment <YOUR_ENVIRONMENT_ID>
   ```

   The following example deregisters a Connect cluster with the ID `usmcc-abc123` in the environment `env-12345`.
   ```bash
   confluent usm connect-cluster deregister usmcc-abc123 --environment env-12345
   ```
5. The CLI prompts you for confirmation. Type `y` and press **Enter** to proceed.
   ```text
   Are you sure you want to deregister USM Connect cluster "usmcc-abc123"? (y/n): y
   Deregistered USM Connect cluster "usmcc-abc123".
   ```

After deregistration, the corresponding Connect cluster card is removed from the Confluent Cloud Console.

For a complete reference of related commands, see the [confluent usm CLI documentation](https://docs.confluent.io/confluent-cli/current/command-reference/usm/index.html#confluent-usm).

## Related content

* [Unified Stream Manager in Confluent Cloud](overview.md#cloud-usm-overview)
* [Set Up a Payment Method](register/payment-method.md#usm-payment)
* [Configure AWS Private Networking for USM Agents](register/usm-network.md#usm-network)
* [Configure Azure Private Networking for USM Agents](register/usm-network-azure.md#usm-network-azure)
* [Configure a Service Account for the USM Agent](register/usm-service-account.md#usm-sa)
* [Deploy the USM Agent](register/deploy-agent.md#usm-agent)
* [Complete the Cluster Registration](register/complete-registration.md#complete-registration)
