How to Install ClickHouse on Ubuntu 22.04
It is column-oriented and stores records in blocks grouped by columns instead of rows. It allows you to generate analysis reports using SQL queries in real time. In addition, columnar databases take less time to read data during query completion than traditional row-based systems. It can be used in a system with a small amount of RAM, even with 2GB of RAM, but it requires additional tuning and can enter at low speeds.
This tutorial will show you how to install ClickHoof on Ubuntu 22.04.
Prerequisites
- A server running Ubuntu 22.04.
- The root password is configured on your server.
Install required dependencies
Before you begin, you should update and upgrade all system packages to an up-to-date version. You can update them by running the following command:
apt update -y apt upgrade -y
After upgrading all packages, run the following command to install other required packages:
apt-get install curl gnupg2 wget git apt-transport-https ca-certificates -y
Once all the necessary packages are installed, you can proceed to the next step.
ClickHouse Settings
By default, the ClickHouse package is not included in the default Ubuntu 22.04 repositories. So you will need to add the ClickHouse repository to your system.
First, download and add the GPG key with the following command:
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754 gpg --export --armor 8919F6BD2B48D754 | gpg --dearmour -o /etc/apt/trusted.gpg.d/clickhouse-key.gpg
Next, add the ClickHouse repository to APT with the following command:
echo "deb [arch=amd64] https://packages.clickhouse.com/deb stable main" | tee /etc/apt/sources.list.d/clickhouse.list
Next, update the repository and install the ClickHouse server and client packages with the following command:
apt-get update -y apt-get install clickhouse-server clickhouse-client -y
During the installation process, you will be asked to provide a password for the ClickHouse admin user as shown below:
Enter password for default user: Password for default user is saved in file /etc/clickhouse-server/users.d/default-password.xml. Setting capabilities for clickhouse binary. This is optional. chown -R clickhouse:clickhouse '/etc/clickhouse-server' ClickHouse has been successfully installed. Start clickhouse-server with: sudo clickhouse start Start clickhouse-client with: clickhouse-client --password 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 → /lib/systemd/system/clickhouse-server.service.
Once the installation is finished, you can proceed to the next step.
Start ClickHouse service
Now you can start the ClickHouse service and enable it to start on system reboot with the following command:
systemctl start clickhouse-server systemctl enable clickhouse-server
You can now verify the status of the ClickHouse with the following command:
systemctl status clickhouse-server
You will get the following output:
? clickhouse-server.service - ClickHouse Server (analytic DBMS for big data) Loaded: loaded (/lib/systemd/system/clickhouse-server.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2022-12-05 14:47:40 UTC; 6s ago Main PID: 13369 (clckhouse-watch) Tasks: 205 (limit: 4579) Memory: 65.5M CPU: 1.128s CGroup: /system.slice/clickhouse-server.service ??13369 clickhouse-watchdog "" "" "" "" "" "" "" --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/cl> ??13370 /usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-serve> Dec 05 14:47:40 ubuntu2204 systemd[1]: Started ClickHouse Server (analytic DBMS for big data). Dec 05 14:47:40 ubuntu2204 clickhouse-server[13369]: Processing configuration file '/etc/clickhouse-server/config.xml'. Dec 05 14:47:40 ubuntu2204 clickhouse-server[13369]: Logging trace to /var/log/clickhouse-server/clickhouse-server.log Dec 05 14:47:40 ubuntu2204 clickhouse-server[13369]: Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Processing configuration file '/etc/clickhouse-server/config.xml'. Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/config.xml> Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Processing configuration file '/etc/clickhouse-server/users.xml'. Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Merging configuration file '/etc/clickhouse-server/users.d/default-password.xml'. Dec 05 14:47:41 ubuntu2204 clickhouse-server[13370]: Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/users.xml'.
You should read it
- Instructions on how to install Ubuntu on VirtualBox virtual machine
- Instructions to install Ubuntu directly from the hard drive
- How to install Hyper Terminal in Ubuntu 20.04
- How to install Pip in Ubuntu
- How to Install CyberPanel on Ubuntu 20.04
- Instructions for installing Ubuntu on VMware Workstation - Part 2
- 5 things to do when installing Ubuntu on PC
- How to install µTorrent (uTorrent) in Ubuntu 20.04
May be interested
- 5 things to do when installing Ubuntu on PCubuntu is a powerful linux distribution suitable for a wide variety of use cases, ideal for both beginners and seasoned linux users.
- How to install µTorrent (uTorrent) in Ubuntu 20.04µtorrent provides clients for windows and macos x, however it is installed as a server in ubuntu linux and provides a web ui for managing downloads.
- How to Install Ubuntu Linux Without CD (Windows)want to install ubuntu on your windows computer, but don't have a dvd or cd drive? there are a couple of different ways that you can install ubuntu on computers that don't have disc drives. the most common way is to create a bootable usb...
- How to install MySQL on Ubuntu 20.04in this article, tipsmake will show how to install mysql version 8.0 on ubuntu 20.04 server. by completing it, you'll have an active relational database that can be used to build your next website or app.
- How to install AVG Antivirus on Ubuntuin addition to windows, you can install avg antivirus on ubuntu easily and quickly to ensure that damage is minimized in the most optimal way. along with tipsmake, see how to install avg antivirus on ubuntu below.
- How to install Ubuntu on a VMware virtual machinehow to install ubuntu on a vmware virtual machine. ubuntu is a very popular operating system nowadays parallel to windows and macos. but ubuntu still makes many users wonder before upgrading should use on their own computers, so we still have a way to experience ubuntu.
- Ways to install Ubuntu on Windows, run in parallel or run separatelythere are many ways to install ubuntu on your computer, such as installing ubuntu from usb, cd, installing ubuntu running in parallel with windows, installing it
- What's New in Ubuntu 21.10?version 21.10 is the latest release of ubuntu and although canonical is turning more attention to the cloud and developers, ubuntu 'impish indri' still comes with some notable changes for those users use the ubuntu desktop every day.
- 10 software should install on Ubuntuyou just moved from windows to ubuntu and wondered which ubuntu application is best and which software to install? below are the applications that should be installed on ubuntu after a fresh install.
- How to install Blender 3D on Ubuntu 20.04blender 3d is a professional open source 3d graphics and animation software. it has a rich feature set like animations, visual effects, 3d modeling and motion graphics.