先做些准備工作:
不同版本的centos系統可能不一致,需要自己注意
1 .CentOS取消打開文件數限制
在/etc/security/limits.conf、/etc/security/limits.d/90-nproc.conf這2個文件的末尾加入一下內容:
[root@hadoop102 software]# vim /etc/security/limits.conf
在文件末尾添加:
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
[root@hadoop102 software]# vim /etc/security/limits.d/90-nproc.conf
在文件末尾添加:
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
重啟服務器之后生效,用ulimit -n 或者ulimit -a查看設置結果
[root@hadoop102 ~]# ulimit -n
65536
2。 CentOS取消SELINUX
修改/etc/selinux/config中的SELINUX=disabled后重啟
[root@hadoop102 ~]# vim /etc/selinux/config
SELINUX=disabled
3。 關閉防火牆
[root@hadoop102 ~]# service iptables stop
[root@hadoop102 ~]# service ip6tables stop
ip6tables:將 chains 設置為 ACCEPT 策略:filter [確定]
ip6tables:清除防火牆規則: [確定]
:正在卸載模塊: [確定]
4. 安裝依賴
[root@hadoop102 ~]# yum install -y libtool
[root@hadoop102 ~]# yum install -y *unixODBC*
開始進入正題:
1.首先要確定你是centos6還是centos7,樓主在這步被坑了好幾天,centos6安裝的是el6,centos7安裝的是el7,
下載鏈接:http://repo.red-soft.biz/repos/clickhouse/stable/el7/ ,注意你自己的centos版本!!!
2.上傳文件到你的linux服務器,先到你的clickhouse目錄下,直接執行rpm安裝完事
3.可能會遇到的問題:
1.libicudata.so.42() is needed by .....
這就是因為你的版本不對,本來你是centos7卻安裝了el6版本的clickhouse,然后你再下libicu包的時候你的libicudata.so其實50版本的,所以這里你要注意好自己的系統版本。
2.error: Failed dependencies: libodbc.so.2()(64bit) is needed by clickhouse-server-1.1.54362-1.el6.x86_64
這就是因為你偷懶了,沒有看安裝的前置條件,返回去看看你的准備工作。把這兩個依賴加上即可
[root@hadoop102 ~]# yum install -y libtool
[root@hadoop102 ~]# yum install -y *unixODBC*