目录
[2、CentOS 取消打开文件数限制](#2、CentOS 取消打开文件数限制)
一、准备工作
1、确定防火墙处于关闭状态
bash
[root@hallo102 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@hallo102 ~]#
2、CentOS 取消打开文件数限制
在 /etc/security/limits.conf 文件的末尾加入以下内容
bash
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
- 第一列是限制的用户和用户组
- soft软限制,hard硬限制
- nofile打开文件数,nproc用户进程数
在/etc/security/limits.d/20-nproc.conf
文件的末尾加入以下内容
bash
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
退出当前用户,重启登录,ulimit -a
查看打开文件数和用户进程数是否更改
root@hallo102 \~\]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 11687 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited **open files (-n) 65536** pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited **max user processes (-u) 131072** virtual memory (kbytes, -v) unlimited file locks (-x) unlimited \[root@hallo102 \~\]#
3、安装依赖
root@hallo102 \~\]# yum install -y libtool \[root@hallo102 \~\]# yum install -y \*unixODBC\*
4、CentOS取消SELINUX
root@hallo102 \~\]# vim /etc/selinux/config **SELINUX=disabled**
修改完重启服务器
二、单机安装
下载地址:https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/
2.1、下载安装
需要以下四个rpm包:
clickhouse-client-21.7.3.14-2.noarch.rpm
clickhouse-common-static-21.7.3.14-2.x86_64.rpm
clickhouse-common-static-dbg-21.7.3.14-2.x86_64.rpm
clickhouse-server-21.7.3.14-2.noarch.rpm

2.2、安装这4个rpm包
root@hallo102 clickhouse\]# rpm -ivh \*.rpm
```bash
[root@hallo102 clickhouse]# ll
总用量 938164
-rw-r--r-- 1 root root 78074 11月 16 21:40 clickhouse-client-21.7.3.14-2.noarch.rpm
-rw-r--r-- 1 root root 174283244 11月 16 21:40 clickhouse-common-static-21.7.3.14-2.x86_64.rpm
-rw-r--r-- 1 root root 786208040 11月 16 21:40 clickhouse-common-static-dbg-21.7.3.14-2.x86_64.rpm
-rw-r--r-- 1 root root 101969 11月 16 21:40 clickhouse-server-21.7.3.14-2.noarch.rpm
[root@hallo102 clickhouse]# rpm -ivh *.rpm
```
### 2.3、修改配置文件
```bash
[root@hallo102 clickhouse]# cd /etc/clickhouse-server/
[root@hallo102 clickhouse-server]# chmod 777 config.xml
[root@hallo102 clickhouse-server]# ls
config.d config.xml users.d users.xml
[root@hallo102 clickhouse-server]# vim config.xml
```
把**`