clickhouse集群安装部署
程序员文章站
2022-07-13 10:19:13
...
一、 安装
每台机器上按照单节点模式安装,按照官网步骤安装:
sudo yum install yum-utils
sudo rpm --import https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPG
sudo yum-config-manager --add-repo https://repo.clickhouse.tech/rpm/clickhouse.repo
sudo yum install clickhouse-server clickhouse-client
sudo /etc/init.d/clickhouse-server start
clickhouse-client
二、 配置
在每台机器上添加配置文件/etc/metrika.xml
<yandex>
<!-- /etc/clickhouse-server/config.xml 中配置的remote_servers的incl属性值,-->
<clickhouse_remote_servers>
<!-- 3分片2备份 -->
<perftest_3shards_2replicas>
<!-- 数据分片1 -->
<shard>
<internal_replication>true</internal_replication>
<replica>
<host>master</host>
<port>9000</port>
</replica>
</shard>
<!-- 数据分片2 -->
<shard>
<replica>
<internal_replication>true</internal_replication>
<host>salve1</host>
<port>9000</port>
</replica>
</shard>
<!-- 数据分片3 -->
<shard>
<internal_replication>true</internal_replication>
<replica>
<host>salve2</host>
<port>9000</port>
</replica>
</shard>
<!-- 数据分片4 -->
<shard>
<replica>
<host>master</host>
<port>9000</port>
</replica>
</shard>
<!-- 数据分片5 -->
<shard>
<replica>
<host>salve1</host>
<port>9000</port>
</replica>
</shard>
</perftest_3shards_2replicas>
</clickhouse_remote_servers>
<!--zookeeper相关配置-->
<zookeeper-servers>
<node index="1">
<host>master</host>
<port>2181</port>
</node>
<node index="2">
<host>salve1</host>
<port>2181</port>
</node>
<node index="3">
<host>salve2</host>
<port>2181</port>
</node>
</zookeeper-servers>
<macros>
<replica>master</replica>
</macros>
<networks>
<ip>::/0</ip>
</networks>
<clickhouse_compression>
<case>
<min_part_size>10000000000</min_part_size>
<min_part_size_ratio>0.01</min_part_size_ratio>
<method>lz4</method>
</case>
</clickhouse_compression>
</yandex>
三、 每台机器上启动clickhouse-server
sudo /etc/init.d/clickhouse-server start
sudo /etc/init.d/clickhouse-server status
四、 任意一台机器上启动clickhouse-client,查看集群
五、导入外部json数据(待续)
cat stu.json | clickhouse-client --query=“INSERT INTO jsontest.stu_new FORMAT JSONEachRow”
推荐阅读
-
CentOS 7.x安装部署Memcached服务器的详细方法
-
Rabbit安装(单机及集群,阿里云)
-
在centos7下安装和部署java8和mysql
-
一张图讲解最少机器搭建FastDFS高可用分布式集群安装说明
-
Spark新手入门——2.Hadoop集群(伪分布模式)安装
-
Spring Cloud Alibaba | Nacos集群部署
-
Springboot 2.0.x 集成基于Centos7的Redis集群安装及配置
-
JAVAEE——宜立方商城06:Redis安装、数据类型和持久化方案、Redis集群分析与搭建、实现缓存和同步
-
Mysql基于Mysql Cluster+MysqlRouter的集群部署方案
-
阿里云服务器CentOS 6.3下快速安装部署 LAMP 、vsftpd 环境的方法