After a ClickHouse cluster is created, you can use the ClickHouse client to connect to the ClickHouse server.
Configure the passwords of the default accounts default and clickhouse of a ClickHouse cluster.
<shard> <internal_replication>true</internal_replication> <replica> <host>192-168-43-125</host> <port>21423</port> <user>clickhouse</user> <password/> </replica> <replica> <host>192-168-43-165</host> <port>21423</port> <user>clickhouse</user> <password/> </replica> </shard> <shard> <internal_replication>true</internal_replication> <replica> <host>192-168-43-175</host> <port>21423</port> <user>clickhouse</user> <password/> </replica> <replica> <host>192-168-43-249</host> <port>21423</port> <user>clickhouse</user> <password/> </replica> </shard>
su - omm
cd Client installation directory/ClickHouse/clickhouse_change_password
./change_password.sh
In the following figure, user clickhouse is used as an example. Enter clickhouse and its password as prompted, and wait until the password is changed.
The password complexity requirements are as follows:
cd Client installation directory/ClickHouse/clickhouse/config/
vi clickhouse-env.sh
The following is an example:
LICKHOUSE_CONF_DIR="${BIGDATA_HOME}/FusionInsight_ClickHouse_*/*_ClickHouseServer/etc" CLICKHOUSE_SECURITY_ENABLED="true" CLICKHOUSE_BALANCER_LIST="192.168.42.14,192.168.67.89" CLICKHOUSE_STARTUP_PRINCIPAL="clickhouse/hadoop.hadoop.com@HADOOP.COM" USER_REALM="HADOOP.COM" OM_DECOMMISSION_HOSTNAME_LIST="" CLICKHOUSE_INSTALL_HOME="${BIGDATA_HOME}/FusionInsight_ClickHouse_8.2.0/install/FusionInsight-ClickHouse-v22.3.2.2-lts" CK_BALANCER_LIST="server-2110081635-0003,server-2110082001-0019"
cd ${BIGDATA_HOME}/FusionInsight_ClickHouse_*/*_ClickHouseServer/etc/
vi users.xml
As shown in the following figure, the new password is stored in the password_sha256_hex file.