前言:
眼前小伙伴们对“centoslz4安装包”大体比较关心,同学们都需要学习一些“centoslz4安装包”的相关内容。那么小编在网络上汇集了一些关于“centoslz4安装包””的相关内容,希望朋友们能喜欢,咱们一起来学习一下吧!1.1 单机安装clickhouse
1)Clickhouse安装包下载地址:
安装环境为Centos7版本。
2) 选择的版本:
clickhouse-server-20.3.9.70-2.noarch.rpm
clickhouse-client-20.3.9.70-2.noarch.rpm
clickhouse-common-static-20.3.9.70-2.x86_64.rpm
3) 安装各个组件
1、 rpm -ivh clickhouse-common-static-20.3.9.70-2.x86_64.rpm
2、rpm -ivh clickhouse-server-20.3.9.70-2.noarch.rpm
3、rpm -ivh clickhouse-client-20.3.9.70-2.noarch.rpm
4)修改配置/etc/clickhouse-server/config.xml
1、开放远程连接: <listen_host>::</listen_host>
2、数据目录改为服务器最大的数据盘,如此处是/data2:
<path>/data2/clickhouse/</path><tmp_path>/data2/clickhouse/tmp/</tmp_path><user_files_path>/data2/clickhouse/user_files/</user_files_path><format_schema_path>/data2/clickhouse/format_schemas/</format_schema_path>
3、配置日志文件切割 (200M做一个切割,ClickHouse存储的已归档日志文件的数量 设置为 10)
<size>200M</size><count>10</count>
4、其他配置
<keep_alive_timeout>900</keep_alive_timeout><default_session_timeout>600</default_session_timeout><use_uncompressed_cache>1</use_uncompressed_cache><max_memory_usage>20000000000</max_memory_usage><password>123456</password><tcp_port>9900</tcp_port>
配置完毕后启动clickhouse
sudo service clickhouse-server start
sudo service clickhouse-server status查看状态
测试单机版是否安装成功
clickhouse-client -m --user default --password 123456 --port 9000
node1 :) select now(); -- 执行语句
1.2 集群安装
1) 在三台机器上重复1.1章节,都安装上clickhouse
2) 在三台机器上修改配置文件 /etc/clickhouse-server/config.xml
3) 在三台机器的 etc 目录下新建 metrika.xml 文件
<yandex><clickhouse_remote_servers><!-- 定义的集群名 --><perftest_3shards_1replicas> <shard> <internal_replication>true</internal_replication> <replica> <host>node2</host> <port>9900</port> <user>default</user> <password>123456</password> </replica> </shard> <shard> <internal_replication>true</internal_replication> <replica> <host>node3</host> <port>9900</port> <user>default</user> <password>123456</password> </replica> </shard> <shard> <internal_replication>true</internal_replication> <replica> <host>node4</host> <port>9900</port> <user>default</user> <password>123456</password> </replica> </shard></perftest_3shards_1replicas></clickhouse_remote_servers><zookeeper-servers><node index="1"> <host>node2</host> <port>2181</port></node><node index="2"> <host>node3</host> <port>2181</port></node><node index="3"> <host>node4</host> <port>2181</port></node></zookeeper-servers><macros><replica>node1</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>
3) 三台服务器上都安装zookeeper,并已启动;其安装请自行百度。
在三台服务器上分别执行: service clickhouse-server start
查看集群
clickhouse-client -m --user default --password 123456 --port 9900
select * from system.clusters
可以查看到集群的状态,则说明安装成功
标签: #centoslz4安装包