ClickHouse安装(成功安装)

1.下载安装包

下面通过阿里镜像(https://mirrors.aliyun.com/clickhouse/rpm/lts/)进行下载,下载哪里,自行指定。

# deb包下载使用如下4行
wget https://mirrors.aliyun.com/clickhouse/deb/pool/stable/clickhouse-client_22.8.5.29_amd64.deb \
wget https://mirrors.aliyun.com/clickhouse/deb/pool/stable/clickhouse-common-static-dbg_22.8.5.29_amd64.deb \
wget https://mirrors.aliyun.com/clickhouse/deb/pool/stable/clickhouse-common-static_22.8.5.29_amd64.deb \
wget https://mirrors.aliyun.com/clickhouse/deb/pool/stable/clickhouse-server_22.8.5.29_amd64.deb

2.安装包说明

  • clickhouse-common-static — ClickHouse编译的二进制文件。

  • clickhouse-server — 创建clickhouse-server软连接,并安装默认配置服务

  • clickhouse-client — 创建clickhouse-client客户端工具软连接,并安装客户端配置文件。

  • clickhouse-common-static-dbg — 带有调试信息的ClickHouse二进制文件。

3.安装

以下安装均使用rpm包进行。

切换到安装包所在目录,执行如下命令。

# deb包
sudo dpkg -i clickhouse*

安装过程打印如下:

dpkg-deb: error: 'clickhouse-client-21.10.6.2-2.noarch.rpm' is not a Debian format archive
dpkg: error processing archive clickhouse-client-21.10.6.2-2.noarch.rpm (--install):
 dpkg-deb --control subprocess returned error exit status 2
Selecting previously unselected package clickhouse-client.
(Reading database ... 88991 files and directories currently installed.)
Preparing to unpack clickhouse-client_22.8.5.29_amd64.deb ...
Unpacking clickhouse-client (22.8.5.29) ...
dpkg-deb: error: 'clickhouse-common-static-21.10.6.2-2.x86_64.rpm' is not a Debian format archive
dpkg: error processing archive clickhouse-common-static-21.10.6.2-2.x86_64.rpm (--install):
 dpkg-deb --control subprocess returned error exit status 2
Selecting previously unselected package clickhouse-common-static.
Preparing to unpack clickhouse-common-static_22.8.5.29_amd64.deb ...
Unpacking clickhouse-common-static (22.8.5.29) ...
dpkg-deb: error: 'clickhouse-common-static-dbg-21.10.6.2-2.x86_64.rpm' is not a Debian format archive
dpkg: error processing archive clickhouse-common-static-dbg-21.10.6.2-2.x86_64.rpm (--install):
 dpkg-deb --control subprocess returned error exit status 2
Selecting previously unselected package clickhouse-common-static-dbg.
Preparing to unpack clickhouse-common-static-dbg_22.8.5.29_amd64.deb ...
Unpacking clickhouse-common-static-dbg (22.8.5.29) ...
dpkg-deb: error: 'clickhouse-server-21.10.6.2-2.noarch.rpm' is not a Debian format archive
dpkg: error processing archive clickhouse-server-21.10.6.2-2.noarch.rpm (--install):
 dpkg-deb --control subprocess returned error exit status 2
Selecting previously unselected package clickhouse-server.
Preparing to unpack clickhouse-server_22.8.5.29_amd64.deb ...
Unpacking clickhouse-server (22.8.5.29) ...
Setting up clickhouse-common-static (22.8.5.29) ...
Setting up clickhouse-common-static-dbg (22.8.5.29) ...
Setting up clickhouse-server (22.8.5.29) ...
ClickHouse binary is already located at /usr/bin/clickhouse
Symlink /usr/bin/clickhouse-server already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-server to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-client already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-client to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-local already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-local to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-benchmark already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-benchmark to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-copier already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-copier to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-obfuscator already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-obfuscator to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-git-import to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-compressor already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-compressor to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-format already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-format to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-extract-from-config already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-extract-from-config to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-keeper already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-keeper to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-keeper-converter to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-disks to /usr/bin/clickhouse.
Creating clickhouse group if it does not exist.
 groupadd -r clickhouse
Creating clickhouse user if it does not exist.
 useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse clickhouse
Will set ulimits for clickhouse user in /etc/security/limits.d/clickhouse.conf.
Creating config directory /etc/clickhouse-server/config.d that is used for tweaks of main server configuration.
Creating config directory /etc/clickhouse-server/users.d that is used for tweaks of users configuration.
Config file /etc/clickhouse-server/config.xml already exists, will keep it and extract path info from it.
/etc/clickhouse-server/config.xml has /var/lib/clickhouse/ as data path.
/etc/clickhouse-server/config.xml has /var/log/clickhouse-server/ as log path.
Users config file /etc/clickhouse-server/users.xml already exists, will keep it and extract users info from it.
Creating log directory /var/log/clickhouse-server/.
Creating data directory /var/lib/clickhouse/.
Creating pid directory /var/run/clickhouse-server.
 chown -R clickhouse:clickhouse '/var/log/clickhouse-server/'
 chown -R clickhouse:clickhouse '/var/run/clickhouse-server'
 chown  clickhouse:clickhouse '/var/lib/clickhouse/'
 groupadd -r clickhouse-bridge
 useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse-bridge clickhouse-bridge
 chown -R clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-odbc-bridge'
 chown -R clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-library-bridge'
Enter password for default user: 
Password for default user is saved in file /etc/clickhouse-server/users.d/default-password.xml.
Setting capabilities for clickhouse binary. This is optional.
 chown -R clickhouse:clickhouse '/etc/clickhouse-server'

ClickHouse has been successfully installed.

Start clickhouse-server with:
 sudo clickhouse start

Start clickhouse-client with:
 clickhouse-client --password

Synchronizing state of clickhouse-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable clickhouse-server
Created symlink /etc/systemd/system/multi-user.target.wants/clickhouse-server.service → /lib/systemd/system/clickhouse-server.service.
Setting up clickhouse-client (22.8.5.29) ...
Errors were encountered while processing:
 clickhouse-client-21.10.6.2-2.noarch.rpm
 clickhouse-common-static-21.10.6.2-2.x86_64.rpm
 clickhouse-common-static-dbg-21.10.6.2-2.x86_64.rpm
 clickhouse-server-21.10.6.2-2.noarch.rpm

安装完成,并没有自动启动,要启动

sudo clickhouse start

然后查看状态和进程pid

sudo clickhouse status

有个进程是看门狗的。有个进程是clickhouse-server的

然后,使用clickhouse-client访问,命令如下:

clickhouse-client --password

4.连接,使用客户端连接

要想远程,<listen_host>::</listen_host>这个配置要取消注释。然后重启。就可以在我本地连接我的腾讯云主机上的clickhouse了。

相关推荐

  1. ClickHouse安装和部署

    2024-05-02 07:40:02       75 阅读
  2. Ubuntu下ClickHouse安装

    2024-05-02 07:40:02       31 阅读
  3. Electron 安装成功

    2024-05-02 07:40:02       64 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-02 07:40:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-02 07:40:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-05-02 07:40:02       82 阅读
  4. Python语言-面向对象

    2024-05-02 07:40:02       91 阅读

热门阅读

  1. 关于阿里云DataWorks的20道面试题

    2024-05-02 07:40:02       28 阅读
  2. C++每日一练——两个数组的交集

    2024-05-02 07:40:02       30 阅读
  3. Cockpit简介

    2024-05-02 07:40:02       32 阅读
  4. AtCoder Beginner Contest 351(补题A~F)

    2024-05-02 07:40:02       31 阅读
  5. 从0到1使用TS实现一个node.js脚手架工具

    2024-05-02 07:40:02       29 阅读
  6. 微信小程序标题设置

    2024-05-02 07:40:02       31 阅读
  7. MongoDB聚合运算符:$substr

    2024-05-02 07:40:02       30 阅读
  8. Stylus介绍

    2024-05-02 07:40:02       32 阅读
  9. Android学习系列目录

    2024-05-02 07:40:02       39 阅读
  10. OpenCV 开源的计算机视觉和机器学习软件库

    2024-05-02 07:40:02       30 阅读
  11. 【at89s52单片机的冒泡排序使用指针】2022-4-30

    2024-05-02 07:40:02       38 阅读