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 :可以在命令窗口输入多行命令
相关推荐
咖丨喱17 分钟前
【MMC Core + hc16 Host(WiFi SDIO 如何落到控制器)】
linux
等我调个Bug26 分钟前
【Linux系统篇】权限
linux·服务器
~光~~1 小时前
【嵌入式linux学习】Cache 策略:Write-Through / Write-Back + Allocation
linux·学习·spring
峥无2 小时前
Linux NPTL线程:创建/终止/等待/分离/栈布局内核原理|线程下篇
linux·运维·线程
是jin奥3 小时前
Ubuntu 访问 Windows 共享目录
linux·运维·ubuntu
Gauss松鼠会3 小时前
【GaussDB】破除gaussdb ugin索引支持中文模糊查询的迷思-字符序
java·运维·服务器·网络·数据库·gaussdb·经验总结
Bruce_Liuxiaowei3 小时前
内网“影子资产“:串口服务器安全盲区剖析
服务器·网络·安全·iot
星恒随风3 小时前
Linux基础IO万字详解:从文件描述符fd到重定向、FILE缓冲机制及MiniShell升级
linux·运维·笔记·学习·状态模式
yunwei373 小时前
eBPF 入门开发实践教程一:Hello World,基本框架和开发流程
linux·后端·性能优化
小雪崩3 小时前
嵌入式学习 day65:Linux驱动进阶——pinctrl 子系统和 platform 驱动框架
linux·学习·驱动