当前位置:网站首页>Installation and configuration of [basic services] [database] Clickhouse
Installation and configuration of [basic services] [database] Clickhouse
2022-07-26 20:42:00 【0xYGC】
brief introduction
Installation environment :CentOS 7.x or RedHat
Method / step
One :yum install
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
sudo yum install -y clickhouse-server clickhouse-client
sudo /etc/init.d/clickhouse-server start
clickhouse-client
# Or use "clickhouse-client --password" If you want to set a password
# Other commands

- Open Internet access
In the default service configuration file /etc/clickhouse-server/config.xml Release Internet binding
<listen_host>0.0.0.0</listen_host>
- Other relevant orders
# start-up
sudo -u clickhouse clickhouse-server --config-file=/etc/clickhouse-server/config.xml
# restart
sudo systemctl restart clickhouse-server
Two :Docker install
docker pull clickhouse/clickhouse-server
Start the server instance with custom configuration
docker run -d --name clickhouse-server8123 \
-p 8123:8123 -p 9000:9000 \
--ulimit nofile=262144:262144 \
-v /docker/clickhouse8123/clickhouse-server/conf/config.xml:/etc/clickhouse-server/config.xml \
-v /docker/clickhouse8123/clickhouse-server/conf/users.xml:/etc/clickhouse-server/users.xml \
-v /docker/clickhouse8123/clickhouse-server/log:/var/log/clickhouse-server:rw \
clickhouse/clickhouse-server
Other relevant orders
# Start the delete container command
$ docker stop some-clickhouse-server
$ docker rm some-clickhouse-server
3、 ... and : Connect and configure
3.1 DBeaver Use
Connect ClickHouse Databases generally use two ways DBeaver and Web side Tabix
3.1 Web side Tabix( The official recommendation )
docker search clickhouse
docker pull spoonest/clickhouse-tabix-web-client
start-up Tabix
docker run -d -p 8080:80 spoonest/clickhouse-tabix-web-client
- Open the visualization page

HTTP clients The default port number of 8123 Running SQL Request in http://127.0.0.1:8123( hold ip Change to your own IP)

Be careful , stay Play UI The user name is filled with default values in , The password text field remains empty . If the default user is assigned a password , Please enter it into password Field .
Try running the query . for example , The name of the predefined database is returned below :
SHOW databases
- single click RUN Button , The response is displayed in Play UI The bottom half :

Four : Normal operation
4.1 Create table statement , Be sure to specify the engine
create table tb_test(
id Int8 ,
name String
) engine=Memory;
4.2 Array An array type
create table test_array(
name String ,
hobby Array(String)
) engine=Log;
insert into test_array values(' Yu Qian ',[' smoking ',' Drink ',' Hot head ']);
insert into test_array values(' Monitor of the class ',[' smoking ',' Yu Qian ']);
-- see
SELECT * from test_array

4.3 Enum Enumeration type
create table test_enum(
id UInt8 ,
color Enum('RED'=1,'GREEN'=2 ,'BLUE'=3)
)engine=Memory ;
-- Undeclared values cannot be inserted
insert into test_enum values(1,'RED'),(3,'BLUE') ;
insert into test_enum values(4,'PINK');

4.4 Tuple Yuanzu type
create table test_tuple(
name String ,
info Tuple(String,String,UInt8)
)engine=Memory ;
insert into test_tuple values('zss',('M','coder',23)),('lss',tuple('F','coder',33));

4.5 Nested Nested Type
create table test_nested(
uid Int8 ,
name String ,
hobby Nested(
id Int8 ,
hname1 String ,
hname2 String
)
)engine=Memory ;
insert into test_nested values (1,'zss',[1,2,3],[' eat ',' drink ',' sleep '],['eat','drink','sleep']);
insert into test_nested values (2,'lss',[1,2],[' eat ',' drink '],['eat','drink']);

4.6 Special type
Special types include Domain 、IPv6、IPv4( Storage ip Address ) and Nulltable type
4.6.1 IPv4 type
create table tb_ip2(
id Int8 ,
ip IPv4
)engine=Memory ;
insert into tb_ip2 values(1,'192.167.34.2') ;

4.6.2 Nulltable type
create table tb_nulltable (
id Int8 ,
age Nulltable(Int8)
)engine=Memory ;
Installation completed
- Follow up learning materials
ClickHouse Operation guide
Reference material & thank
[1] Official website
[2] Github - ClickHouse
边栏推荐
- 全球最聪明50家公司公布:中国厂商占据近半,华为名列第一
- Build Prometheus automatic monitoring and alarm system from scratch
- Bean injection and lifecycle
- Face recognition and fingerprint recognition are weak? Pentagon develops long-distance heartbeat recognition
- Chat software project development 2
- Leetcode-300 最长递增子序列
- 从零开始搭建etcd分布式存储系统+Web管理界面
- 884. 两句话中的不常见单词-哈希表
- confd+etcd实现高可用自动发现
- QT driving school subject examination system -- from implementation to release
猜你喜欢
随机推荐
Centos7 about Oracle RAC 11gr2 deployment disk partition
App uploader download and installation
聊天软件项目开发2
「企业管理」精诚CRM+——一体化管理企业业务流程
Do employees have to compensate the company for losses when they resign? The 34 year old captain resigned and was claimed 10.66 million yuan by the company
Kotlin - 协程构建器 CoroutineBuilder
【面试必刷101】动态规划1
NVIDIA Canvas 初体验~
如何查看你使用的pytorch是否为GPU版本
YGG cooperates with my pet hooligan, AMGI's flagship NFT project, to enter the rabbit hole
Bean注入和生命周期
李彦宏遭“泼冷水”热情不减!百度结盟华为麒麟,发布“鸿鹄”芯片
The sandbox cooperates with artist Alec monopoly
Solve the horizontal segmentation of iBGP and BGP routing principles
After being fined "paid leave" for one month, Google fired him from AI on "love"
Typescript asynchronous function promise use
YGG 与 AMGI 的旗舰 NFT 项目 My Pet Hooligan 合作进入 The Rabbit Hole
Ape tutoring's technological hard power: let AI start from reading children's homework
opencv dnn部署onnx模型
Message queue -- the problem introduced: repeated consumption & sequential consumption & distributed transactions









