ClickHouse安装(成功安装)

embedded/2024/10/18 18:24:00/

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-bridgeuseradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse-bridge clickhouse-bridgechown -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 startStart clickhouse-client with:clickhouse-client --passwordSynchronizing 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.rpmclickhouse-common-static-21.10.6.2-2.x86_64.rpmclickhouse-common-static-dbg-21.10.6.2-2.x86_64.rpmclickhouse-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了。


http://www.ppmy.cn/embedded/28313.html

相关文章

Python项目开发实战:怎么基于Keras的深度学习来预测房价

注意:本文的下载教程,与以下文章的思路有相同点,也有不同点,最终目标只是让读者从多维度去熟练掌握本知识点。 下载教程:深度学习-基于Keras的Python项目开发实战_波士顿房价预测_编程案例实例教程.pdf 一、引言 在当今信息化社会,房价预测已成为金融、房地产及相关领域…

一加Ace3/12/Ace2pro手机ColorOS14刷KernelSU内核ROOT-解决无限重启变砖

一加Ace3/一加12/一加11等手机升级了安卓14底层&#xff0c;并且ColorOS版本也更新到了14版本界面和功能都比之前的系统表现更加优秀&#xff0c;但刷机方面&#xff0c;相对之前存在一些差异&#xff0c;特别是KernelSU内核级别root权限&#xff0c;不再支持一键刷入KernelSU通…

Android13锁屏或灭屏状态下,快速按两次音量下键实现打开闪光灯功能

实现思路&#xff1a; 1、发送广播 WindowManagerService循环读取下面按键消息并分发给窗口&#xff0c;在消息分发前会在PhoneWindowManager.interceptKeyBeforeQueueing方法中进行消息的过滤。因此该实现方式为在消息分发前的interceptKeyBeforeQueueing方法中监听当前按键为…

【ARM Cache 系列文章 11.1 -- ARM Cache 全相连 详细介绍】

请阅读【ARM Cache 系列文章专栏导读】 文章目录 Cache 全相连(Fully Associative)全相联映射示例全相联映射原理紧接文章:【ARM Cache 系列文章 11 – ARM Cache 组织形式详细介绍】 Cache 全相连(Fully Associative) 介绍: 在全相连缓存中,任何内存地址都可以缓存在 …

ssm项目后端如何导出war及前端如何导出静态资源

后端如何导出war包 后端工具&#xff1a;IDEA 2020.1.3 运行我们编写工具maven里面的package 运行成功的日志 我们运行完&#xff0c;会生成一个target文件夹&#xff0c;在这个文件夹里面找到war包即可 前端如何导出静态资源 使用工具&#xff1a;WebStorm 2020.1.3 打开左…

PyCharm 2024新版图文安装教程(python环境搭建+PyCharm安装+运行测试+汉化+背景图设置)

名人说&#xff1a;一点浩然气&#xff0c;千里快哉风。—— 苏轼《水调歌头》 创作者&#xff1a;Code_流苏(CSDN) 目录 一、Python环境搭建二、PyCharm下载及安装三、解释器配置及项目测试四、PyCharm汉化五、背景图设置 很高兴你打开了这篇博客&#xff0c;如有疑问&#x…

配置及使用OpenCV(Python)

python配置OpenCV相对于c的配置方法容易的多&#xff0c;但建议在Anaconda中的Python虚拟环境中使用&#xff0c;这样更方便进行包管理和环境管理&#xff1a; 先激活Anaconda的python虚拟环境&#xff1a; conda activate GGBoy 随后下载 opencv 包&#xff1a; conda ins…

为什么叫“机器学习”Machine Learning 而不是叫“计算机学习”?

有一门学科“机器学习”火了起来&#xff0c;它是计算机科学与数学结合的产物&#xff0c;它的目的是使计算机“聪明”起来&#xff0c;实现人工智能。可是&#xff0c;令人困惑的是它明明就是计算机学习&#xff0c;为什么不叫“计算机学习”而叫“机器学习”呢&#xff1f;这…