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:

  1. In the main menu of YTsaurus, go to the Cliques section.
  2. In the opened CHYT cliques section, click Create clique in the upper‑right corner.
  3. 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.

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

  1. Install CHYT CLI as part of the ytsaurus-client package, if you haven’t done so yet.

  2. Save the proxy address to an environment variable. This allows you to avoid specifying the YTsaurus cluster using the --proxy argument in every subsequent command.

    export YT_PROXY=<cluster_name>
    
  3. 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 the controller field in the output of the command:

    yt get //sys/strawberry/chyt/<alias>/@strawberry_info_state
    
  4. 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 is ytdemo.

  5. 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:

  1. Open the clique interface as described in the How to open the clique interface section.
  2. Click edit speclet in the upper‑right corner, in the Action buttons block, or the button Edit speclet on the Speclet tab in the Tabs panel.
  3. In the opened settings window, enter the compute pool name in the Pool field.
  4. 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.

  1. Install CHYT CLI as part of the ytsaurus-client package, if you haven’t done so yet.

  2. Save the proxy address to an environment variable. This allows you to avoid specifying the YTsaurus cluster using the --proxy argument in every subsequent command.

    export YT_PROXY=<cluster_name>
    
  3. 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 the controller field in the output of the command:

    yt get //sys/strawberry/chyt/<alias>/@strawberry_info_state
    
  4. 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 is ytdemo.

  5. 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:

  1. Open the clique interface as described in the How to open the clique interface section.

  2. Click start in the upper‑right corner, in the Action buttons block.

  3. Make sure that:

    • the Health parameter changed to the Pending state and then, after some time, to Good;
    • the State parameter has the Active value.

    You can view the statuses of these parameters in the clique interface — in the block with characteristics.

  4. Check the clique’s functionality. To do this, make a test query in the Query Tracker interface:

    • click sql in the upper‑right corner, in the Action buttons block;
    • in the opened window, enter and run an SQL query.
  1. Install CHYT CLI as part of the ytsaurus-client package, if you haven’t done so yet.

  2. Save the proxy address to an environment variable. This allows you to avoid specifying the YTsaurus cluster using the --proxy argument in every subsequent command.

    export YT_PROXY=<cluster_name>
    
  3. 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 the controller field in the output of the command:

    yt get //sys/strawberry/chyt/<alias>/@strawberry_info_state
    
  4. 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 is ytdemo.

  5. Start the clique using the command:

    yt clickhouse ctl start chyt_example_clique
    
  6. Check the clique status using the status command. When the clique operation is started, the status field value should become Ok, and operation_state should change 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" = "https://domain.com/<cluster_name>/operations/<some_hash>";
      }
    
  7. 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 id parameter;
  • in the CLI — via the operation_url link from the output of the status command.

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:

  1. Open the clique interface as described in the How to open the clique interface section.

  2. Click stop in the upper‑right corner, in the Action buttons block.

  3. Make sure that:

    • the Health parameter changed to the Pending state and then, after some time, to Failed;
    • the State parameter has the Inactive value.

    You can view the statuses of these parameters in the clique interface — in the block with characteristics.

  1. Install CHYT CLI as part of the ytsaurus-client package, if you haven’t done so yet.

  2. Save the proxy address to an environment variable. This allows you to avoid specifying the YTsaurus cluster using the --proxy argument in every subsequent command.

    export YT_PROXY=<cluster_name>
    
  3. 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 the controller field in the output of the command:

    yt get //sys/strawberry/chyt/<alias>/@strawberry_info_state
    
  4. 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 is ytdemo.

  5. Stop the clique using the command:

    yt clickhouse ctl stop chyt_example_clique