How to start a private clique

A private clique is a clique that is available only to certain users or units.

Start conditions

To start a private clique, you need a dedicated compute pool with CPU guarantees (strong_guarantee). If there is not any, you need to:

  • Ask colleagues whether it is possible to find a compute pool with available resources.
  • Order new resources for the future.
  • Start a clique without guarantees (not recommended).

How to start

  1. Install the CHYT CLI by installing the ytsaurus-client package.

  2. Start the clique. Below is an example of a clique of five instances with default settings (16 cores per instance) in the chyt pool. Clicks are identified by &mdash aliases and unique names starting with *. In the example, we are starting the clique with the *example alias.

Заказ CPU квоты

To create a clique with N instances on the <cluster_name> cluster, you need to:

  • <cluster_name> <pool_tree_name> <running_operations> : 1 (a clique is a single YTsaurus operation that is always running).
  • <cluster_name> <pool_tree_name> <total_operations>: 1 (must be greater than or equal to the limit on the number of executed operations).
  • <cluster_name> <pool_tree_name> <CPU strong guarantee>: N * 16 (there are 16 cores per instance by default).

To avoid mentioning the YTsaurus cluster name in each command (in the --proxy argument), as the first step, set the default value by the environment variable:

export YT_PROXY=<cluster_name>

Next, create a clique, using the command from the CHYT Controller CLI:

yt clickhouse ctl create chyt_example_clique

Once you have created the clique, configure it with the relevant options: Every clique has a mandatory pool option with the name of the compute pool where the operation on instances will be started for the clique. Because the operations for the clique are started by the robot-chyt system robot, first you need to grant, to this robot, the Use right for the specified pool.

When setting the pool option, make sure that you have the Use right for the specified pool (otherwise, the command will fail):

yt clickhouse ctl set-option pool chyt_example_pool --alias chyt_example_clique

To set the instance count, use instance_count:

yt clickhouse ctl set-option instance_count 2 --alias chyt_example_clique

To start the clique, first activate it by setting the active option to %true:

yt clickhouse ctl set-option active %true --alias chyt_example_clique

To view the clique status, use the status command. Once the clique's operation is started, the value of the status field changes to Ok and operation_state changes to running:

yt clickhouse ctl status chyt_example_clique
    "status" = "Waiting for restart: oplet does not have running yt operation";
# a few moments later
yt clickhouse ctl status chyt_example_clique
    "status" = "Ok";
    "operation_state" = "running";
    "operation_url" = "<cluster_name>/operations/48bdec5d-ed641014-3fe03e8-4289d62e";

Make sure that the clique works by making a test query in it to the //sys/clickhouse/sample_table table available on all clusters where there is CHYT:

yt clickhouse execute --proxy <cluster_name> --alias *example 'select avg(a) from `//sys/clickhouse/sample_table`'

If the clique is unavailable for more than ten minutes, write to the YTsaurus chat.