暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

ClickHouse 的安装

Ty3306 2022-12-20
360

ClickHouse 的安装

2.1 准备工作

2.1.1 确定防火墙处于关闭状态

2.1.2 CentOS 取消打开文件数限制

➢ 在 hadoop102 的 /etc/security/limits.conf 文件的末尾加入以下内容

[atguigu@hadoop102 ~]$ sudo vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
  • 1
  • 2
  • 3
  • 4
  • 5

➢ 在 hadoop102 的/etc/security/limits.d/20-nproc.conf 文件的末尾加入以下内容

[atguigu@hadoop102 ~]$ sudo vim /etc/security/limits.d/20-nproc.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
  • 1
  • 2
  • 3
  • 4
  • 5

➢ 执行同步操作

[atguigu@hadoop102 ~]$ sudo /home/atguigu/bin/xsync /etc/security/limits.conf
[atguigu@hadoop102 ~]$ sudo /home/atguigu/bin/xsync /etc/security/limits.d/20-nproc.conf
  • 1
  • 2

2.1.3 安装依赖

[atguigu@hadoop102 ~]$ sudo yum install -y libtool
[atguigu@hadoop102 ~]$ sudo yum install -y *unixODBC*
  • 1
  • 2

在 hadoop103、hadoop104 上执行以上操作

2.1.4 CentOS 取消 SELINUX

➢ 修改/etc/selinux/config 中的 SELINUX=disabled

[atguigu@hadoop102 ~]$ sudo vim /etc/selinux/config
SELINUX=disabled
  • 1
  • 2

注意:别改错了
➢ 执行同步操作

[atguigu@hadoop102 ~]$ sudo /home/atguigu/bin/xsync /etc/selinux/config
  • 1

➢ 重启三台服务器

2.2 单机安装

官网:https://clickhouse.yandex/
下载地址:http://repo.red-soft.biz/repos/clickhouse/stable/el6/

2.2.1 在 hadoop102 的 /opt/software 下 创 建clickhouse 目录

[atguigu@hadoop102 software]$ mkdir clickhouse
  • 1

2.2.2 将 /2. 资 料 /ClickHouse 下 4 个文件 上 传 到hadoop102 的 software/clickhouse 目录下

2.2.3 将安装文件同步到 hadoop103、hadoop104

[atguigu@hadoop102 software]$ xsync clickhouse
  • 1

2.2.4 分别在三台机子上安装这 4 个 rpm 文件

[atguigu@hadoop102 clickhouse]$ sudo rpm -ivh *.rpm
  • 1

sudo rpm -qa|grep clickhouse 查看安装情况

2.2.5 修改配置文件

[atguigu@hadoop102 clickhouse]$ sudo vim /etc/clickhouse-server/config.xml
  • 1

把 <listen_host>::</listen_host> 的注释打开,这样的话才能让 ClickHouse 被除本机

分发配置文件

sudo /home/atguigu/bin/xsync /etc/clickhouse-server/config.xml
  • 1

在这个文件中,有 ClickHouse 的一些默认路径配置,比较重要的
数据文件路径:<path>/var/lib/clickhouse/</path>
日志文件路径:<log>/var/log/clickhouse-server/clickhouse-server.log</log>

2.2.6 启动 Server

[atguigu@hadoop102 clickhouse]$ sudo systemctl start clickhouse-server
  • 1

2.2.7 三台机器上关闭开机自启

[atguigu@hadoop102 clickhouse]$sudo systemctl disable clickhouse-server
  • 1

2.2.8 使用 client 连接 server

[atguigu@hadoop102 clickhouse]$ clickhouse-client -m
  • 1

-m :可以在命令窗口输入多行命令

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论