[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for ClickHouse®](../index.md) > [Step-by-step guides](index.md) > Logs and monitoring > Connecting from DataLens

# Connecting to a ClickHouse® cluster from DataLens

[Yandex DataLens](../../datalens/concepts/index.md) is a business intelligence service, that lets you upload, process and visualize data for analysing and testing hypotheses. It can help you make marketing decisions for your product.

To use an existing cluster as a data source for DataLens:
1. [Activate Yandex DataLens](#activate-datalens).
1. [Allow access to the cluster from DataLens](#allow-access).
1. [Create a cluster connection in DataLens](#create-connector).

## Activating DataLens {#activate-datalens}

You can only connect a cluster to DataLens within your cloud if DataLens is activated in the same folder as the cluster.

If DataLens is activated in a different folder, you can connect a cluster as an external resource as long as the cluster is publicly accessible. Learn more about connecting to a cluster from a different folder [here](../../datalens/operations/connection/create-clickhouse.md).

{% note alert "Limit" %}

You can only create one DataLens instance in the cloud.

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

    1. In the [management console](https://console.yandex.cloud), navigate to the folder page.
    1. Navigate to **DataLens**.
    1. Click **Activate DataLens**.

{% endlist %}

The DataLens instance will be activated in the selected folder.

## Allowing access to a cluster from DataLens {#allow-access}

To allow DataLens to connect to your cluster and work with its data, enable **DataLens access** when [creating](cluster-create.md) or [reconfiguring](update.md#change-additional-settings) the cluster.

## Creating a cluster connection {#create-connector}

{% list tabs group=instructions %}

- Management console {#console}

  1. Make sure **DataLens** is [activated](#activate-datalens) in the relevant folder and has [permission](#allow-access) to access the cluster.
  1. Navigate to **Managed Service for&nbsp;ClickHouse**.
  1. Click the name of your cluster and select the **DataLens** tab.
  1. Click **Create connection**.

     {% cut "I have no **Create connection** button" %}

     
     If you see a message saying _DataLens not activated_ instead of the **Create connection** button, it means that you either have not activated DataLens yet or have connected it in a different folder. To connect your cluster to a DataLens instance from another folder, follow [this DataLens guide](../../datalens/operations/connection/create-clickhouse.md).


     {% endcut %}

  1. [Set up your connection](#connector-settings).
  1. Check that the settings are correct by clicking **Check connection**.
  1. After successfully checking the connection, click **Create**.

{% endlist %}

After creating the connection, you can:
* [Update](#update-connector) or [delete](#delete-connector) this connection.
* Use this connection to [create datasets](../../datalens/dataset/index.md) from the cluster data.
* Visualize the datasets using [charts](../../datalens/concepts/chart/index.md) and [dashboards](../../datalens/concepts/dashboard.md).


Try [visualizing data from ClickHouse®](../../tutorials/datalens/data-from-ch-visualization.md).


## Viewing a list of cluster connections {#connectors-list}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder containing the cluster.
  1. Navigate to **Managed Service for&nbsp;ClickHouse**.
  1. Click the name of your cluster and select the **DataLens** tab.

     {% cut "My connection is not on the list" %}

     If your connection is missing from the list, it means the cluster is connected to DataLens as an external source. [Learn more about DataLens](../../datalens/index.md) operation.

     {% endcut %}

{% endlist %}

## Updating a cluster connection {#update-connector}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder containing the cluster.
  1. Navigate to **Managed Service for&nbsp;ClickHouse**.
  1. Click the name of your cluster and select the **DataLens** tab.
  1. Select the connection from the list.

     {% cut "My connection is not on the list" %}

     If your connection is missing from the list, it means the cluster is connected to DataLens as an external source. [Learn more about DataLens](../../datalens/index.md) operation.

     {% endcut %}

  1. Change the [settings](#connector-settings).
  1. Check that the settings are correct by clicking **Check connection**.
  1. After successfully checking the connection, click **Save**.

{% endlist %}

## Deleting a cluster connection {#delete-connector}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder containing the cluster.
  1. Navigate to **Managed Service for&nbsp;ClickHouse**.
  1. Click the name of your cluster and select the **DataLens** tab.
  1. Select the connection from the list.

     {% cut "My connection is not on the list" %}

     If your connection is missing from the list, it means the cluster is connected to DataLens as an external source. [Learn more about DataLens](../../datalens/index.md) operation.

     {% endcut %}

  1. Click ![image](../../_assets/console-icons/ellipsis.svg) at the top of the page and select **Delete**.
  1. In the window that opens, click **Delete**.

{% endlist %}

## Connection settings {#connector-settings}

{% list tabs group=instructions %}

- Management console {#console}

  In the [management console](https://console.yandex.cloud), when [creating](#create-connector) or [updating](#update-connector) a cluster connection:
  1. Specify a name for the connection.
  1. Go to the **Select in folder** tab.
  1. Select the cluster and its host from the drop-down lists or [create a new cluster](cluster-create.md) in the folder with DataLens by clicking **Create new**.
  1. Select the user from the drop-down list.
  1. Enter this user's password.

     Leave the values of the following settings unchanged: **HTTP interface port**, **HTTPS**, **Cache TTL in seconds**, and **Raw SQL level**.

{% endlist %}

{% cut "My cluster and DataLens are in different folders" %}

If your cluster and DataLens are in different folders, use the settings from [this DataLens guide](../../datalens/operations/connection/create-clickhouse.md).

{% endcut %}

If the [**Read only**](cluster-users.md#setting-readonly) setting is enabled for the user, make sure its value is `0` or `2`. Otherwise, the connection will not work.

_ClickHouse® is a registered trademark of [ClickHouse, Inc](https://clickhouse.com)._