Centos7安装Clickhouse单节点部署

部署流程

1、关闭防火墙&沙盒

关闭防火墙并关闭开机自启动

shell 复制代码
systemctl stop firewalld && systemctl disable firewalld

查看selinux状态是否为disabled,否则修改

shell 复制代码
[root@localhost ~]# getenforce
Enforcing

修改为disabled

shell 复制代码
vim /etc/selinux/config
#修改
SELINUX=disabled
#重启生效
reboot

2、修改打开文件数限制

在 /etc/security/limits.conf文件的末尾加入以下内容

shell 复制代码
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

在/etc/security/limits.d/20-nproc.conf文件的末尾加入以下内容

shell 复制代码
vim /etc/security/limits.d/20-nproc.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

3、安装依赖

shell 复制代码
yum install -y libtool
yum install -y *unixODBC*

4、Clickhouse安装包的下载

shell 复制代码
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
sudo yum install -y clickhouse-server clickhouse-client

sudo /etc/init.d/clickhouse-server start
clickhouse-client # or "clickhouse-client --password" if you set up a password.

解除IP访问限制

shell 复制代码
vim /etc/clickhouse-server/config.xml
 #114行打开注释
<listen_host>::</listen_host>

设置密码

加密方式有三种

clickhouse密码可以可以设置 SHA256 ,SHA1和明文三种方式。

shell 复制代码
vim /etc/clickhouse-server/users.xml
#58行根据情况进行修改

在线密码转换:https://www.toolhelper.cn/DigestAlgorithm/SHA

  • SHA256
shell 复制代码
<password_sha256_hex></password_sha256_hex>
  • SHA1
shell 复制代码
<password_double_sha1_hex></password_double_sha1_hex>
  • 明文
shell 复制代码
<password></password>

clickhouse相关

1、相关命令

shell 复制代码
#查看命令
clickhouse --help 
#启动
clickhouse start 
#重启
clickhouse restart

2、相关目录

shell 复制代码
命令目录
/usr/bin
配置文件目录
cd /etc/clickhouse-server/
日志目录
cd /var/log/clickhouse-server/
数据文件目录
cd /var/lib/clickhouse/

四、使用client连接server

shell 复制代码
#第一种连接(适用无密码)
clickhouse-client -m
#第二种连接
clickhouse-client --host=你的IP --port=9000 --user=default --password=你的密码
-m :可以在命令窗口输入多行命令
相关推荐
Fu_Lin_19 小时前
Qt嵌入式从零基础到精通(01):Qt嵌入式开发全景图:从桌面Qt到ARM Linux
linux·arm开发·qt·qt5·嵌入式linux
池央19 小时前
NAS里的大文件怎么快速传?用Copyparty搭建轻量文件服务器
运维·服务器·cpolar
金海境科技19 小时前
【服务器数据恢复】H3C CAS虚拟化平台HP存储qcow2文件损坏快照丢失数据恢复案例
服务器·数据库·经验分享
lczllx19 小时前
从 TCP 90μs 到 SHM 28μs:我的 RPC 框架零拷贝优化历程
linux·后端
发量惊人的中年网工20 小时前
AI服务器托管怎么选机房?GPU集群对机柜、电力和网络的硬要求
服务器·网络·人工智能
盐焗鹌鹑蛋20 小时前
【Linux】权限
linux
玖玥拾20 小时前
Unity 3D 笔记(十五)Unity/C# Socket 网络笔记4
服务器·网络·unity·c#
小此方20 小时前
Re:Linux系统篇(四十六)信号篇·四:一文串联操作系统底层:时钟中断、内核态切换、系统调用与 Linux 信号处理全解析
linux·驱动开发·信号处理
羑悻的小杀马特1 天前
把随身WiFi改成网盘聚合器:中兴F50挂载本地存储+夸克网盘实战
运维·服务器·人工智能·网盘·openlist
无人生还别怕1 天前
如何制作一个linux标准iso镜像
linux·iso·opencloudos·openanolisos