# 复制改名配置文件 cp /etc/clickhouse-server/config.xml /data0/software/clickhouse/config/ cp config.xml config_node0.xml # 修改node0【修改不做记录,详见下个代码块配置文件】 并复制其他实例的配置文件 cp config_node0.xml config_node1.xml cp config_node0.xml config_node2.xml cp config_node0.xml config_node3.xml cp config_node0.xml config_node4.xml cp config_node0.xml config_node5.xml cp config_node0.xml config_node6.xml cp config_node0.xml config_node7.xml cp config_node0.xml config_node8.xml cp config_node0.xml config_node9.xml cp config_node0.xml config_node10.xml cp config_node0.xml config_node11.xml # 更改路径 sed -i "s:/data0/clickhouse_data:/data1/clickhouse_data:g" /data0/software/clickhouse/config/config_node1.xml sed -i "s:/data0/clickhouse_data:/data2/clickhouse_data:g" /data0/software/clickhouse/config/config_node2.xml sed -i "s:/data0/clickhouse_data:/data3/clickhouse_data:g" /data0/software/clickhouse/config/config_node3.xml sed -i "s:/data0/clickhouse_data:/data4/clickhouse_data:g" /data0/software/clickhouse/config/config_node4.xml sed -i "s:/data0/clickhouse_data:/data5/clickhouse_data:g" /data0/software/clickhouse/config/config_node5.xml sed -i "s:/data0/clickhouse_data:/data6/clickhouse_data:g" /data0/software/clickhouse/config/config_node6.xml sed -i "s:/data0/clickhouse_data:/data7/clickhouse_data:g" /data0/software/clickhouse/config/config_node7.xml sed -i "s:/data0/clickhouse_data:/data8/clickhouse_data:g" /data0/software/clickhouse/config/config_node8.xml sed -i "s:/data0/clickhouse_data:/data9/clickhouse_data:g" /data0/software/clickhouse/config/config_node9.xml sed -i "s:/data0/clickhouse_data:/data10/clickhouse_data:g" /data0/software/clickhouse/config/config_node10.xml sed -i "s:/data0/clickhouse_data:/data11/clickhouse_data:g" /data0/software/clickhouse/config/config_node11.xml # 更改端口 sed -i "s:8121:8122:g" /data0/software/clickhouse/config/config_node1.xml sed -i "s:8121:8123:g" /data0/software/clickhouse/config/config_node2.xml sed -i "s:8121:8124:g" /data0/software/clickhouse/config/config_node3.xml sed -i "s:8121:8125:g" /data0/software/clickhouse/config/config_node4.xml sed -i "s:8121:8126:g" /data0/software/clickhouse/config/config_node5.xml sed -i "s:8121:8127:g" /data0/software/clickhouse/config/config_node6.xml sed -i "s:8121:8128:g" /data0/software/clickhouse/config/config_node7.xml sed -i "s:8121:8129:g" /data0/software/clickhouse/config/config_node8.xml sed -i "s:8121:8130:g" /data0/software/clickhouse/config/config_node9.xml sed -i "s:8121:8131:g" /data0/software/clickhouse/config/config_node10.xml sed -i "s:8121:8132:g" /data0/software/clickhouse/config/config_node11.xml
sed -i "s:9001:9002:g" /data0/software/clickhouse/config/config_node1.xml sed -i "s:9001:9003:g" /data0/software/clickhouse/config/config_node2.xml sed -i "s:9001:9004:g" /data0/software/clickhouse/config/config_node3.xml sed -i "s:9001:9005:g" /data0/software/clickhouse/config/config_node4.xml sed -i "s:9001:9006:g" /data0/software/clickhouse/config/config_node5.xml sed -i "s:9001:9007:g" /data0/software/clickhouse/config/config_node6.xml sed -i "s:9001:9008:g" /data0/software/clickhouse/config/config_node7.xml sed -i "s:9001:9009:g" /data0/software/clickhouse/config/config_node8.xml sed -i "s:9001:9010:g" /data0/software/clickhouse/config/config_node9.xml sed -i "s:9001:9011:g" /data0/software/clickhouse/config/config_node10.xml sed -i "s:9001:9012:g" /data0/software/clickhouse/config/config_node11.xml
sed -i "s:9021:9022:g" /data0/software/clickhouse/config/config_node1.xml sed -i "s:9021:9023:g" /data0/software/clickhouse/config/config_node2.xml sed -i "s:9021:9024:g" /data0/software/clickhouse/config/config_node3.xml sed -i "s:9021:9025:g" /data0/software/clickhouse/config/config_node4.xml sed -i "s:9021:9026:g" /data0/software/clickhouse/config/config_node5.xml sed -i "s:9021:9027:g" /data0/software/clickhouse/config/config_node6.xml sed -i "s:9021:9028:g" /data0/software/clickhouse/config/config_node7.xml sed -i "s:9021:9029:g" /data0/software/clickhouse/config/config_node8.xml sed -i "s:9021:9030:g" /data0/software/clickhouse/config/config_node9.xml sed -i "s:9021:9031:g" /data0/software/clickhouse/config/config_node10.xml sed -i "s:9021:9032:g" /data0/software/clickhouse/config/config_node11.xml
sed -i "s:node0:node1:g" /data0/software/clickhouse/config/config_node1.xml sed -i "s:node0:node2:g" /data0/software/clickhouse/config/config_node2.xml sed -i "s:node0:node3:g" /data0/software/clickhouse/config/config_node3.xml sed -i "s:node0:node4:g" /data0/software/clickhouse/config/config_node4.xml sed -i "s:node0:node5:g" /data0/software/clickhouse/config/config_node5.xml sed -i "s:node0:node6:g" /data0/software/clickhouse/config/config_node6.xml sed -i "s:node0:node7:g" /data0/software/clickhouse/config/config_node7.xml sed -i "s:node0:node8:g" /data0/software/clickhouse/config/config_node8.xml sed -i "s:node0:node9:g" /data0/software/clickhouse/config/config_node9.xml sed -i "s:node0:node10:g" /data0/software/clickhouse/config/config_node10.xml sed -i "s:node0:node11:g" /data0/software/clickhouse/config/config_node11.xml
sed -i "s:9361:9362:g" /data0/software/clickhouse/config/config_node1.xml sed -i "s:9361:9363:g" /data0/software/clickhouse/config/config_node2.xml sed -i "s:9361:9364:g" /data0/software/clickhouse/config/config_node3.xml sed -i "s:9361:9365:g" /data0/software/clickhouse/config/config_node4.xml sed -i "s:9361:9366:g" /data0/software/clickhouse/config/config_node5.xml sed -i "s:9361:9367:g" /data0/software/clickhouse/config/config_node6.xml sed -i "s:9361:9368:g" /data0/software/clickhouse/config/config_node7.xml sed -i "s:9361:9369:g" /data0/software/clickhouse/config/config_node8.xml sed -i "s:9361:9370:g" /data0/software/clickhouse/config/config_node9.xml sed -i "s:9361:9371:g" /data0/software/clickhouse/config/config_node10.xml sed -i "s:9361:9372:g" /data0/software/clickhouse/config/config_node11.xml
<default_profile>default</default_profile> <default_database>default</default_database> <!-- Perform mlockall after startup to lower first queries latency and to prevent clickhouse executable from being paged out under high IO load. Enabling this option is recommended but will lead to increased startup time for up to a few seconds. --> <mlock_executable>true</mlock_executable> <remap_executable>false</remap_executable>
# 由于sed -i 修改了日志目录,重新把日志目录改回来 sed -i "s:/data1/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node1.xml sed -i "s:/data2/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node2.xml sed -i "s:/data3/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node3.xml sed -i "s:/data4/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node4.xml sed -i "s:/data5/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node5.xml sed -i "s:/data6/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node6.xml sed -i "s:/data7/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node7.xml sed -i "s:/data8/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node8.xml sed -i "s:/data9/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node9.xml sed -i "s:/data10/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node10.xml sed -i "s:/data11/clickhouse_data/logs:/data0/clickhouse_data/logs:g" /data0/software/clickhouse/config/config_node11.xml