CentOS7.8 安装clickhouse
安装介质
-rw-r–r--. 1 root root 6376 May 24 11:44 clickhouse-client-20.3.8.53-1.el7.x86_64.rpm
-rw-r–r--. 1 root root 54655204 May 24 10:49 clickhouse-common-static-20.3.8.53-1.el7.x86_64.rpm
-rw-r–r--. 1 root root 34524088 May 23 17:09 clickhouse-server-20.3.8.53-1.el7.x86_64.rpm
-rw-r–r--. 1 root root 11216 May 23 17:09 clickhouse-server-common-20.3.8.53-1.el7.x86_64.rpm
-rw-r–r--. 1 root root 1696804 May 23 10:33 clickhouse-test-20.3.8.53-1.el7.x86_64.rpm
#划分区
fdisk -l
partprobe
mkfs.xfs /dev/sda4
#自动挂载
blkid
vi /etc/fstab
mount /dev/sda4 /app
#######################################以下操作可以忽略跳过############################
#CentOS取消打开文件数限制
vi /etc/security/limits.conf
#末尾加入一下内容
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
vi /etc/security/limits.d/20-nproc.conf
#末尾加入一下内容
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
vi /etc/selinux/config
修改SELINUX=disabled后重启
#关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
#安装
rpm -ivh clickhouse-server-common-20.3.8.53-1.el7.x86_64.rpm
rpm -ivh clickhouse-common-static-20.3.8.53-1.el7.x86_64.rpm
rpm -ivh clickhouse-server-20.3.8.53-1.el7.x86_64.rpm
rpm -ivh clickhouse-client-20.3.8.53-1.el7.x86_64.rpm
#修改配置文件
vi /etc/clickhouse-server/config.xml
修改文件目录及日志目录
<?xml version="1.0"?>
<!--
NOTE: User and query level settings are set up in "users.xml" file.
-->
<yandex>
<logger>
<!-- Possible levels: https://github.com/pocoproject/poco/blob/poco-1.9.4-release/Foundation/include/Poco/Logger.h#L105 -->
<level>trace</level>
<log>/app/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/app/log/clickhouse-server/clickhouse-server.err.log</errorlog>
<size>1000M</size>
<count>10</count>
<!-- <console>1</console> --> <!-- Default behavior is autodetection (log to console if not daemon mode and is tty) -->
</logger>
<!--display_name>production</display_name--> <!-- It is the name that will be shown in the client -->
<http_port>8123</http_port>
<tcp_port>9000</tcp_port>
<mysql_port>9004</mysql_port>
<!-- For HTTPS and SSL over native protocol. -->
<!--
<https_port>8443</https_port>
<tcp_port_secure>9440</tcp_port_secure>
-->
<!-- Used with https_port and tcp_port_secure. Full ssl options list: https://github.com/ClickHouse-Extras/poco/blob/master/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h#L71 -->
<openSSL>
<server> <!-- Used for https server AND secure tcp port -->
<!-- openssl req -subj "/CN=localhost" -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /etc/clickhouse-server/server.key -out /etc/clickhouse-server/server.crt -->
<certificateFile>/etc/clickhouse-server/server.crt</certificateFile>
<privateKeyFile>/etc/clickhouse-server/server.key</privateKeyFile>
<!-- openssl dhparam -out /etc/clickhouse-server/dhparam.pem 4096 -->
<dhParamsFile>/etc/clickhouse-server/dhparam.pem</dhParamsFile>
<verificationMode>none</verificationMode>
<loadDefaultCAFile>true</loadDefaultCAFile>
<cacheSessions>true</cacheSessions>
<disableProtocols>sslv2,sslv3</disableProtocols>
<preferServerCiphers>true</preferServerCiphers>
</server>
<client> <!-- Used for connecting to https dictionary source -->
<loadDefaultCAFile>true</loadDefaultCAFile>
<cacheSessions>true</cacheSessions>
<disableProtocols>sslv2,sslv3</disableProtocols>
<preferServerCiphers>true</preferServerCiphers>
<!-- Use for self-signed: <verificationMode>none</verificationMode> -->
<invalidCertificateHandler>
<!-- Use for self-signed: <name>AcceptCertificateHandler</name> -->
<name>RejectCertificateHandler</name>
</invalidCertificateHandler>
</client>
</openSSL>
<!-- Default root page on http[s] server. For example load UI from https://tabix.io/ when opening http://localhost:8123 -->
<!--
<http_server_default_response><![CDATA[<html ng-app="SMI2"><head><base href="http://ui.tabix.io/"></head><body><div ui-view="" class="content-ui"></div><script src="http://loader.tabix.io/master.js"></script></body></html>]]></http_server_default_response>
-->
<!-- Port for communication between replicas. Used for data exchange.