Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Tutorials
    • All tutorials
    • Deploying the Apache Kafka® web interface
    • Migrating a database from a third-party Apache Kafka® cluster to Managed Service for Apache Kafka®
    • Moving data between Managed Service for Apache Kafka® clusters using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for YDB to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for ClickHouse® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for Greenplum® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for MongoDB using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for MySQL® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for OpenSearch using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for PostgreSQL using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for YDB using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Data Streams using Data Transfer
    • Delivering data from Data Streams to Managed Service for YDB using Data Transfer
    • Delivering data from Data Streams to Managed Service for Apache Kafka® using Data Transfer
    • YDB change data capture and delivery to YDS
    • Configuring Kafka Connect to work with a Managed Service for Apache Kafka® cluster
    • Automating Query tasks with Managed Service for Apache Airflow™
    • Sending requests to the Yandex Cloud API via the Yandex Cloud Python SDK
    • Configuring an SMTP server to send e-mail notifications
    • Adding data to a ClickHouse® DB
    • Migrating data to Managed Service for ClickHouse® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for ClickHouse® using Data Transfer
    • Asynchronously replicating data from PostgreSQL to ClickHouse®
    • Exchanging data between Managed Service for ClickHouse® and Yandex Data Processing
    • Configuring Managed Service for ClickHouse® for Graphite
    • Fetching data from Managed Service for Apache Kafka® to Managed Service for ClickHouse®
    • Fetching data from Managed Service for Apache Kafka® to ksqlDB
    • Fetching data from RabbitMQ to Managed Service for ClickHouse®
    • Saving a Data Streams data stream in Managed Service for ClickHouse®
    • Asynchronous replication of data from Yandex Metrica to ClickHouse® using Data Transfer
    • Using hybrid storage in Managed Service for ClickHouse®
    • Sharding Managed Service for ClickHouse® tables
    • Data resharding in a Managed Service for ClickHouse® cluster
    • Loading data from Yandex Direct to a data mart enabled by Managed Service for ClickHouse® using Cloud Functions, Object Storage, and Data Transfer
    • Loading data from Object Storage to Managed Service for ClickHouse® using Data Transfer
    • Migrating data with change of storage from Managed Service for OpenSearch to Managed Service for ClickHouse® using Data Transfer
    • Loading data from Managed Service for YDB to Managed Service for ClickHouse® using Data Transfer
    • Migrating databases from Google BigQuery to Managed Service for ClickHouse®
    • Configuring Cloud DNS to access a Managed Service for ClickHouse® cluster from other cloud networks
    • Migrating a Yandex Data Processing HDFS cluster to a different availability zone
    • Importing data from Managed Service for MySQL® to Yandex Data Processing using Sqoop
    • Importing data from Managed Service for PostgreSQL to Yandex Data Processing using Sqoop
    • Mounting Object Storage buckets to the file system of Yandex Data Processing hosts
    • Working with Apache Kafka® topics using Yandex Data Processing
    • Automating operations with Yandex Data Processing using Managed Service for Apache Airflow™
    • Shared use of Yandex Data Processing tables through Metastore
    • Transferring metadata between Yandex Data Processing clusters using Metastore
    • Importing data from Object Storage, processing and exporting to Managed Service for ClickHouse®
    • Migrating to Managed Service for Elasticsearch using snapshots
    • Migrating collections from a third-party MongoDB cluster to Managed Service for MongoDB
    • Migrating data to Managed Service for MongoDB
    • Migrating Managed Service for MongoDB cluster from 4.4 to 6.0
    • Sharding MongoDB collections
    • MongoDB performance analysis and tuning
    • Migrating a database from a third-party MySQL® cluster to a Managed Service for MySQL® cluster
    • Managed Service for MySQL® performance analysis and tuning
    • Syncing data from a third-party MySQL® cluster to Managed Service for MySQL® using Data Transfer
    • Migrating a database from Managed Service for MySQL® to a third-party MySQL® cluster
    • Migrating a database from Managed Service for MySQL® to Object Storage using Data Transfer
    • Migrating data from Object Storage to Managed Service for MySQL® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Debezium
    • Migrating a database from Managed Service for MySQL® to Managed Service for YDB using Data Transfer
    • MySQL® change data capture and delivery to YDS
    • Migrating data from Managed Service for MySQL® to Managed Service for PostgreSQL using Data Transfer
    • Migrating data from AWS RDS for PostgreSQL to Managed Service for PostgreSQL using Data Transfer
    • Migrating data from Managed Service for MySQL® to Managed Service for Greenplum® using Data Transfer
    • Configuring an index policy in Managed Service for OpenSearch
    • Migrating data from Elasticsearch to Managed Service for OpenSearch
    • Migrating data from a third-party OpenSearch cluster to Managed Service for OpenSearch using Data Transfer
    • Loading data from Managed Service for OpenSearch to Object Storage using Data Transfer
    • Migrating data from Managed Service for OpenSearch to Managed Service for YDB using Data Transfer
    • Copying data from Managed Service for OpenSearch to Managed Service for Greenplum® using Yandex Data Transfer
    • Migrating data from Managed Service for PostgreSQL to Managed Service for OpenSearch using Data Transfer
    • Authenticating a Managed Service for OpenSearch cluster in OpenSearch Dashboards using Keycloak
    • Using the yandex-lemmer plugin in Managed Service for OpenSearch
    • Creating a PostgreSQL cluster for 1C:Enterprise
    • Searching for the Managed Service for PostgreSQL cluster performance issues
    • Managed Service for PostgreSQL performance analysis and tuning
    • Logical replication PostgreSQL
    • Migrating a database from a third-party PostgreSQL cluster to Managed Service for PostgreSQL
    • Migrating a database from Managed Service for PostgreSQL
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for PostgreSQL to Managed Service for YDB using Data Transfer
    • Migrating a database from Managed Service for PostgreSQL to Object Storage
    • Migrating data from Object Storage to Managed Service for PostgreSQL using Data Transfer
    • PostgreSQL change data capture and delivery to YDS
    • Migrating data from Managed Service for PostgreSQL to Managed Service for MySQL® using Data Transfer
    • Migrating data from Managed Service for PostgreSQL to Managed Service for OpenSearch using Data Transfer
    • Troubleshooting string sorting issues in PostgreSQL after upgrading glibc
    • Migrating a database from Greenplum® to ClickHouse®
    • Migrating a database from Greenplum® to PostgreSQL
    • Exporting Greenplum® data to a cold storage in Object Storage
    • Loading data from Object Storage to Managed Service for Greenplum® using Data Transfer
    • Copying data from Managed Service for OpenSearch to Managed Service for Greenplum® using Yandex Data Transfer
    • Creating an external table from a Object Storage bucket table using a configuration file
    • Migrating a database from a third-party Valkey™ cluster to Yandex Managed Service for Valkey™
    • Using a Yandex Managed Service for Valkey™ cluster as a PHP session storage
    • Loading data from Object Storage to Managed Service for YDB using Data Transfer
    • Loading data from Managed Service for YDB to Object Storage using Data Transfer
    • Processing Audit Trails events
    • Processing Cloud Logging logs
    • Processing CDC Debezium streams
    • Analyzing data with Jupyter
    • Processing files with usage details in Yandex Cloud Billing
    • Entering data into storage systems
    • Smart log processing
    • Transferring data within microservice architectures
    • Migrating data to Object Storage using Data Transfer
    • Migrating data from a third-party Greenplum® or PostgreSQL cluster to Managed Service for Greenplum® using Data Transfer
    • Migrating Managed Service for MongoDB clusters
    • Migrating MySQL® clusters
    • Migrating to a third-party MySQL® cluster
    • Migrating PostgreSQL clusters
    • Creating a schema registry to deliver data in Debezium CDC format from Apache Kafka®

In this article:

  • Prepare the environment
  • Required paid resources
  • Create a cluster
  • Register the rollup configuration in a cluster
  • Create and set up a virtual machine
  • Connect the virtual machine to a database
  • Create a GraphiteMergeTree table
  • Configure Graphite
  • How to delete the resources you created
  1. Building a data platform
  2. Configuring Managed Service for ClickHouse® for Graphite

Configuring Yandex Managed Service for ClickHouse® for Graphite

Written by
Yandex Cloud
Updated at May 7, 2025
  • Prepare the environment
    • Required paid resources
  • Create a cluster
  • Register the rollup configuration in a cluster
  • Create and set up a virtual machine
  • Connect the virtual machine to a database
  • Create a GraphiteMergeTree table
  • Configure Graphite
  • How to delete the resources you created

Yandex Managed Service for ClickHouse® can be used as data storage for Graphite.

The GraphiteMergeTree table engine enables you to decimate and aggregate or average out the contents of a database specifically for Graphite. The engine reduces the data storage volume and improves the efficiency of queries from Graphite.

Note

If you do not need decimation and aggregation or averaging, you can use any ClickHouse® table engine to store Graphite data.

To configure a database to work with Graphite:

  1. Prepare the environment.
  2. Create a cluster.
  3. Register the rollup configuration in a cluster.
  4. Create and set up a virtual machine.
  5. Connect the virtual machine to a database.
  6. Create a GraphiteMergeTree table.
  7. Configure Graphite.

If you no longer need the resources you created, delete them.

Prepare the environmentPrepare the environment

Sign up in Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or register a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can navigate to the cloud page to create or select a folder for your infrastructure to operate in.

Learn more about clouds and folders.

Required paid resourcesRequired paid resources

The cost of maintaining your ClickHouse® database for Graphite includes:

  • Fee for the cluster computing resources, storage, and backups (see Yandex Managed Service for ClickHouse® pricing).
  • Fee for a running VM to manage a database (see Yandex Compute Cloud pricing).

Create a clusterCreate a cluster

  1. Create a Managed Service for ClickHouse® cluster in any suitable configuration with the db1 database and public access to all of its hosts. Save the database name, username, and password.
  2. In the management console, select Managed Service for ClickHouse® and go to the new cluster. Save the cluster ID in the Overview tab.
  3. In the top-right corner, click Connect. In the Shell tab, save the --host parameter from the Sample connection string field, e.g., rc1a-2sqal8f0********.mdb.yandexcloud.net. This is the cluster host FQDN you will need later on.

Register the rollup configuration in a clusterRegister the rollup configuration in a cluster

Register the rollup configuration in your cluster to decimate and aggregate or average out the database contents for Graphite:

CLI
API

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. Prepare a YAML file named graphite-rollup.yaml with a description of rollup parameters, e.g.:

    name: test_rollup
    patterns:
      - regexp: click_cost
        function: max
        retention:
          - age: 86400
            precision: 60
    
  2. Run this command:

    yc managed-clickhouse cluster add-graphite-rollup <cluster_ID> --rollup-file-name <yaml_file_path>
    

    Where:

    • <cluster_ID>: Cluster ID.
    • --rollup-file-name: Path to graphite-rollup.yaml.

    For more information about the managed-clickhouse cluster add-graphite-rollup command, see the CLI reference.

Use the REST API update method by providing the required rollup parameters in the request body:

"graphiteRollup": [
          {
            "name": "test_rollup",
            "patterns": [
              {
                "regexp": "click_cost",
                "function": "max",
                "retention": [
                  {
                    "age": "86400",
                    "precision": "60"
                  }
                ]
              }
            ]
          }
        ]

Create and set up a virtual machineCreate and set up a virtual machine

  1. In the same cloud network where the cluster is located, create a VM on Linux.

  2. Connect to the VM via SSH.

  3. Connect the ClickHouse® DEB repository:

    sudo apt update && sudo apt install -y apt-transport-https ca-certificates dirmngr && \
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4 && \
    echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee \
    /etc/apt/sources.list.d/clickhouse.list
    
  4. Install the dependencies and the clickhouse-client client application:

    sudo apt update && sudo apt install -y clickhouse-client
    
  5. Download the configuration file for clickhouse-client:

    mkdir -p ~/.clickhouse-client && \
    wget "https://storage.yandexcloud.net/doc-files/clickhouse-client.conf.example" \
      --output-document ~/.clickhouse-client/config.xml
    
  6. Get an SSL certificate:

    sudo mkdir --parents /usr/local/share/ca-certificates/Yandex/ && \
    sudo wget "https://storage.yandexcloud.net/cloud-certs/RootCA.pem" \
         --output-document /usr/local/share/ca-certificates/Yandex/RootCA.crt && \
    sudo chmod 655 /usr/local/share/ca-certificates/Yandex/RootCA.crt && \
    sudo update-ca-certificates
    

Connect the virtual machine to a databaseConnect the virtual machine to a database

  1. If you are using security groups for a cloud network, configure them to allow all required traffic between the cluster and the VM.

  2. Connect.

  3. Run the ClickHouse® CLI with the following parameters: replace <host_FQDN>, <DB_name>, <DB_username>, and <DB_user_password> with the previously saved values.

    clickhouse-client --host <host_FQDN> \
                      --secure \
                      --user <DB_username> \
                      --database <DB_name> \
                      --password <DB_user_password> \
                      --port 9440
    

Create a GraphiteMergeTree tableCreate a GraphiteMergeTree table

ClickHouse® CLI

In the ClickHouse® CLI interface, run a query to create a GraphiteMergeTree table. For the parameter, provide the name of the rollup section described earlier:

CREATE TABLE GraphiteTable
(        
    Path String, 
    Time DateTime, 
    Value Int64, 
    Version UInt64
)
ENGINE = GraphiteMergeTree('test_rollup')
PARTITION BY Time
ORDER BY cityHash64(Version, Path)

Configure GraphiteConfigure Graphite

Configure Graphite to save metrics in the ClickHouse® cluster. In this case, data is decimated automatically by the ClickHouse® server according to the parameters you specified.

  1. Install the carbon-clickhouse utility in the system running Graphite:

    wget https://github.com/go-graphite/carbon-clickhouse/releases/download/v0.11.2/carbon-clickhouse_0.11.2_amd64.deb && \
    sudo apt-get install $(pwd)/carbon-clickhouse_0.11.2_amd64.deb
    
  2. Configure carbon-clickhouse.

  3. Run carbon-clickhouse:

    sudo systemctl enable carbon-clickhouse && \
    sudo systemctl start carbon-clickhouse
    
  4. Install the graphite-clickhouse utility:

    wget https://github.com/go-graphite/graphite-clickhouse/releases/download/v0.13.2/graphite-clickhouse_0.13.2_amd64.deb && \
    sudo apt-get install $(pwd)/graphite-clickhouse_0.13.2_amd64.deb
    
  5. Configure graphite-clickhouse.

  6. Run graphite-clickhouse:

    sudo systemctl enable graphite-clickhouse && \
    sudo systemctl start graphite-clickhouse
    

    For more information about configuring Graphite, see the relevant documentation.

How to delete the resources you createdHow to delete the resources you created

To remove the rollup configuration from a cluster:

  1. Delete all the tables that use this configuration.
  2. Run the yc managed-clickhouse cluster remove-graphite-rollup command.

For more information about the command, see the CLI reference.

Alert

Removal of the rollup configuration without first deleting the tables that use it may result in cluster failure.

Delete the resources you no longer need to avoid paying for them:

  • Delete the ClickHouse® cluster.
  • Delete the VM.

ClickHouse® is a registered trademark of ClickHouse, Inc.

Was the article helpful?

Previous
Exchanging data between Managed Service for ClickHouse® and Yandex Data Processing
Next
Fetching data from Managed Service for Apache Kafka® to Managed Service for ClickHouse®
Yandex project
© 2025 Yandex.Cloud LLC