Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Managed Service for ClickHouse
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Information about existing clusters
    • Creating clusters
    • Connecting to databases
    • Stop and start the cluster
    • SQL queries in the management console
    • Changing cluster and database settings
    • Connecting to DataLens
    • Connecting external dictionaries
    • Adding your own geobase
    • Enabling machine learning models
    • Changing ClickHouse versions
    • Managing ClickHouse hosts
    • Adding ZooKeeper hosts
    • Database management
    • Managing database users
    • Managing backups
    • How to manage shards
    • Deleting clusters
  • Solutions
    • Adding data to the database
    • Migrating ClickHouse data
    • Sharding tables
  • Concepts
    • Relationship between service resources
    • Host classes
    • Network in Yandex Managed Service for ClickHouse
    • Quotas and limits
    • Storage types
    • Backups
    • Replication
    • Dictionaries
    • Sharding
    • Supported clients
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
      • From March 1, 2019 to February 1, 2020
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • BackupService
      • ClusterService
      • DatabaseService
      • FormatSchemaService
      • MlModelService
      • ResourcePresetService
      • UserService
      • VersionsService
      • OperationService
    • REST
      • Overview
      • Backup
        • Overview
        • get
        • list
      • Cluster
        • Overview
        • addHosts
        • addShard
        • addZookeeper
        • backup
        • create
        • createExternalDictionary
        • createShardGroup
        • delete
        • deleteExternalDictionary
        • deleteHosts
        • deleteShard
        • deleteShardGroup
        • get
        • getShard
        • getShardGroup
        • list
        • listBackups
        • listHosts
        • listLogs
        • listOperations
        • listShardGroups
        • listShards
        • move
        • rescheduleMaintenance
        • restore
        • start
        • stop
        • streamLogs
        • update
        • updateShard
        • updateShardGroup
      • Database
        • Overview
        • create
        • delete
        • get
        • list
      • FormatSchema
        • Overview
        • create
        • delete
        • get
        • list
        • update
      • MlModel
        • Overview
        • create
        • delete
        • get
        • list
        • update
      • ResourcePreset
        • Overview
        • get
        • list
      • User
        • Overview
        • create
        • delete
        • get
        • grantPermission
        • list
        • revokePermission
        • update
      • Versions
        • Overview
        • list
      • Operation
        • Overview
        • get
  • Questions and answers
    • General questions
    • Questions about ClickHouse
    • All questions on the same page
  1. Getting started

Getting started with Managed Service for ClickHouse

  • Before you start
  • Create a cluster
  • Connect to the DB
  • What's next

To get started with the service:

  • Create a DB cluster.
  • Connect to the DB.

Before you start

  1. Go to the management console. Then log in to Yandex.Cloud or sign up if you don't have an account.

  2. If you don't have a folder yet, create one:

    1. Click Create folder in the Home page of the management console.

    2. 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.
    3. Select Create a default network. A network is created with subnets in each availability zone.

    4. Click Create.

You can connect to DB clusters from both inside and outside of the Cloud:

  1. 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)
  2. To connect to a cluster from the internet, request public access to the hosts when creating the cluster.

Create a cluster

  1. In the management console, select the folder where you want to create a DB cluster.
  2. Select Managed Service for ClickHouse.
  3. Click Create cluster.
  4. Set the cluster parameters and click Create cluster. This process is described in detail in Creating ClickHouse clusters.
  5. 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

  1. To connect to the DB server, get an SSL certificate:

    1. Create a folder:

      $ mkdir ~/.clickhouse
      
    2. Get a certificate:

      $ wget "https://storage.yandexcloud.net/cloud-certs/CA.pem" -O ~/.clickhouse/root.crt
      
    3. Configure permissions to the certificate:

      $ chmod 0600 ~/.clickhouse/root.crt
      
  2. Use the ClickHouse CLI to connect:

    1. 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>
    
    1. 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 
    

What's next

  • Read about service concepts.
  • Learn more about creating a cluster and connecting to the database.
  • Read questions and answers.
In this article:
  • Before you start
  • Create a cluster
  • Connect to the DB
  • What's next
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC