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 :可以在命令窗口输入多行命令
相关推荐
Christal_pyy9 分钟前
树莓派4基于Debian GNU/Linux 12 (Bookworm)添加多个静态ipv4网络
linux·网络·debian
csbDD1 小时前
2025年网络安全(黑客技术)三个月自学手册
linux·网络·python·安全·web安全
小金的学习笔记2 小时前
如何在本地和服务器新建mysql用户和密码
运维·服务器·mysql
EasyNVR2 小时前
EasyRTC智能硬件:实时畅联、沉浸互动、消音护航
运维·服务器·网络·安全·音视频·webrtc·p2p
风口上的猪20153 小时前
thingboard告警信息格式美化
java·服务器·前端
Natsuagin3 小时前
轻松美化双系统启动界面与同步时间设置(Windows + Ubuntu)
linux·windows·ubuntu·grub
我们的五年4 小时前
【Linux网络编程】应用层协议HTTP(请求方法,状态码,重定向,cookie,session)
linux·网络·http
xing.yu.CTF5 小时前
Web入侵实战分析-常见web攻击类应急处置实验2
运维·服务器·windows·web安全·apache·php漏洞·phpstudy后门漏洞
小池先生5 小时前
阿里云子账号管理ECS权限配置全指南
服务器·阿里云·云计算
我们的五年6 小时前
【Linux网络】TCP/IP地址的有机结合(有能力VS100%???),IP地址的介绍
linux·运维·网络·tcp/ip