[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for ClickHouse®](../index.md) > FAQ > Cluster configuration

# ClickHouse® cluster settings

* [How do I create a user to access a cluster from DataLens with read-only permissions?](#datalens-readonly)

* [How do I grant a user permissions to create and delete tables or databases?](#create-delete-role)

* [How do I find out the internal_replication setting value?](#internal-replication)

* [How do I increase the maximum amount of RAM to run a query?](#max-memory-usage)

* [Why must a Managed Service for ClickHouse® cluster have three or five ZooKeeper hosts?](#zookeeper-hosts-number)

#### How do I create a user to access a cluster from DataLens with read-only permissions? {#datalens-readonly}

Follow [this guide](../operations/cluster-users.md#example-create-readonly-user) to create a user with read-only permissions. With **DataLens access** [enabled](../operations/update.md#change-additional-settings) in the cluster settings, the service will be able to [connect](../operations/datalens-connect.md#create-connector) to the cluster using this user.

#### How do I grant a user permissions to create and delete tables or databases? {#create-delete-role}

[Enable managing users via SQL](../operations/update.md#SQL-management) and grant the user the required permissions using the `GRANT` command.

For more information about the `GRANT` command, see [this ClickHouse® guide](https://clickhouse.com/docs/enen/sql-reference/statements/grant).

#### How do I find out the internal_replication setting value? {#internal-replication}

The `internal_replication` setting information is not available in Yandex Cloud interfaces or ClickHouse® system tables. The default setting value is `true`.

#### How do I increase the maximum amount of RAM to run a query? {#max-memory-usage}

If you do not have enough RAM to run a query, you will see the following error:

```text
DB::Exception: Memory limit (total) exceeded:
would use 14.10 GiB (attempt to allocate chunk of 4219924 bytes), maximum: 14.10 GiB.
(MEMORY_LIMIT_EXCEEDED), Stack trace (when copying this message, always include the lines below)
```

To [increase](../operations/cluster-users.md#update-settings) the maximum amount of RAM, use the [Max memory usage](../concepts/settings-list.md#setting-max-memory-usage) parameter.

If [user management via SQL](../concepts/user-access-rights.md#sql-user-management) is enabled for the cluster, you can set the `Max memory usage` parameter:

* For the current user session by running this query:

    ```sql
    SET max_memory_usage = <value_in_bytes>;
    ```

* For all default users by creating a [settings profile](https://clickhouse.com/docs/enen/operations/access-rights#settings-profiles-management).

#### Why must a highly available Managed Service for ClickHouse® cluster have three or five ZooKeeper hosts? {#zookeeper-hosts-number}

ZooKeeper uses the consensus algorithm: it keeps on running as long as most ZooKeeper hosts are healthy.

For example, if a cluster has two ZooKeeper hosts, then, should one of them stop, the remaining host will not form the majority, so the service will become unavailable. Which means a cluster with two ZooKeeper hosts is not [highly available](../concepts/high-availability.md).

A cluster with three ZooKeeper hosts, however, is highly available. When one of its hosts is under maintenance or down, the cluster remains operational. Therefore, three is the minimum recommended number of ZooKeeper hosts per Managed Service for ClickHouse® cluster.

A cluster with four ZooKeeper hosts has no advantages over a three-host cluster: it will also remain operational if only one of its hosts fails. With two hosts down, the consensus is not met, so the service becomes unavailable.

A cluster with five ZooKeeper hosts is resilient enough to keep running without two of its hosts, three hosts out of five still forming the majority. This is why this cluster is easier to maintain than a three-host cluster. Even if one host out of five is [under maintenance](../concepts/maintenance.md) or restarting, the cluster remains highly available, i.e., it can lose one more host and still be operational.

Adding more than five ZooKeeper hosts to a cluster is not supported.

Thus, we recommend creating three or five ZooKeeper hosts per Managed Service for ClickHouse® cluster.

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