当前位置:网站首页>Clickhouse stand alone installation

Clickhouse stand alone installation

2022-06-26 04:12:00 Dudu listing

It is recommended to configure the number of software and hardware files before installation 、 Process quantity parameter

 

First of all to see   ulimit -a

vim /etc/security/limits.conf

Restart the computer after modification :

  Modified to complete .

1: Official website address : Using command line installation

https://clickhouse.tech/docs/en/getting-started/install/

  The installation process is as follows :

$ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"

sudo apt-get install apt-transport-https ca-certificates dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4

echo "deb https://repo.clickhouse.tech/deb/stable/ main/" | sudo tee \
    /etc/apt/sources.list.d/clickhouse.list
sudo apt-get update

sudo apt-get install -y clickhouse-server clickhouse-client

sudo service clickhouse-server start
clickhouse-client
[email protected]:~$ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
SSE 4.2 supported
[email protected]:~$ sudo apt-get install apt-transport-https ca-certificates dirmngr
[sudo] cl01  Password : 
 Reading package list ...  complete 
 Analyzing package dependency tree ...  complete 
 Reading status information ...  complete                  
ca-certificates  It's the latest edition  (20210119build1).
dirmngr  It's the latest edition  (2.2.20-1ubuntu3).
dirmngr  Set to manual installation .
 The following 【 new 】 The package will be installed :
  apt-transport-https
 The upgrade  0  Software package , New installation  1  Software package , To uninstall  0  Software package , Yes  19  Packages not upgraded .
 Need to download  4,776 B  The filing of .
 After decompression, it will consume  166 kB  Extra space .
 Would you like to continue ? [Y/n] y
 obtain :1 http://cn.archive.ubuntu.com/ubuntu hirsute-updates/universe amd64 apt-transport-https all 2.2.4ubuntu0.1 [4,776 B]
 Downloaded  4,776 B, Time consuming  1 second  (5,165 B/s)     
 Selecting unselected packages  apt-transport-https.
( Reading database  ...  The system currently has  205316  Two files and directories .)
 Ready to unzip  .../apt-transport-https_2.2.4ubuntu0.1_all.deb  ...
 Decompressing  apt-transport-https (2.2.4ubuntu0.1) ...
 Setting up  apt-transport-https (2.2.4ubuntu0.1) ...
[email protected]:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.Udc32nvazS/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
gpg:  secret key  C8F1E19FE0C56BD4: Public key  “ClickHouse Repository Key <[email protected]>”  Imported 
gpg:  Total number of processed :1
gpg:                Imported :1
[email protected]:~$ echo "deb https://repo.clickhouse.tech/deb/stable/ main/" | sudo tee \
>     /etc/apt/sources.list.d/clickhouse.list
deb https://repo.clickhouse.tech/deb/stable/ main/
[email protected]:~$ sudo apt-get update
 hit :1 http://cn.archive.ubuntu.com/ubuntu hirsute InRelease
 obtain :2 http://security.ubuntu.com/ubuntu hirsute-security InRelease [101 kB]
 obtain :3 http://cn.archive.ubuntu.com/ubuntu hirsute-updates InRelease [109 kB]               
 obtain :4 http://cn.archive.ubuntu.com/ubuntu hirsute-backports InRelease [101 kB]                      
 obtain :5 http://cn.archive.ubuntu.com/ubuntu hirsute-updates/main amd64 Packages [287 kB]
 obtain :6 http://cn.archive.ubuntu.com/ubuntu hirsute-backports/universe amd64 DEP-11 Metadata [9,204 B]
 Ignore :7 https://repo.clickhouse.tech/deb/stable main/ InRelease             
 obtain :8 https://repo.clickhouse.tech/deb/stable main/ Release [749 B]
 obtain :9 https://repo.clickhouse.tech/deb/stable main/ Release.gpg [836 B]
 obtain :10 https://repo.clickhouse.tech/deb/stable main/ Packages [194 kB]
 Downloaded  802 kB, Time consuming  5 second  (152 kB/s) 
 Reading package list ...  complete 
[email protected]:~$ sudo apt-get install -y clickhouse-server clickhouse-client
 Reading package list ...  complete 
 Analyzing package dependency tree ...  complete 
 Reading status information ...  complete                  
 The following software will be installed at the same time :
  clickhouse-common-static
 Proposed installation :
  clickhouse-common-static-dbg
 The following 【 new 】 The package will be installed :
  clickhouse-client clickhouse-common-static clickhouse-server
 The upgrade  0  Software package , New installation  3  Software package , To uninstall  0  Software package , Yes  19  Packages not upgraded .
 Need to download  174 MB  The filing of .
 After decompression, it will consume  566 MB  Extra space .
 obtain :1 https://repo.clickhouse.tech/deb/stable main/ clickhouse-common-static 21.7.4.18 [174 MB]
 obtain :2 https://repo.clickhouse.tech/deb/stable main/ clickhouse-client 21.7.4.18 [70.0 kB]           
 obtain :3 https://repo.clickhouse.tech/deb/stable main/ clickhouse-server 21.7.4.18 [90.6 kB]           
 Downloaded  174 MB, Time consuming  27 second  (6,512 kB/s)                                                                
 Selecting unselected packages  clickhouse-common-static.
( Reading database  ...  The system currently has  205320  Two files and directories .)
 Ready to unzip  .../clickhouse-common-static_21.7.4.18_amd64.deb  ...
 Decompressing  clickhouse-common-static (21.7.4.18) ...
 Selecting unselected packages  clickhouse-client.
 Ready to unzip  .../clickhouse-client_21.7.4.18_all.deb  ...
 Decompressing  clickhouse-client (21.7.4.18) ...
 Selecting unselected packages  clickhouse-server.
 Ready to unzip  .../clickhouse-server_21.7.4.18_all.deb  ...
 Decompressing  clickhouse-server (21.7.4.18) ...
 Setting up  clickhouse-common-static (21.7.4.18) ...
 Setting up  clickhouse-server (21.7.4.18) ...
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/'
 groupadd -r clickhouse-bridge
 useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse-bridge clickhouse-bridge
 chown --recursive clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-odbc-bridge'
 chown --recursive clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-library-bridge'
Enter password for default user: 
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.

ClickHouse has been successfully installed.

Start clickhouse-server with:
 sudo clickhouse start

Start clickhouse-client with:
 clickhouse-client

Synchronizing 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 → /etc/systemd/system/clickhouse-server.service.
 Setting up  clickhouse-client (21.7.4.18) ...

The configuration file /etc/clickhouse-serve/config.xml Let other computers have access to

clickhouse status see clickhouse state

clickhouse start start-up clickhouse

clickhouse restart restart clickhouse

clickhouse-client -m Client connection     Quit using quit;

 

 

原网站

版权声明
本文为[Dudu listing]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180538038872.html