Updated on 2024-08-12 GMT+08:00

Preparing a ClickHouse Application Running Environment

Preparing User Information for Cluster Authentication

For an MRS cluster with Kerberos authentication enabled, you need to prepare a user who has the operation permission on related components for program authentication.

The following ClickHouse permission configuration example is for reference only. You can modify the configuration as you need.

  1. Log in to FusionInsight Manager.
  2. Choose System > Permission > Role and click Create Role in the right pane.

    1. Enter a role name, for example, developrole, and click OK.
    2. In Configure Resource Permission, choose Name of the desired cluster > ClickHouse > ClickHouse Scope and select Create Privilege for the target database Click the database name, select the read and write permissions of the corresponding table based on the task scenario, and click OK.

  3. Choose System > Permission > User Group > Create User Group to create a user group, for example, developgroup.
  4. Choose System > Permission > User, click Create in the right pane to create a human-machine user, for example, developuser.

    1. Add the user to developgroup and supergroup groups, and set Primary Group to supergroup.
    2. Add developrole to Role.

  5. Log in to FusionInsight Manager as developuser and change the initial password as prompted.
  6. Log in to FusionInsight Manager as user admin and choose System > Permission > User. In the Operation column of developuser, choose More > Download Authentication Credential. Save the file and decompress it to obtain the user.keytab and krb5.conf files of the user.

Preparing the Configuration Files of the Running Environment

During the development or a test run of the program, you need to use cluster configuration files to connect to an MRS cluster. The configuration files usually contain the cluster component information file and user files used for security authentication. You can obtain the required information from the created MRS cluster.

Nodes used for program debugging or running must be able to communicate with the nodes within the MRS cluster, and the hosts domain name must be configured.

  • Scenario 1: Prepare the configuration files required for debugging in the local Windows development environment.
  1. Log in to FusionInsight Manager, and choose Cluster > Dashboard > More > Download Client. Set Select Client Type to Configuration Files Only, and click OK to download the client configuration file to the local PC. Decompress the download.

    For example, if the client file package is FusionInsight_Cluster_1_Services_Client.tar, decompress it to obtain FusionInsight_Cluster_1_Services_ClientConfig_ConfigFiles.tar. Then, decompress this file.

  2. Copy the hosts file content from the decompression directory to the hosts file of the local PC.
    • If you need to debug the application in the local Windows environment, ensure that the local PC can communicate with the hosts listed in the hosts file.
    • The local hosts file in a Windows environment is stored, for example, in C:\WINDOWS\system32\drivers\etc\hosts.
  • Scenario 2: Prepare the configuration files required for running the program in a Linux environment.
  1. Install the client on a node. For example, the client installation directory is /opt/client.
  2. Check the network connection of the client node.

    During the client installation, the system automatically configures the hosts file on the client node. You are advised to check whether the /etc/hosts file contains the host names of the nodes in the cluster. If they are not contained, manually copy the content in the hosts file in the decompression directory to the hosts file on the node where the client is deployed.