惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
V2EX - 技术
V2EX - 技术
K
Kaspersky official blog
Know Your Adversary
Know Your Adversary
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
I
Intezer
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
博客园 - Franky
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
Recorded Future
Recorded Future
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
The Hacker News
The Hacker News
T
Tenable Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
雷峰网
雷峰网
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Webroot Blog
Webroot Blog
L
LangChain Blog
C
Check Point Blog
N
News | PayPal Newsroom
L
LINUX DO - 热门话题
T
Tor Project blog
V
Visual Studio Blog
Microsoft Security Blog
Microsoft Security Blog
S
Security Affairs
Schneier on Security
Schneier on Security
Hacker News: Ask HN
Hacker News: Ask HN
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Security Latest
Security Latest
MyScale Blog
MyScale Blog
Cyberwarzone
Cyberwarzone
N
Netflix TechBlog - Medium
Scott Helme
Scott Helme
PCI Perspectives
PCI Perspectives
The Last Watchdog
The Last Watchdog
人人都是产品经理
人人都是产品经理
W
WeLiveSecurity

博客园 - 百衲本

Centos7 副本集模式部署 MongoDB centos7部署Nacos集群模式 k8s高可用部署Seata kubernetes中pod磁盘占用排查 jumpserver V3 终端常用操作 Python 列表生成式、字典生成式与生成器表达式 Python 的可迭代对象、迭代器对象与生成器 python email模块自动化操作邮件 python yagmail 模块自动化操作邮件 python自动化操作PDF 国内企业邓白氏编码免费申请流程 Python psutil模块 免费公共API调用清单 Python pathlib 模块 容器网络故障排查:从 ping 到 tcpdump 的全链路思路 systemd详解 APP性能指标 Linux 上禁用 USB 存储设备 线上故障的排查清单,运维小哥拿走不谢!
centos7 yum快速安装clickhouse单机版
百衲本 · 2026-03-19 · via 博客园 - 百衲本

一、系统环境配置

vim /etc/security/limits.conf 
* soft nofile 65536
* hard nofile 131072
* soft nproc 30000 #ClickHouse推荐不小于30000
* hard nproc 30000
* soft memlock unlimited
* hard memlock unlimited

echo "kernel.task_delayacct = 1" >>  /etc/sysctl.conf #启用延迟统计
echo never > /sys/kernel/mm/transparent_hugepage/enabled #禁用透明大页
echo never > /sys/kernel/mm/transparent_hugepage/defrag

reboot #重启

二、配置yum仓库及安装clickhouse

yum install -y yum-utils
yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
yum repolist
yum install -y clickhouse-server-25.5.2.47-1 clickhouse-client-25.5.2.47-1
cd /etc/clickhouse-server/
total 104
dr-x------ 2 clickhouse clickhouse  4096 2025-06-11 10:45 config.d #在该目录下自定义配置,可覆盖config.xml中的配置
-r-------- 1 clickhouse clickhouse 88163 2025-06-03 00:46 config.xml #服务的主要配置,包含监听端口、路径设置、日志配置等核心参数,不建议修改此文件,而是在config.d/ 中自定义配置文件覆盖设置,如下面的cusom.xml
dr-x------ 2 clickhouse clickhouse  4096 2025-06-11 10:35 users.d  #在该目录下自定义配置,覆盖users.xml中的配置
-r-------- 1 clickhouse clickhouse  5724 2025-06-03 00:46 users.xml #定义用户、权限、配额和配置文件,包含用户密码、访问权限、内存限制等设置。同config.xml配置文件,不建议直接修改
cd config.d/
vim custom.xml
<yandex>
    <listen_host>0.0.0.0</listen_host>
</yandex>


systemctl start clickhouse-server.service
systemctl status clickhouse-server.service  #如果有报错,日志在/var/log/clickhouse-server/ 
systemctl enable clickhouse-server.service

netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:9009            0.0.0.0:*               LISTEN      50748/clickhouse-se 
tcp        0      0 0.0.0.0:9004            0.0.0.0:*               LISTEN      50748/clickhouse-se 
tcp        0      0 0.0.0.0:9005            0.0.0.0:*               LISTEN      50748/clickhouse-se 
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      50748/clickhouse-se 
tcp        0      0 0.0.0.0:8123            0.0.0.0:*               LISTEN      50748/clickhouse-se #web页面,可以通HTTP写访问

三、验证

[root@clickhouse01 clickhouse-server]# clickhouse-client -m #兼容大部分SQL语句 
clickhouse01 :) show databases;
   ┌─name───────────────┐
1. │ INFORMATION_SCHEMA │
2. │ default3. │ information_schema │
4. │ system             │
   └────────────────────┘
clickhouse01 :) use system;
USE system
clickhouse01 :) show tables;

     ┌─name───────────────────────────┐
  1. │ aggregate_function_combinators │
  2. │ asynchronous_inserts           │
  3. │ asynchronous_loader            │
  ......
clickhouse01 :) exit;

参考文档:https://clickhouse.com/docs/zh/starter-guides