当前位置:   article > 正文

ClickHouse实时分析(二)- ClickHouse的安装部署教程_clickhouse rpm部署

clickhouse rpm部署

原文地址:https://program-park.github.io/2022/03/23/clickhouse_2/

1. 准备工作

  演示环境还是用 CentOS 服务器 hadoop121。
  ClickHouse 不需要依赖其他的组件,自己就能够提供非常强悍的数据处理性能。支持的安装环境非常多,安装方式也有很多种。这里,我们用 RPM 方式进行安装。
  下面先做一些安装前的准备工作。

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

firewall-cmd --state    #查看防火墙状态
systemctl stop firewalld.service  #停止firewalld服务
systemctl disable firewalld.service  #开机禁用firewalld服务
  • 1
  • 2
  • 3

1.2 CentOS取消打开文件数限制

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

* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
  • 1
  • 2
  • 3
  • 4

1.3 安装依赖

  sudo yum install -y libtool

在这里插入图片描述
  sudo yum install -y *unixODBC*

在这里插入图片描述

1.4 CentOS取消SELINUX

  修改/etc/selinux/config中的 SELINUX=disabled
在这里插入图片描述

1.5 下载安装包

  准备工作完成后下载 Clickhouse。下载地址:https://packages.clickhouse.com/rpm/stable/。我这里下载的是最新的 22.3.2.2 版本。
  下载如下四个文件:

在这里插入图片描述

2. 开始安装

  1. 文件上传到服务器;
    在这里插入图片描述
  2. 在服务器上安装 rpm 文件,sudo rpm -ivh *.rpm
    在这里插入图片描述
    sudo rpm -qa | grep clickhouse查看安装情况;
  3. 修改配置文件,sudo vim /etc/clickhouse-server/config.xml,打开<listen_host>::</listen_host>标签,让 ClickHouse 被除本机以外的服务器访问;
    在这里插入图片描述
    在这个配置文件中,有 ClickHouse 的一些比较重要的默认路径配置:
    数据文件路径,<path>/var/lib/clickhouse/</path>
    日志文件路径,<log>/var/log/clickhouse-server/clickhouse-server.log</log>
  4. 配置登录密码,默认登录账户为 defaultsudo vim /etc/clickhouse-server/users.xml
    在这里插入图片描述
  5. 启动 server,sudo systemctl start clickhouse-server
    在这里插入图片描述
  6. 关闭开机自启,sudo systemctl disable clickhouse-server
    在这里插入图片描述
  7. 使用 client 连接 server,clickhouse-client -u default --password 123456
    在这里插入图片描述
  8. 安装成功。

参考文献

  【1】https://clickhouse.com/docs/zh/
  【2】https://www.bilibili.com/video/BV1Yh411z7os?from=search&seid=4579023877699743987&spm_id_from=333.337.0.0

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/246479
推荐阅读