Enabling the Read-Only Mode for ClickHouse Tables
This topic is available for MRS 3.2.0 or later only.
Scenario
During data migration, one-click balancing, decommissioning and capacity reduction, ClickHouse allows you to set the only_allow_select_statement parameter for MergeTree series tables to enable SELECT operations instead of ALTER, RENAME, DROP, and INSERT operations.
Procedure for Enabling the Read-Only Mode of the ClickHouse Table
- Install the client. For details, see Installing a Client.
- Run the following commands to log in to the node where the client is installed as user root:
cd Client installation directory
source bigdata_env
- Run the following command to authenticate the user if the cluster is in security mode (with Kerberos authentication enabled). Otherwise, skip this step.
kinit Component service user
The user must have the ClickHouse administrator permissions.
- Run the proper client command to connect to the ClickHouse server.
- Normal mode
clickhouse client --host IP address of the ClickHouse instance--user Username --password --port 9440 --secure
Enter the user password.
- For a cluster in normal mode, the username is default. Alternatively, you can create an administrator using the open source ClickHouse web UI. Do not use the users created on FusionInsight Manager.
- To obtain the IP address of the ClickHouseServer instance, log in to FusionInsight Manager, choose Cluster > Services > ClickHouse, and click the Instance tab.
- Normal mode
- Run the following statement to set the table to read-only:
ALTER TABLE {table_name} MODIFY SETTING only_allow_select_statement = true;
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot