CentOS7.8 安装单机clickhouse

本文详细介绍了如何在CentOS7.8上安装ClickHouse,包括安装RPM包、分区、挂载、配置文件修改以及远程连接设置。通过步骤指导,实现ClickHouse的顺利部署。
摘要由CSDN通过智能技术生成

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值