clickhouse下載和安裝

水逸冰發表於2020-12-27

clickhouse下載和安裝

1.安裝包下載

wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/7/clickhouse-server-common-20.8.3.18-1.el7.x86_64.rpm/download.rpm

wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/7/clickhouse-server-20.8.3.18-1.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/7/clickhouse-client-20.8.3.18-1.el7.x86_64.rpm/download.rpm
wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/7/clickhouse-common-static-20.8.3.18-1.el7.x86_64.rpm/download.rpm

下載好的安裝包

[root@mdb01 clickhouse]# ll

total 103412
-rw-r--r-- 1 clickhouse clickhouse     6384 Oct  6 06:32 clickhouse-client-20.8.3.18-1.el7.x86_64.rpm
-rw-r--r-- 1 clickhouse clickhouse 69093220 Oct  6 06:32 clickhouse-common-static-20.8.3.18-1.el7.x86_64.rpm
-rw-r--r-- 1 clickhouse clickhouse 36772044 Oct  6 06:36 clickhouse-server-20.8.3.18-1.el7.x86_64.rpm
-rw-r--r-- 1 clickhouse clickhouse    14472 Oct  6 06:36 clickhouse-server-common-20.8.3.18-1.el7.x86_64.rpm

也可以直接配置yum源的方式

curl -s https://packagecloud.io/install/repositories/Altinity/clickhouse/script.rpm.sh | sudo bash

2.安裝clickhouse

[root@mdb01 clickhouse]# rpm -ivh clickhouse*

Preparing...                          ################################# [100%]
Updating / installing...
  1:clickhouse-server-common-20.8.3.1################################# [ 25%]
  2:clickhouse-common-static-20.8.3.1################################# [ 50%]
  3:clickhouse-server-20.8.3.18-1.el7################################# [ 75%]
Create user clickhouse.clickhouse with datadir /var/lib/clickhouse
  4:clickhouse-client-20.8.3.18-1.el7################################# [100%]
Create user clickhouse.clickhouse with datadir /var/lib/clickhouse

修改資料目錄:

# cd /etc/clickhouse-server/

# ll
total 44
-rw-r--r-- 1 root root 33738 Oct  6 06:05 config.xml
-rw-r--r-- 1 root root  5587 Oct  6 06:05 users.xml
# more config.xml |grep -B1 '/u01/clickhouse'
   <!-- Path to data directory, with trailing slash. -->
   <path>/u01/clickhouse/data/</path>
--
   <!-- Path to temporary data for processing hard queries. -->
   <tmp_path>/u01/clickhouse/tmp/</tmp_path>
--
   <!-- Directory with user provided files that are accessible by 'file' table function. -->
   <user_files_path>/u01/clickhouse/user_files/</user_files_path>
--
     -->
   <format_schema_path>/u01/clickhouse/format_schemas/</format_schema_path>

3.啟動clickhouse

nohup clickhouse-server --config-file=/etc/clickhouse-server/config.xml &

4.連線clickhouse

[clickhouse@mdb01 clickhouse]$ clickhouse-client 

ClickHouse client version 20.8.3.18.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 20.8.3 revision 54438.

mdb01 :) show databases;

SHOW DATABASES

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

3 rows in set. Elapsed: 0.002 sec.



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31480688/viewspace-2745701/,如需轉載,請註明出處,否則將追究法律責任。

相關文章