C/C++教程

Ubuntu安装ClickHouse

本文主要是介绍Ubuntu安装ClickHouse,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

关注微信公共号:小程在线

关注CSDN博客:程志伟的博客

hadoop@dblab-VirtualBox:~$ sudo apt-get install dirmngr
[sudo] hadoop 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
dirmngr 已经是最新版 (2.1.11-6ubuntu2.1)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 853 个软件包未被升级。
hadoop@dblab-VirtualBox:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
Executing: /tmp/tmp.S1cGMXyGYH/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
--recv
E0C56BD4
gpg: 下载密钥‘E0C56BD4’,从 hkp 服务器 keyserver.ubuntu.com
gpg: 密钥 E0C56BD4:“ClickHouse Repository Key <milovidov@yandex-team.ru>”未改变
gpg: 合计被处理的数量:1
gpg:              未改变:1
hadoop@dblab-VirtualBox:~$ echo "deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" | sudo tee /etc/apt/sources.list.d/clickhouse.list
deb http://repo.yandex.ru/clickhouse/deb/stable/ main/
hadoop@dblab-VirtualBox:~$ sudo apt-get update
获取:1 http://archive.ubuntukylin.com:10006/ubuntukylin trusty InRelease [16.0 kB]
忽略:2 http://archive.ubuntukylin.com:10006/ubuntukylin trusty/main amd64 Packages                                                                                               
忽略:3 http://archive.ubuntukylin.com:10006/ubuntukylin trusty/main i386 Packages                                        
获取:4 http://archive.ubuntukylin.com:10006/ubuntukylin trusty/main Translation-en [748 B]                               
命中:5 http://cn.archive.ubuntu.com/ubuntu xenial InRelease                                                                                      
获取:2 http://archive.ubuntukylin.com:10006/ubuntukylin trusty/main amd64 Packages [1,585 B]                                                  
获取:3 http://archive.ubuntukylin.com:10006/ubuntukylin trusty/main i386 Packages [1,584 B]                                                   
获取:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]                                                                   
忽略:7 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 InRelease                                                        
获取:8 http://cn.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                               
获取:9 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 Release [3,462 B]                                                      
忽略:10 http://repo.yandex.ru/clickhouse/deb/stable main/ InRelease                                                                     
获取:11 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 Release.gpg [801 B]    
错误:11 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 Release.gpg                                          
  下列签名无效: KEYEXPIRED 1570654450
命中:12 http://repo.yandex.ru/clickhouse/deb/stable main/ Release                                                      
获取:14 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [93.6 kB]
获取:15 http://cn.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]            
获取:16 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [130 kB]
获取:17 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 DEP-11 Metadata [2,468 B]
获取:18 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [327 kB]           
获取:19 http://cn.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [281 kB]
获取:20 http://cn.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [5,964 B]
获取:21 http://cn.archive.ubuntu.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3,328 B]
获取:22 http://cn.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [6,608 B]
已下载 1,199 kB,耗时 4秒 (297 kB/s)                                         
正在读取软件包列表... 完成
W: 校验数字签名时出错。此仓库未被更新,所以仍然使用此前的索引文件。GPG 错误:http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 Release: 下列签名无效: KEYEXPIRED 1570654450
W: 无法下载 http://repo.mongodb.org/apt/ubuntu/dists/trusty/mongodb-org/3.2/Release.gpg  下列签名无效: KEYEXPIRED 1570654450
W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。
hadoop@dblab-VirtualBox:~$ sudo apt-get install -y clickhouse-server clickhouse-client
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
将会同时安装下列软件:
  clickhouse-common-static
建议安装:
  clickhouse-common-static-dbg
下列【新】软件包将被安装:
  clickhouse-client clickhouse-common-static clickhouse-server
升级了 0 个软件包,新安装了 3 个软件包,要卸载 0 个软件包,有 853 个软件包未被升级。
需要下载 164 MB 的归档。
解压缩后会消耗 536 MB 的额外空间。
获取:1 http://repo.yandex.ru/clickhouse/deb/stable main/ clickhouse-common-static 21.6.6.51 [164 MB]
获取:1 http://repo.yandex.ru/clickhouse/deb/stable main/ clickhouse-common-static 21.6.6.51 [164 MB]                                                                                      
获取:1 http://repo.yandex.ru/clickhouse/deb/stable main/ clickhouse-common-static 21.6.6.51 [164 MB]                                                                                      
获取:1 http://repo.yandex.ru/clickhouse/deb/stable main/ clickhouse-common-static 21.6.6.51 [164 MB]                                                                                      
获取:1 http://repo.yandex.ru/clickhouse/deb/stable main/ clickhouse-common-static 21.6.6.51 [164 MB]                                                                                      
获取:1 http://repo.yandex.ru/clickhouse/deb/stable main/ clickhouse-common-static 21.6.6.51 [164 MB]                                                                                      
获取:2 http://repo.yandex.ru/clickhouse/deb/stable main/ clickhouse-client 21.6.6.51 [54.9 kB]                                                                                            
获取:3 http://repo.yandex.ru/clickhouse/deb/stable main/ clickhouse-server 21.6.6.51 [76.3 kB]                                                                                            
已下载 9,533 kB,耗时 2小时 59分 1秒 (887 B/s)                                                                                                                                            
正在选中未选择的软件包 clickhouse-common-static。
(正在读取数据库 ... 系统当前共安装有 178112 个文件和目录。)
正准备解包 .../clickhouse-common-static_21.6.6.51_amd64.deb  ...
正在解包 clickhouse-common-static (21.6.6.51) ...
正在选中未选择的软件包 clickhouse-client。
正准备解包 .../clickhouse-client_21.6.6.51_all.deb  ...
正在解包 clickhouse-client (21.6.6.51) ...
正在选中未选择的软件包 clickhouse-server。
正准备解包 .../clickhouse-server_21.6.6.51_all.deb  ...
正在解包 clickhouse-server (21.6.6.51) ...
正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
正在处理用于 systemd (229-4ubuntu4) 的触发器 ...
正在设置 clickhouse-common-static (21.6.6.51) ...
正在设置 clickhouse-client (21.6.6.51) ...
正在设置 clickhouse-server (21.6.6.51) ...
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.
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.
 chown --recursive clickhouse:clickhouse '/etc/clickhouse-server'
Creating log directory /var/log/clickhouse-server/.
Creating data directory /var/lib/clickhouse/.
Creating pid directory /var/run/clickhouse-server.
 chown --recursive clickhouse:clickhouse '/var/log/clickhouse-server/'
 chown --recursive clickhouse:clickhouse '/var/run/clickhouse-server'
 chown clickhouse:clickhouse '/var/lib/clickhouse/'
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.

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 init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable clickhouse-server
正在处理用于 ureadahead (0.100.0-19) 的触发器 ...
正在处理用于 systemd (229-4ubuntu4) 的触发器 ...
hadoop@dblab-VirtualBox:~$ sudo service clickhouse-server start
[sudo] hadoop 的密码: 
hadoop@dblab-VirtualBox:~$ clickhouse-client
ClickHouse client version 21.6.6.51 (official build).
Connecting to localhost:9000 as user default.
Code: 516. DB::Exception: Received from localhost:9000. DB::Exception: default: Authentication failed: password is incorrect or there is no user with such name. 

hadoop@dblab-VirtualBox:~$ clickhouse-client --password
ClickHouse client version 21.6.6.51 (official build).
Password for user (default): 
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 21.6.6 revision 54448.

dblab-VirtualBox :) show databases;

SHOW DATABASES

Query id: dda78a50-2186-4bd9-b4f0-8f9793c6590f

┌─name────┐
│ default │
│ system  │
└─────────┘

2 rows in set. Elapsed: 0.002 sec.

 

这篇关于Ubuntu安装ClickHouse的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!