clickhouse centos7安装

参考:

安装 | ClickHouse Docs

[root@node2 local]# cd clickhouse/
[root@node2 clickhouse]# ll
总用量 0
[root@node2 clickhouse]# ll
总用量 0
[root@node2 clickhouse]# sudo yum install -y yum-utils
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

base                                                                                                         | 3.6 kB  00:00:00     
docker-ce                                                                                                    | 3.5 kB  00:00:00     
docker-ce-stable                                                                                             | 3.5 kB  00:00:00     
extras                                                                                                       | 2.9 kB  00:00:00     
updates                                                                                                      | 2.9 kB  00:00:00     
(1/3): docker-ce-stable/x86_64/primary_db                                                                    |  81 kB  00:00:00     
(2/3): docker-ce/x86_64/primary_db                                                                           |  81 kB  00:00:01     
(3/3): updates/7/x86_64/primary_db                                                                           |  17 MB  00:00:29     
软件包 yum-utils-1.1.31-54.el7_8.noarch 已安装并且是最新版本
无须任何处理
[root@node2 clickhouse]# 
[root@node2 clickhouse]# sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
已加载插件:langpacks, product-id, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

adding repo from: https://packages.clickhouse.com/rpm/clickhouse.repo
grabbing file https://packages.clickhouse.com/rpm/clickhouse.repo to /etc/yum.repos.d/clickhouse.repo
repo saved to /etc/yum.repos.d/clickhouse.repo
[root@node2 clickhouse]# sudo yum install -y clickhouse-server clickhouse-client
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

clickhouse-stable/signature                                                                                  |  821 B  00:00:00     
从 https://packages.clickhouse.com/rpm/stable/repodata/repomd.xml.key 检索密钥
导入 GPG key 0x2B48D754:
 用户ID     : "ClickHouse Inc. Repositories Key <packages@clickhouse.com>"
 指纹       : 3a9e a119 3a97 b548 be14 57d4 8919 f6bd 2b48 d754
 来自       : https://packages.clickhouse.com/rpm/stable/repodata/repomd.xml.key
clickhouse-stable/signature                                                                                  | 1.4 kB  00:00:00 !!! 
clickhouse-stable/primary                                                                                    |  33 kB  00:00:00     
clickhouse-stable                                                                                                           274/274
正在解决依赖关系
--> 正在检查事务
---> 软件包 clickhouse-client.x86_64.0.22.8.2.11-1 将被 安装
--> 正在处理依赖关系 clickhouse-common-static = 22.8.2.11,它被软件包 clickhouse-client-22.8.2.11-1.x86_64 需要
---> 软件包 clickhouse-server.x86_64.0.22.8.2.11-1 将被 安装
--> 正在检查事务
---> 软件包 clickhouse-common-static.x86_64.0.22.8.2.11-1 将被 安装
--> 解决依赖关系完成

依赖关系解决

====================================================================================================================================
 Package                                 架构                  版本                          源                                大小
====================================================================================================================================
正在安装:
 clickhouse-client                       x86_64                22.8.2.11-1                   clickhouse-stable                 75 k
 clickhouse-server                       x86_64                22.8.2.11-1                   clickhouse-stable                100 k
为依赖而安装:
 clickhouse-common-static                x86_64                22.8.2.11-1                   clickhouse-stable                253 M

事务概要
====================================================================================================================================
安装  2 软件包 (+1 依赖软件包)

总下载量:253 M
安装大小:737 M
Downloading packages:
(1/3): clickhouse-client-22.8.2.11.x86_64.rpm                                                                |  75 kB  00:00:09     
(2/3): clickhouse-server-22.8.2.11.x86_64.rpm                                                                | 100 kB  00:00:00     
(3/3): clickhouse-common-static-22.8.2.11.x86_64.rpm                                                         | 253 MB  00:00:25     
------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                 10 MB/s | 253 MB  00:00:25     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : clickhouse-server-22.8.2.11-1.x86_64                                                                            2/3Cannot 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.
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.
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.
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.
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.
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'
Password for default user is empty string. See /etc/clickhouse-server/users.xml and /etc/clickhouse-server/users.d to change it.
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

Created symlink from /etc/systemd/system/multi-user.target.wants/clickhouse-server.service to /usr/lib/systemd/system/clickhouse-server.service.
  验证中      : clickhouse-common-static-22.8.2.11-1.x86_64                                                                     1/3 
  验证中      : clickhouse-server-22.8.2.11-1.x86_64                                                                            2/3 
  验证中      : clickhouse-client-22.8.2.11-1.x86_64                                                                            3/3 

已安装:
  clickhouse-client.x86_64 0:22.8.2.11-1                           clickhouse-server.x86_64 0:22.8.2.11-1                          

作为依赖被安装:
  clickhouse-common-static.x86_64 0:22.8.2.11-1                                                                                     

完毕!
[root@node2 clickhouse]# ll
总用量 0
[root@node2 clickhouse]# cd /etc/init.d/
[root@node2 init.d]# ll
总用量 52
-rwxrwxr-x. 1 root root  5238 8月  23 05:50 clickhouse-server
-rw-r--r--. 1 root root 18281 8月  19 2019 functions
-rwxr-xr-x. 1 root root  4569 8月  19 2019 netconsole
-rwxr-xr-x. 1 root root  7928 8月  19 2019 network
-rw-r--r--. 1 root root  1160 8月   7 2020 README
-rwxr-xr-x. 1 root root  1715 12月 23 2019 redis_6379
[root@node2 init.d]# cd /opt/clickhouse/data
-bash: cd: /opt/clickhouse/data: 没有那个文件或目录
[root@node2 init.d]# ll
总用量 52
-rwxrwxr-x. 1 root root  5238 8月  23 05:50 clickhouse-server
-rw-r--r--. 1 root root 18281 8月  19 2019 functions
-rwxr-xr-x. 1 root root  4569 8月  19 2019 netconsole
-rwxr-xr-x. 1 root root  7928 8月  19 2019 network
-rw-r--r--. 1 root root  1160 8月   7 2020 README
-rwxr-xr-x. 1 root root  1715 12月 23 2019 redis_6379
[root@node2 init.d]# ./clickhouse-server start
 chown -R clickhouse: '/var/run/clickhouse-server/'
Will run clickhouse su '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
sed:无法读取 /etc/cron.d/clickhouse-server:没有那个文件或目录
[root@node2 init.d]# ll
总用量 52
-rwxrwxr-x. 1 root root  5238 8月  23 05:50 clickhouse-server
-rw-r--r--. 1 root root 18281 8月  19 2019 functions
-rwxr-xr-x. 1 root root  4569 8月  19 2019 netconsole
-rwxr-xr-x. 1 root root  7928 8月  19 2019 network
-rw-r--r--. 1 root root  1160 8月   7 2020 README
-rwxr-xr-x. 1 root root  1715 12月 23 2019 redis_6379
[root@node2 init.d]# sudo /etc/init.d/clickhouse-server start
/var/run/clickhouse-server/clickhouse-server.pid file exists and contains pid = 7087.
The process with pid = 7087 is already running.
[root@node2 init.d]# ps -ef | grep clickhouse-server 
clickho+   7086      1  0 11:51 ?        00:00:00 clickhouse-watchdog        --config-file /etc/clickhouse-server/config.xml --pid-file /var/run/clickhouse-server/clickhouse-server.pid --daemon
clickho+   7087   7086  4 11:51 ?        00:00:01 /usr/bin/clickhouse-server --config-file /etc/clickhouse-server/config.xml --pid-file /var/run/clickhouse-server/clickhouse-server.pid --daemon
root       7555   3863  0 11:52 pts/0    00:00:00 grep --color=auto clickhouse-server
[root@node2 init.d]# 
[root@node2 init.d]# 
[root@node2 init.d]# 
[root@node2 init.d]# cd /var/log/clickhouse-server/
[root@node2 clickhouse-server]# ll
总用量 44
-rw-r-----. 1 clickhouse root   723 8月  28 11:51 clickhouse-server.err.log
-rw-r-----. 1 clickhouse root 35892 8月  28 11:52 clickhouse-server.log
-rw-------. 1 clickhouse root   451 8月  28 11:51 stderr.log
-rw-r-----. 1 clickhouse root     0 8月  28 11:51 stdout.log
[root@node2 clickhouse-server]# clickhouse-client
ClickHouse client version 22.8.2.11 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 22.8.2 revision 54460.

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
 * Maximum number of threads is lower than 30000. There could be problems with handling a lot of simultaneous queries.

node2.cluster.local :) 
node2.cluster.local :) 
node2.cluster.local :) 
node2.cluster.local :) 
node2.cluster.local :) 
node2.cluster.local :) show databases

SHOW DATABASES

Query id: 5afc4b12-0852-46ff-aeff-c862464f5952

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

4 rows in set. Elapsed: 0.001 sec. 

node2.cluster.local :) 

打开, 

 类似mysql,这样别的远程才能访问

 测试访问: 

本机

 


web

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 1. 首先,您需要下载ClickHouse的RPM包。您可以从官方网站下载最新版本的RPM包。 2. 安装依赖项。ClickHouse需要一些依赖项才能正常运行。您可以使用以下命令安装这些依赖项: sudo yum install -y yum-utils sudo yum-config-manager --add-repo https://repo.clickhouse.tech/rpm/stable/x86_64 sudo yum install -y clickhouse-server clickhouse-client 3. 启动ClickHouse服务器。您可以使用以下命令启动ClickHouse服务器: sudo systemctl start clickhouse-server 4. 验证ClickHouse服务器是否正在运行。您可以使用以下命令检查ClickHouse服务器的状态: sudo systemctl status clickhouse-server 5. 连接到ClickHouse服务器。您可以使用以下命令连接到ClickHouse服务器: clickhouse-client 6. 验证ClickHouse是否正常工作。您可以使用以下命令验证ClickHouse是否正常工作: SELECT 1 如果返回结果为“1”,则表示ClickHouse正在正常工作。 以上就是CentOS 7安装ClickHouse的步骤。希望对您有所帮助! ### 回答2: clickhouse是一款基于列的分布式数据库,可提供快速和大规模的数据处理,而CentOS 7是一款广泛使用的操作系统,本文将介绍如何在CentOS 7上安装clickhouse,主要包括以下几个步骤: 一、添加clickhouse的源 CentOS系统默认的源没有clickhouse,需要手动添加clickhouse的源。添加源的方法有多种,常见的有修改yum源列表和手动下载rpm包两种方式。 1、修改yum源列表: sudo vi /etc/yum.repos.d/clickhouse.repo 2、编辑clickhouse.repo文件: 在文件中添加以下内容: [clickhouse] name=ClickHouse baseurl=https://repo.clickhouse.tech/rpm/stable/x86_64/ enabled=1 gpgcheck=1 gpgkey=https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPG 3、保存文件并退出:wq 二、安装clickhouse 1、在CentOS 7上输入以下命令安装clickhouse: sudo yum install clickhouse-server clickhouse-client 2、启动clickhouse-server: sudo systemctl start clickhouse-server 三、配置clickhouse 1、进入clickhouse-server的配置文件目录: cd /etc/clickhouse-server/ 2、编辑clickhouse-server配置文件: sudo vi config.xml 3、配置clickhouse-server的监听端口和ip: 在文件中找到以下内容: 在这里可以配置clickhouse-server的监听端口和ip地址 4、保存文件并退出:wq 四、使用clickhouse 1、打开clickhouse-client: 输入以下命令打开clickhouse-client: clickhouse-client 2、创建数据库: CREATE DATABASE 数据库名称 ; 3、创建表格: CREATE TABLE 表格名称 (字段名称 类型,字段名称 类型); 例如:CREATE TABLE test (id Int64,name String); 4、插入数据: INSERT INTO 表格名称 (字段名称, 字段名称) VALUES (数值, "文本"); 例如:INSERT INTO test (id,name) VALUES (1,"test")。 以上就是CentOS 7系统上安装clickhouse的相关步骤,通过这些步骤,我们可以在CentOS 7上安装clickhouse,然后使用clickhouse的各种功能,实现我们对数据的快速处理和分析。 ### 回答3: ClickHouse是俄罗斯的一个高性能、列式存储、分布式开源数据库管理系统,具有千万级别查询性能和PB级数据处理容量,成为了近年来高性能实时数据计算和分析领域的主流工具。 CentOS 7是很多服务器运行的首选操作系统之一,在这里我们介绍在CentOS 7上安装ClickHouse的步骤。 第一步:安装依赖 在安装ClickHouse的过程中,需要安装一些依赖,在这里我们使用yum进行安装。 ```bash sudo yum install -y yum-utils \ rpm-utils \ which \ createrepo \ epel-release \ python36-devel \ python2-tools \ git \ gcc-c++ ``` 第二步:添加Yandex Package Repository 为了获取ClickHouse的最新版本,需要添加Yandex Package Repository到CentOS 7。 ```bash sudo yum install https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-copr-1.1-1.noarch.rpm ``` 第三步:安装ClickHouse Server和客户端 通过上面的步骤,已经将ClickHouse的包加入了CentOS 7的仓库中,在这里执行安装命令。 ```bash sudo yum install clickhouse-server clickhouse-client ``` 第四步:启动ClickHouse服务并测试 安装完成后,启动ClickHouse服务。 ```bash sudo systemctl start clickhouse-server ``` 可以通过执行以下命令来检查服务的状态。 ```bash sudo systemctl status clickhouse-server ``` 如果服务状态为"active (running)",则说明服务已经启动成功。 接下来,我们可以使用clickhouse-client命令测试ClickHouse是否能正常工作。执行以下命令以启动客户端。 ```bash clickhouse-client ``` 在客户端中执行以下命令以插入一条数据并查询,看是否可以正确返回。 ```sql INSERT INTO test (a) VALUES (1); SELECT * FROM test; ``` 如果能够返回正确结果,则说明ClickHouse已成功安装在CentOS 7上。 总结:以上是在CentOS 7上安装ClickHouse的步骤,需要注意的是,在安装之前需要安装一些依赖包才能顺利进行安装,确保服务启动成功后,可以通过clickhouse-client进行测试,确保ClickHouse可以正常工作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值