clickhouse安装部署详细步奏,让你学习之路少走坑

    科技2022-07-11  118

    1.安装前准备工作 1.1设置CentOS7 打开文件数限制 sudo vim /etc/security/limits.conf

    soft nofile 65536 hard nofile 65536 soft nproc 131072 hard nproc 131072

    在sudo vim /etc/security/limits.d/90-nproc.conf 这个文件的末尾加入一下内容:

    soft nofile 65536 hard nofile 65536 soft nproc 131072 hard nproc 131072

    设置完成重启虚拟机 sudo reboot 重启服务器之后生效,用 ulimit -n 或者 ulimit -a 查看设置结果 ulimit -n

    1.2系统要求 ClickHouse可以在任何具有x86_64,AArch64或PowerPC64LE CPU架构的Linux,FreeBSD或Mac OS X上运行。 虽然预构建的二进制文件通常是为x86 _64编译并利用SSE 4.2指令集,但除非另有说明,否则使用支持它的CPU将成为额外的系统要求。这是检查当前CPU是否支持SSE 4.2的命令: $ grep -q sse4_2 /proc/cpuinfo && echo “SSE 4.2 supported” || echo “SSE 4.2 not supported” 设置防火墙状态systemctl status firewalld.service 设置防火墙开机自动重启systemctl enable firewalld 2.下载安装包 安装官网简略教程下载tgz安装包 https://repo.clickhouse.tech/tgz/stable/ 2.1将安装包上传到虚拟机中 2.1将安装包tar开并依次执行./doinst.sh文件 tar -zxvf clickhouse-common-static-20.5.4.40.tgz cd clickhouse-common-static-20.5.4.40/install sudo doinst.sh tar -zxvf clickhouse-common-static-dbg-20.5.4.40.tgz cd clickhouse-common-static-dbg-20.5.4.40/install sudo doinst.sh tar -zxvf clickhouse-server-20.5.4.40.tgz cd clickhouse-server-20.5.4.40/install sudo doinst.sh tar -zxvf clickhouse-client-20.5.4.40.tgz cd clickhouse-client-20.5.4.40/install sudo doinst.sh 2.2安装核心目录介绍 2.3修改sevetl的默认存储目录需要 sudo vim /etc/clickhouse-server/config.xml 3.启动服务 clickhouse-server --config-file=/etc/clickhouse-server/config.xml 报错如下解决方案:修改安装目录的权限!,默认使用clickhouse用户!命令为 cd /var/lib/ chown -R root:root clickhous 4.修改完成后,启动clickhouse服务 clickhouse-server --config-file=/etc/clickhouse-server/config.xml 5.查看服务是否启动起来 ps -aux | grep clickhouse 6.启动client客户端 后续集群模式敬请期待

    Processed: 0.048, SQL: 8