Getting started with Managed Service for ClickHouse
To get started with the service:
Before you start
-
Go to the management console. Then log in to Yandex.Cloud or sign up if you don't have an account.
-
If you don't have a folder yet, create one:
-
Click Create folder in the Home page of the management console.
-
Enter the folder name.
- The name must be unique within the folder.
- The name may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter. The last character can't be a hyphen.
- The maximum length of the name is 63 characters.
-
Select Create a default network. A network is created with subnets in each availability zone.
-
Click Create.
-
You can connect to DB clusters from both inside and outside of the Cloud:
- To connect to a DB cluster from inside the Cloud, create a VM in the same network as the DB cluster (based on Linux or Windows)
- To connect to a cluster from the internet, request public access to the hosts when creating the cluster.
Create a cluster
- In the management console, select the folder where you want to create a DB cluster.
- Select Managed Service for ClickHouse.
- Click Create cluster.
- Set the cluster parameters and click Create cluster. This process is described in detail in Creating ClickHouse clusters.
- When the cluster is ready to operate, its status on the Managed Service for ClickHouse dashboard changes to Running and its state to Alive. This may take some time.
Connect to the DB
-
To connect to the DB server, get an SSL certificate:
-
Create a folder:
$ mkdir ~/.clickhouse
-
Get a certificate:
$ wget "https://storage.yandexcloud.net/cloud-certs/CA.pem" -O ~/.clickhouse/root.crt
-
Configure permissions to the certificate:
$ chmod 0600 ~/.clickhouse/root.crt
-
-
Use the ClickHouse CLI to connect:
- Specify the path to the SSL certificate in the configuration file in the
<caConfig>
element:
<config> <openSSL> <client> <loadDefaultCAFile>true</loadDefaultCAFile> <caConfig>~/.clickhouse/root.crt</caConfig> <cacheSessions>true</cacheSessions> <disableProtocols>sslv2,sslv3</disableProtocols> <preferServerCiphers>true</preferServerCiphers> <invalidCertificateHandler> <name>RejectCertificateHandler</name> </invalidCertificateHandler> </client> </openSSL> </config>
- Run the ClickHouse CLI with the following parameters:
clickhouse-client --host <host FQDN> \ -s \ --user <DB user name> \ --password <DB user password> \ -q "<DB query>" \ --port 9440
- Specify the path to the SSL certificate in the configuration file in the
What's next
- Read about service concepts.
- Learn more about creating a cluster and connecting to the database.
- Read questions and answers.