Centos7.9 安装 clickhouse 24.6.1

'''

总结:

root@localhost \~# curl https://clickhouse.com/ | sh

root@localhost \~# sudo ./clickhouse install

root@localhost \~# sudo clickhouse start

root@localhost \~# clickhouse-client --password

'''

执行过程:

bash 复制代码
[root@localhost ~]# curl https://clickhouse.com/ | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2822    0  2822    0     0   1584      0 --:--:--  0:00:01 --:--:--  1583

Will download https://builds.clickhouse.com/master/amd64/clickhouse into clickhouse

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  109M  100  109M    0     0  1095k      0  0:01:42  0:01:42 --:--:--  990k

Successfully downloaded the ClickHouse binary, you can run it as:
    ./clickhouse

You can also install it:
    sudo ./clickhouse install
[root@localhost ~]# ll
总用量 131488
-rw-------. 1 root root      1549 5月   7 16:23 anaconda-ks.cfg
-rwxr-xr-x. 1 root root 114503961 6月  12 13:27 clickhouse
-rw-r--r--. 1 root root      1580 5月   7 17:59 initial-setup-ks.cfg
-rw-r--r--. 1 root root    255976 5月  13 13:59 tigervnc-server-1.13.80-1.el7.x86_64.rpm
-rw-r--r--. 1 root root    221384 5月  13 14:11 tigervnc-server-1.8.0-21.el7.x86_64.rpm
drwxr-xr-x. 2 root root         6 6月   3 18:19 公共
drwxr-xr-x. 2 root root         6 6月   3 18:19 模板
drwxr-xr-x. 2 root root         6 6月   3 18:19 视频
drwxr-xr-x. 2 root root         6 6月   3 18:19 图片
drwxr-xr-x. 2 root root         6 6月   3 18:19 文档
drwxr-xr-x. 2 root root         6 6月   3 18:19 下载
drwxr-xr-x. 2 root root         6 6月   3 18:19 音乐
drwxr-xr-x. 2 root root         6 6月   3 18:19 桌面
[root@localhost ~]# sudo ./clickhouse install
Decompressing the binary....
Copying ClickHouse binary to /usr/bin/clickhouse.new
Renaming /usr/bin/clickhouse.new to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-server to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-client to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-local to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-benchmark 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.
Creating symlink /usr/bin/clickhouse-compressor to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-format to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-extract-from-config 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 symlink /usr/bin/ch to /usr/bin/clickhouse.
Creating symlink /usr/bin/chl to /usr/bin/clickhouse.
Creating symlink /usr/bin/chc 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.
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.
Data path configuration override is saved to file /etc/clickhouse-server/config.d/data-paths.xml.
Log path configuration override is saved to file /etc/clickhouse-server/config.d/logger.xml.
User directory path configuration override is saved to file /etc/clickhouse-server/config.d/user-directories.xml.
OpenSSL path configuration override is saved to file /etc/clickhouse-server/config.d/openssl.xml.
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'
Enter password for the default user:
Password for the default user is saved in file /etc/clickhouse-server/users.d/default-password.xml.
Setting capabilities for clickhouse binary. This is optional.
Cannot set 'net_admin' or 'ipc_lock' or 'sys_nice' or 'net_bind_service' capability for clickhouse binary. This is optional. Taskstats accounting will be disabled. To enable taskstats accounting you may add the required capability later manually.
Allow server to accept connections from the network (default is localhost only), [y/N]: y
The choice is saved in file /etc/clickhouse-server/config.d/listen.xml.
 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

[root@localhost ~]# sudo clickhouse start
 chown -R clickhouse: '/var/run/clickhouse-server/'
Will run sudo --preserve-env -u 'clickhouse' /usr/bin/clickhouse-server --config-file /etc/clickhouse-server/config.xml --pid-file /var/run/clickhouse-server/clickhouse-server.pid --daemon
Waiting for server to start
Waiting for server to start
Server started
[root@localhost ~]# clickhouse-client --password
ClickHouse client version 24.6.1.3573 (official build).
Password for user (default):
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 24.6.1.

Warnings:
 * Linux transparent hugepages are set to "always". Check /sys/kernel/mm/transparent_hugepage/enabled
 * Linux threads max count is too low. Check /proc/sys/kernel/threads-max
 * Available memory at server startup is too low (2GiB).
 * Maximum number of threads is lower than 30000. There could be problems with handling a lot of simultaneous queries.

localhost :) show databases;

SHOW DATABASES

Query id: b0e8a288-79c4-4e72-a485-9981f686c153

   ┌─name───────────────┐
1. │ INFORMATION_SCHEMA │
2. │ default            │
3. │ information_schema │
4. │ system             │
   └────────────────────┘

4 rows in set. Elapsed: 0.003 sec.

localhost :) use defautl;

USE defautl

Query id: 02eb24cc-2362-49be-bbde-79cd037e1b8f


Elapsed: 0.481 sec.

Received exception from server (version 24.6.1):
Code: 81. DB::Exception: Received from localhost:9000. DB::Exception: Database defautl does not exist. Maybe you meant default?. (UNKNOWN_DATABASE)

localhost :) show tables;

SHOW TABLES

Query id: 35c52c21-56fd-43a6-b3be-1add9ca23d2a

Ok.

0 rows in set. Elapsed: 0.005 sec.

localhost :) exit;
Bye.
[root@localhost ~]#

'''

参考:

https://clickhouse.com/docs/en/install

'''

相关推荐
SelectDB技术团队3 小时前
从 ClickHouse 迁移到 Doris:SQL 兼容、同步与验证清单
数据库·人工智能·sql·clickhouse·apache doris·selectdb·湖仓架构升级
java_logo2 天前
Docker 部署 ClickHouse Server:轻松搭建列式 OLAP 分析数据库平台
数据库·clickhouse·docker·私有化部署·olap·列式数据库·轩辕镜像
西风未眠6 天前
ClickHouse数据库引擎引起的数据丢失
数据库·clickhouse·故障
李兆龙的博客8 天前
从一到无穷大 #86:ClickHouse 收购 RunReveal——可观测性竞争进入宏观调控阶段
clickhouse
Gain_chance12 天前
大数据毕业设计实战|Data Insight Platform:用 FastAPI + ClickHouse 打造低门槛全链路数据洞察平台
大数据·数据库·clickhouse·毕业设计·fastapi
迷迭香yy15 天前
A股数据本地存储方案对比JSON、SQLite、ClickHouse、DuckDB怎么选 IG50免费开源股票数据API接口
clickhouse·sqlite·json
leisoo809716 天前
本地股票数据深度对比ClickHouse与Parquet存储方案 IG50免费开源股票数据API接口
clickhouse·开源
A.说学逗唱的Coke18 天前
【数据库专题】ClickHouse 深度实战:从列式存储原理到 PB 级海量日志与可观测性分析
数据库·clickhouse·硬件架构
吉甫作诵24 天前
阿里云 ECS 安装 ClickHouse:密码配置、目录迁移与基础调优
大数据·clickhouse
NineData24 天前
NineData Oracle 到 ClickHouse 数据迁移完整流程:结构复制、全量装载、增量同步
数据库·clickhouse·oracle·数据迁移·ninedata·增量同步·数据迁移工具