当前位置:网站首页>Clickhouse installation (quick start)

Clickhouse installation (quick start)

2022-06-30 09:27:00 Orangejuicer

open ClickHouse Official website Quick Start:https://clickhouse.com/#quick-start
Choose your own OS edition :
 Insert picture description here

// Use the following command to determine whether the machine supports ClickHouse install 
grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
// install ClickHouse
sudo yum install yum-utils
sudo rpm --import https://repo.clickhouse.com/CLICKHOUSE-KEY.GPG
sudo yum-config-manager --add-repo https://repo.clickhouse.com/rpm/clickhouse.repo
sudo yum install clickhouse-server clickhouse-client
// start-up ClickHouse
sudo /etc/init.d/clickhouse-server start  // Start server 
clickhouse-client # or "clickhouse-client --password" if you set up a password. // Start client  

clickhouse-client // Start the client by default in localhost:9000
clickhouse-client --host=localhost --port=9000 -m // You can also specify it yourself , You can also specify... In the configuration file
// Specific in /etc/clickhouse-server/ Inside config.xml file modify listen_host and port
//-m It means to write in the data sheet sql You can put a sql The statement is entered in a line , Otherwise, I can only say one thing sql Statement full input

More detailed installation contents :https://clickhouse.com/docs/en/getting-started/install/

//ClickHouse The command line simply builds the database 、 Build table 、 Query statement 
show databases;
select currentDatabase();
create databases people;
use people;
show tables;
create table user(id Int8,name String) engine=TinyLog;
insert into table user values (1,'zs'),(2.'ls'),(3,'zw');
select * from user;
select count(1) from user;

ClickHouse Directory information :

/etc/clickhouse-server/
config.d config.xml users.d users.xml  //config.xml Including clickhouse Global configuration ,users.xml Contains user related configurations 
/var/lib/clickhouse/ 
// There are many documents in it , Main concern  data  and  metadata
//data It contains clickhouse The database of  
//metadata Store the metadata information of the corresponding database table , Created people database , There will be people people.sql
/var/log/clickhouse-server/
clickhouse-server.err.log  clickhouse-server.log //clickhouse-server Log file 
原网站

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