No description, website, or topics provided.
Branch: master
Clone or download
Latest commit f5462e4 Feb 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Aug 18, 2017
README.md typo Feb 21, 2019

README.md

ClickHouse RPM packages installation from packagecloud.io


Table of Contents


Introduction

Supported OSes

All instructions in this manual were tested on Centos 6.10, CentOS 7.5 and Amazon Linux 2.

IMPORTANT for Amazon Linux users Amazon Linux is being detected as CentOS 6, while RPMs built for CentOS 7 are the best choice. So we need to explicitly install CentOS 7 RPMs More details further in the doc.

Introduction

In order to install ClickHouse RPM packages from packagecloud.io repository, we need to register it (repo) with our yum, making yum aware of additional packages installable from packagecloud.io.

In general, repositories are listed in /etc/yum.repos.d folder, so we need to add packagecloud.io repository description in there.

This can be done either manually or via script, provided by packagecloud.io. In any case, as a result, we'll have ClickHouse packages available for installation via yum.

IMPORTANT for Amazon Linux users Amazon Linux is being detected as CentOS 6 by the script, so we need to explicitly instruct it to use CentOS 7 repo.

  • In case of manual installation, just use EL7 repo file. It is compatible with Amazon Linux
  • In case of script-based installation, script provided by packagecloud should be explicitly instructed to use CentOS 7 repo, instead of CentOS 6 repo, which is being used by default for Amazon Linux. More details further in the doc.

Let's start with script-based installation, since this approach looks like more user-friendly.

Script-based installation

For our convenience, packagecloud.io provides nice and user-friendly way to add repos with their script. We'll need to download and run packagecloud's bash script, which will do all required steps.

Install dependencies

Ensure curl is installed on the system

sudo yum install -y curl

Let's download and run installation shell-script, provided by packagecloud.io

for CentOS 6 and 7

curl -s https://packagecloud.io/install/repositories/altinity/clickhouse/script.rpm.sh | sudo bash

for Amazon Linux

curl -s https://packagecloud.io/install/repositories/altinity/clickhouse/script.rpm.sh | sudo os=centos dist=7 bash

pay attention to os=centos dist=7 explicitly specified

Install packages after script

First of all, ensure we have ClickHouse packages available for installation

sudo yum list 'clickhouse*'

ClickHouse packages should be listed as available, something like this:

Available Packages
clickhouse-client.x86_64                18.1.0-1.el7             Altinity_clickhouse
clickhouse-common-static.x86_64         18.1.0-1.el7             Altinity_clickhouse
clickhouse-compressor.x86_64            1.1.54336-3.el7          Altinity_clickhouse
clickhouse-debuginfo.x86_64             18.1.0-1.el7             Altinity_clickhouse
clickhouse-mysql.noarch                 0.0.20180319-1           Altinity_clickhouse
clickhouse-server.x86_64                18.1.0-1.el7             Altinity_clickhouse
clickhouse-server-common.x86_64         18.1.0-1.el7             Altinity_clickhouse
clickhouse-test.x86_64                  18.1.0-1.el7             Altinity_clickhouse

There are multiple packages available (new versions and old tools as well), some of them are deprecated already, so there is no need to install all available RPMs.

Now let's install ClickHouse main parts - server and client applications.

sudo yum install -y clickhouse-server clickhouse-client

and verify it is listed as installed

 sudo yum list installed 'clickhouse*'

ClickHouse packages should be listed as installed, something like this:

Installed Packages
clickhouse-client.x86_64                 18.1.0-1.el7           @Altinity_clickhouse
clickhouse-common-static.x86_64          18.1.0-1.el7           @Altinity_clickhouse
clickhouse-server.x86_64                 18.1.0-1.el7           @Altinity_clickhouse
clickhouse-server-common.x86_64          18.1.0-1.el7           @Altinity_clickhouse

Ensure ClickHouse server is running

sudo /etc/init.d/clickhouse-server restart

And connect to it with clickhouse-client

clickhouse-client

ClickHouse server should respond, something like this:

ClickHouse client version 18.1.0.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 18.1.54396.

:)

Well, all looks fine and ClickHouse installed from RPM packages!

We are all done!

Manual installation

Let's add packagecloud.io repo manually

Install required packages

We'll need two packages installed beforehands:

  • pygpgme - helps handling gpg-signatures
  • yum-utils - contains tools for handling source RPMs
sudo yum install -y pygpgme yum-utils

Create required files

Now let's create yum's repository configuration file: /etc/yum.repos.d/altinity_clickhouse.repo Depending on what CentOS version you are running you may need files for EL 6 or 7 version

EL6 repo file

For EL6 (do NOT use with Amazon Linux) copy+paste into /etc/yum.repos.d/altinity_clickhouse.repo

[altinity_clickhouse]
name=altinity_clickhouse
baseurl=https://packagecloud.io/altinity/clickhouse/el/6/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/altinity/clickhouse/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[altinity_clickhouse-source]
name=altinity_clickhouse-source
baseurl=https://packagecloud.io/altinity/clickhouse/el/6/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/altinity/clickhouse/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

EL7 repo file

For EL7 and Amazon Linux copy+paste into /etc/yum.repos.d/altinity_clickhouse.repo

[altinity_clickhouse]
name=altinity_clickhouse
baseurl=https://packagecloud.io/altinity/clickhouse/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/altinity/clickhouse/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[altinity_clickhouse-source]
name=altinity_clickhouse-source
baseurl=https://packagecloud.io/altinity/clickhouse/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/altinity/clickhouse/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

Update cache

After repo files created, let's update yum's cache with packges from newly added altinity_clickhouse repo

sudo yum -q makecache -y --disablerepo='*' --enablerepo='altinity_clickhouse'

Install packages manually

Packages can be installed the same way as in section Install packages after script

Conclusion

Now we have ClickHouse RPM packages available for easy installation.