Creating, Starting, and Stopping a Clique
Note
The operations and actions described below do not start computations — they only prepare the clique for use.
How to create a new clique
You can create a new clique in two ways:
- In the main menu of YTsaurus, go to the Cliques section.
- In the opened CHYT cliques section, click Create clique in the upper‑right corner.
- Fill in the form fields:
-
Alias name — the clique name;
-
Instance count — the number of clique instances (from 1 to 100);
-
Pool tree — pool tree, select a value from the list or keep the default value;
-
Pool — the name of the compute pool where you want to run the clique operation.
Note
This option is optional at the clique creation stage. You must set it before starting the clique.
-
- To complete the creation, click Confirm.
After confirmation, you’ll be forward to the created clique’s interface, and it will become available in the clique list in the CHYT cliques section.
-
Install CHYT CLI as part of the
ytsaurus-clientpackage, if you haven’t done so yet. -
Save the proxy address to an environment variable. This allows you to avoid specifying the YTsaurus cluster using the
--proxyargument in every subsequent command.export YT_PROXY=<cluster_name> -
Set an environment variable with the controller address for the same reason:
export CHYT_CTL_ADDRESS=<address>, where
<address>is the controller address. For example, for the demo cluster, the address looks like this:https://strawberry-XXXXXXXX.demo.ytsaurus.tech.
You can get the controller address from thecontrollerfield in the output of the command:yt get //sys/strawberry/chyt/<alias>/@strawberry_info_state -
Also save the cluster name to an environment variable:
export CLUSTER_NAME=<cluster_name>, where
<cluster_name>is the cluster name. For example, the demo cluster name isytdemo. -
Create a clique using a command from CHYT Controller CLI:
yt clickhouse ctl create chyt_example_clique
Setting up options for starting
After creating a clique, you need to configure it — set the required options. The main option for starting a clique is pool; you need to pass the name of the compute pool where the clique instances will run.
Before setting the pool option, make sure you have the Use permission for the specified pool. Check your permissions on the ACL tab in the Tabs panel in the Object permissions section. If you’re unsure which pool to use, contact the YTsaurus cluster administrator.
You can set the pool option via:
- Open the clique interface as described in the How to open the clique interface section.
- Click
in the upper‑right corner, in the Action buttons block, or the button Edit speclet on the Speclet tab in the Tabs panel. - In the opened settings window, enter the compute pool name in the Pool field.
- To finish, click Confirm.
Note
Since clique operations are run under the system robot robot-strawberry-controller, grant this robot the Use permission for the specified pool in advance.
-
Install CHYT CLI as part of the
ytsaurus-clientpackage, if you haven’t done so yet. -
Save the proxy address to an environment variable. This allows you to avoid specifying the YTsaurus cluster using the
--proxyargument in every subsequent command.export YT_PROXY=<cluster_name> -
Set an environment variable with the controller address for the same reason:
export CHYT_CTL_ADDRESS=<address>, where
<address>is the controller address. For example, for the demo cluster, the address looks like this:https://strawberry-XXXXXXXX.demo.ytsaurus.tech.
You can get the controller address from thecontrollerfield in the output of the command:yt get //sys/strawberry/chyt/<alias>/@strawberry_info_state -
Also save the cluster name to an environment variable:
export CLUSTER_NAME=<cluster_name>, where
<cluster_name>is the cluster name. For example, the demo cluster name isytdemo. -
Set the option using the command:
yt clickhouse ctl set-option pool chyt_example_pool --alias chyt_example_clique
How to start a clique
You can start a configured clique via:
-
Open the clique interface as described in the How to open the clique interface section.
-
Click
in the upper‑right corner, in the Action buttons block. -
Make sure that:
- the
Healthparameter changed to thePendingstate and then, after some time, toGood; - the
Stateparameter has theActivevalue.
You can view the statuses of these parameters in the clique interface — in the block with characteristics.
- the
-
Check the clique’s functionality. To do this, make a test query in the Query Tracker interface:
- click
in the upper‑right corner, in the Action buttons block; - in the opened window, enter and run an SQL query.
- click
-
Install CHYT CLI as part of the
ytsaurus-clientpackage, if you haven’t done so yet. -
Save the proxy address to an environment variable. This allows you to avoid specifying the YTsaurus cluster using the
--proxyargument in every subsequent command.export YT_PROXY=<cluster_name> -
Set an environment variable with the controller address for the same reason:
export CHYT_CTL_ADDRESS=<address>, where
<address>is the controller address. For example, for the demo cluster, the address looks like this:https://strawberry-XXXXXXXX.demo.ytsaurus.tech.
You can get the controller address from thecontrollerfield in the output of the command:yt get //sys/strawberry/chyt/<alias>/@strawberry_info_state -
Also save the cluster name to an environment variable:
export CLUSTER_NAME=<cluster_name>, where
<cluster_name>is the cluster name. For example, the demo cluster name isytdemo. -
Start the clique using the command:
yt clickhouse ctl start chyt_example_clique -
Check the clique status using the
statuscommand. When the clique operation is started, thestatusfield value should becomeOk, andoperation_stateshould change torunning:$ 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" = "https://domain.com/<cluster_name>/operations/<some_hash>"; } -
Make sure the clique is working. To do this, run a test query, for example:
yt clickhouse execute --alias chyt_example_clique 'select 42'
Warning
If the сlique has not started within 10 minutes, check the YT operation status:
- in the web interface — via the link from the
YT operation idparameter; - in the CLI — via the
operation_urllink from the output of thestatuscommand.
If you can’t resolve the issue yourself, ask for help in the YTsaurus chat or in your personal support channel.
How to stop a clique
You can stop a clique via:
-
Open the clique interface as described in the How to open the clique interface section.
-
Click
in the upper‑right corner, in the Action buttons block. -
Make sure that:
- the
Healthparameter changed to thePendingstate and then, after some time, toFailed; - the
Stateparameter has theInactivevalue.
You can view the statuses of these parameters in the clique interface — in the block with characteristics.
- the
-
Install CHYT CLI as part of the
ytsaurus-clientpackage, if you haven’t done so yet. -
Save the proxy address to an environment variable. This allows you to avoid specifying the YTsaurus cluster using the
--proxyargument in every subsequent command.export YT_PROXY=<cluster_name> -
Set an environment variable with the controller address for the same reason:
export CHYT_CTL_ADDRESS=<address>, where
<address>is the controller address. For example, for the demo cluster, the address looks like this:https://strawberry-XXXXXXXX.demo.ytsaurus.tech.
You can get the controller address from thecontrollerfield in the output of the command:yt get //sys/strawberry/chyt/<alias>/@strawberry_info_state -
Also save the cluster name to an environment variable:
export CLUSTER_NAME=<cluster_name>, where
<cluster_name>is the cluster name. For example, the demo cluster name isytdemo. -
Stop the clique using the command:
yt clickhouse ctl stop chyt_example_clique