Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy ClickHouse

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you about how to deploy ClickHouse. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Basic configuration environment depends on version ClickHouse20.11.3.3-2CentOS7.xGcc4.8.5 download and install ClickHouse

Offline installation (we use download to install locally)

Wget https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-client-20.11.3.3-2.noarch.rpmwget https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-common-static-20.11.3.3-2.x86_64.rpmwget https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-common-static-dbg-20.11.3.3-2.x86_64 .rpmwget https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-server-20.11.3.3-2.noarch.rpmyum install-y clickhouse-*

Yum source online installation

Sudo yum install yum-utilssudo rpm-import https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPGsudo yum-config-manager-add-repo https://repo.clickhouse.tech/rpm/stable/x86_64sudo yum install clickhouse-server clickhouse-client

If you want to use the latest version, replace stable with testing (recommended in a test environment)

Configure ClickHouse

There are many configuration items in ClickHouse. By default, two directories, clickhouse-server and clickhouse-client, are generated under / etc. Because we install the service, we modify the configuration file under clickhouse-server.

Modify / etc/clickhouse-server/config.xml

Trace / data2/clickhouse/clickhouse-server.log / data2/clickhouse/clickhouse-server.err.log 1000M 10 9123 9000 / etc/clickhouse-server/server.crt / etc/clickhouse-server/server.key / etc/clickhouse-server / dhparam.pem none true true sslv2 Sslv3 true sslv2 Sslv3 true RejectCertificateHandler 9009 0.0.0.0 4096 3 100 8589934592 5368709120 / data2/clickhouse/data/ / data2/clickhouse/tmp/ / Data2/clickhouse/user_files/ users.xml default default false 3600 3600 60 system query_log toYYYYMM (event_date) 7500 system trace_log toYYYYMM (event_date) 7500 System query_thread_log toYYYYMM (event_date) 7500 * _ dictionary.xml / a8root/clickhouse/task_queue/ddl click_cost any 0 3600 86400 60 max 0 60 3600 300 86400 3600 / data2/clickhouse/format_schemas/

We generally modify the following configuration items:

The storage path of the logger modification log

Http_port modifies the port accessed by the browser. The default is 8123.

Tcp_port modifies the transport port of tcp protocol

OpenSSL some ssl authentication configuration files. We will not do ssl authentication for the time being. We will not deal with it here.

Listen_host if we want to use the service, we need to modify it to 0.0.0.0 here.

Remote_servers here is the configuration information related to the cluster, which will be explained later.

Other custom configurations can be modified by ourselves. After modifying the configuration, we can start a local ClickHouse service.

Create related directories and permissions

Mkdir-p / data2/clickhousechown-R clickhouse:clickhouse / data2/clickhouse Operation ClickHouse

Start the service

Sudo-u clickhouse clickhouse-server-- daemon-- pid-file=/var/run/clickhouse-server/clickhouse-server.pid-- config-file=/etc/clickhouse-server/config.xml

-- daemon sign We need to start the service in the background.

-- pid-file specifies the file path after the service is started

-- config-file specifies the configuration file to start the service

If we use debugging, we can use the following command

Sudo-u clickhouse clickhouse-server start

To start with a separate user, the system will prompt if you start with root

Debug ClickHouse service

After ClickHouse installation is completed, two directories, clickhouse-server and clickhouse-client, will be generated. At this time, we will use clickhouse-client to test the service.

Clickhouse-client-h clickhouse--port 9000-multiquery-query= "show databases"

Note:-- port specifies the port of tcp

Running a query database list returns information similar to the following

_ temporary_and_external_tablesdefaultsystem above is how the ClickHouse is deployed. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report