ClickHouse Installation on Ubuntu/Linux Box

ClickHouse Installation on Ubuntu/Linux Box

ClickHouse is an open-source column-oriented database management system for online analytical processing (OLAP).

ClickHouse allows generating analytical reports of data using SQL queries that are updated in real-time. The system is marketed for high performance. It is simple and works out of the box. In this article we will go through steps to install clickhouse in either Linux/Unix Machines.

Prerequisites

  • One Ubuntu server with a?sudo?enabled non-root user and firewall setup. The server should have at least 2GB of RAM.
  • (Optional) A secondary Ubuntu 20.04 server with a?sudo enabled non-root user and firewall setup.

Step 1 — Installing ClickHouse

In this section, you will install the ClickHouse server and client programs using?apt.

  • Yandex maintains an APT repository that has the latest version of ClickHouse. Add the repository’s GPG key so that you’ll be able to securely download validated ClickHouse packages:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4        

You will see output similar to the following which confirms that it has successfully verified and added the key.:

Output
Executing: /tmp/apt-key-gpghome.zJVSvL3NNE/gpg.1.sh --keyserver keyserver.ubuntu.com --recv E0C56BD4
gpg: key C8F1E19FE0C56BD4: public key "ClickHouse Repository Key <[email protected]>" imported
gpg: Total number processed: 1
gpg:?????????????? imported: 1        

  • Add the repository to your APT repositories list by executing:

echo "deb <https://repo.yandex.ru/clickhouse/deb/stable/> main/" | sudo tee /etc/apt/sources.list.d/clickhouse.list        

Here you’ve piped the output of?echo?to?sudo tee?so that this output can print to a root-owned file.

  • Now, update your packages:

sudo apt update        

  • The?clickhouse-server?and?clickhouse-client?packages will now be available for installation. Install them with:

sudo apt install clickhouse-server clickhouse-client        

During the installation, you will be asked to set a password for the default ClickHouse user.

You’ve installed the ClickHouse server and client successfully. You’re now ready to start the database service and ensure that it’s running correctly.

Step 2 — Starting the Service

The?clickhouse-server?package that you installed in the previous section creates a?systemd?service, which performs actions such as starting, stopping, and restarting the database server.?systemd is an init system for Linux to initialise and manage services. In this section you’ll start the service and verify that it is running successfully.

  • Start the?clickhouse-server?service by running:

sudo service clickhouse-server start        

  • The previous command will not display any output. To verify that the service is running successfully, execute:

sudo service clickhouse-server status        

You’ll see similar output mentioned below which confirms that the server is running.

Output
● clickhouse-server.service - ClickHouse Server (analytic DBMS for big data)
?????Loaded: loaded (/etc/systemd/system/clickhouse-server.service; enabled; vendor preset: enabled)
?????Active: active (running) since Tue 2022-06-14 09:44:08 IST; 4h 42min ago
???Main PID: 1605 (clckhouse-watch)
??????Tasks: 213 (limit: 18810)
?????Memory: 2.1G
????????CPU: 9min 32.908s
?????CGroup: /system.slice/clickhouse-server.service
?????????????├─1605 clickhouse-watchdog "" "" "" "" "" "" "" --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid
?????????????└─1617 /usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid        


要查看或添加评论,请登录

Sunny Kichloo的更多文章

  • Revolutionizing Database Cloning with Nutanix NDB: Faster, Smarter, and More Efficient

    Revolutionizing Database Cloning with Nutanix NDB: Faster, Smarter, and More Efficient

    Being working in database field for many years there are some use cases which in real world takes time and are quite…

  • NOSQL DATABASE OVERVIEW

    NOSQL DATABASE OVERVIEW

    In this post we will discuss different type of data model which are available for NOSQL databases. NoSQL databases…

  • RDBMS/NOSQL USECASES

    RDBMS/NOSQL USECASES

    Conventional Relational databases are the result of years of research, best practices and decade of stress testing done…

  • Database Selection Criteria

    Database Selection Criteria

    As business use-cases are changing very rapidly there are many data points which can be discussed before finalising any…

    3 条评论

社区洞察

其他会员也浏览了