{"id":13695576,"url":"https://github.com/Altinity/clickhouse-rpm-install","last_synced_at":"2025-05-03T13:32:28.788Z","repository":{"id":103608611,"uuid":"100691450","full_name":"Altinity/clickhouse-rpm-install","owner":"Altinity","description":"How to install clickhouse RPM packages","archived":false,"fork":false,"pushed_at":"2020-01-21T15:13:24.000Z","size":30,"stargazers_count":136,"open_issues_count":1,"forks_count":29,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-12T23:36:02.993Z","etag":null,"topics":["clickhouse","install","rpm"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Altinity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-08-18T08:36:05.000Z","updated_at":"2024-01-25T11:36:57.000Z","dependencies_parsed_at":"2024-04-19T02:32:44.761Z","dependency_job_id":null,"html_url":"https://github.com/Altinity/clickhouse-rpm-install","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Altinity%2Fclickhouse-rpm-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Altinity%2Fclickhouse-rpm-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Altinity%2Fclickhouse-rpm-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Altinity%2Fclickhouse-rpm-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Altinity","download_url":"https://codeload.github.com/Altinity/clickhouse-rpm-install/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252195837,"owners_count":21709722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clickhouse","install","rpm"],"created_at":"2024-08-02T18:00:29.898Z","updated_at":"2025-05-03T13:32:28.476Z","avatar_url":"https://github.com/Altinity.png","language":null,"funding_links":[],"categories":["Integrations"],"sub_categories":["Deployment and Management Tools"],"readme":"# How to Install ClickHouse with RPM packages from Altinity's repo(s)\n\n------\n\n## Table of Contents\n\n* [What is this](#what-is-this)\n* [Introduction](#introduction)\n* [Script-based installation](#script-based-installation)\n  * [Install dependencies](#install-dependencies)\n  * [Install packages](#install-packages)\n* [Manual installation](#manual-installation)\n  * [Install required packages](#install-required-packages)\n  * [Create required files](#create-required-files)\n    * [EL6 repo file](#el6-repo-file)\n    * [EL7 repo file](#el7-repo-file)\n  * [Update cache](#update-cache)\n  * [Install packages manually](#install-packages-manually)\n* [Conclusion](#conclusion)\n\n------\n\n## What is this\nThis is a detailed explanation on how to install ready-to-use ClickHouse RPMs from Altinity's repos (either [general repo][pack_alt_repo] or [stable repo][pack_alt_stable_repo]) located on [packagecloud.io][pack_alt_repos_list].\nThis is **not** an instructions on how to build your own hand-made RPMs.\nHowever, if you need to build your own RPMs, there is a [detailed explanation][alt_rpm_builder_repo] on how to build ClickHouse RPMs from sources with the help of Altinity's [RPM builder][alt_rpm_builder_repo]\n\n## Introduction\n\n### `general` and `stable` repos\nAltinity provides two repos:\n* `general` [repo][pack_alt_repo] with general ClickHouse releases.\n* `stable` [repo][pack_alt_stable_repo] with Altinity Stable ClickHouse releases.\n\n### Supported OSes\nAll instructions in this manual were tested on Centos 6.10, CentOS 7.5 and Amazon Linux 2.\n\n**IMPORTANT for Amazon Linux users** \nAmazon 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\nMore details further in the doc.\n\n### Register repo\n\nIn order to install ClickHouse RPM packages from Altinity's repo, we need to register it (repo) with our `yum`, making `yum` aware of additional packages installable from external source.\n\nIn general, repositories are listed in `/etc/yum.repos.d` folder, so we need to add Altinity's repo description in there.\n\nThis can be done either [manually](#manual-installation) or via [script](#script-based-installation), provided by `packagecloud.io`. \nIn any case, as a result, we'll have ClickHouse packages available for installation via `yum`.\n\n**IMPORTANT for Amazon Linux users** \nAmazon Linux is being detected as CentOS 6 by the script, so we need to explicitly instruct it to use CentOS 7 repo.\n  * In case of [manual installation](#manual-installation), just use [EL7 repo file](#el7-repo-file). It is compatible with Amazon Linux\n  * In case of [script-based installation](#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.\n\nLet's start with script-based installation, since this approach looks like more user-friendly.\n\n## Script-based installation\nFor our convenience,`packagecloud.io` provides nice and user-friendly way to add repos with their `shell script`.\nWe'll need to download and run **packagecloud**'s `shell script`, which will do all required steps.\n\n### Install dependencies\nInstallation process requires `curl` in order to download packages. \nClickHouse test package has some dependencies in EPEL, so `epel-release` has to be installed as well, in case you'd like to install ClickHouse test package.\nSome installations do not have `sudo` installed, so we need to ensure it is availbale also.\n\nEnsure `sudo` is available:\n```bash\nyum install -y sudo\n```\n\nEnsure `curl` is available:\n```bash\nsudo yum install -y curl\n# in case test package would be installed, add epel-release\nsudo yum install -y epel-release\n```\n\nLet's download and run installation `shell script`, provided by `packagecloud.io`.\nFirst of all, we need to point what script (from `general` or `stable` repo) we'll be using:\n\n```bash\n# For 'general' repo use this URL:\nSCRIPT_URL=\"https://packagecloud.io/install/repositories/altinity/clickhouse/script.rpm.sh\"\n\n# For 'stable' repo use this URL:\nSCRIPT_URL=\"https://packagecloud.io/install/repositories/altinity/clickhouse-altinity-stable/script.rpm.sh\"\n```\n\nNow we can register Altiniry's repo in the system by running appropriate script.\n\n**for CentOS 6 and 7**:\n```bash\ncurl -s \"${SCRIPT_URL}\" | sudo bash\n```\n\n**for Amazon Linux**:\n```bash\ncurl -s \"${SCRIPT_URL}\" | sudo os=centos dist=7 bash\n```\npay attention to `os=centos dist=7` explicitly specified.\n\nAt this point we have `yum` aware of additional RPM packages available. \n\nWe are ready to install ClickHouse.\n\n### Install packages\n\nFirst of all, ensure we have ClickHouse packages available for installation\n\n```bash\nsudo yum list 'clickhouse*'\n```\n\nClickHouse packages should be listed as available, something like this:\n``` bash\nAvailable Packages\nclickhouse-client.x86_64            19.13.3.26-1.el7      Altinity_clickhouse\nclickhouse-common-static.x86_64     19.13.3.26-1.el7      Altinity_clickhouse\nclickhouse-compressor.x86_64        1.1.54336-3.el7       Altinity_clickhouse\nclickhouse-debuginfo.x86_64         19.13.3.26-1.el7      Altinity_clickhouse\nclickhouse-odbc.x86_64              1.0.0.20190611-1      Altinity_clickhouse\nclickhouse-server.x86_64            19.13.3.26-1.el7      Altinity_clickhouse\nclickhouse-server-common.x86_64     19.13.3.26-1.el7      Altinity_clickhouse\nclickhouse-test.x86_64              19.13.3.26-1.el7      Altinity_clickhouse\n```\n\nThere 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.\n\nNow let's install ClickHouse main parts - server and client applications.\n\n#### Install latest ClickHouse version\nIn case we'd like to just install latest ClickHouse (it is so in most cases), we can simply install `clickhouse-server` and `clickhouse-client` as following:\n```bash\nsudo yum install -y clickhouse-server clickhouse-client\n```\n\nHowever, sometimes we'd like to install specific version of ClickHouse.\n#### Install specific ClickHouse version\nWe can either just want to install latest version from specific branch, or we may know what ClickHouse version we'd like to install exactly, or we can look over availbale (older) versions available for installation. \nThese cases are little bit different, let's take a look on both of them.\n\n**Select latest version from specific branch**\n\nIn case we'd like to install latest version of `19.11.X.Y` family, we can list available latest `19.11.*` packages\n```bash\nsudo yum list 'clickhouse*19.11.*'\n```\nWe'll see packages of one proposed version (latest) only:\n```text\nAvailable Packages\nclickhouse-client.x86_64         19.11.9.52-1.el7\nclickhouse-common-static.x86_64  19.11.9.52-1.el7\nclickhouse-debuginfo.x86_64      19.11.9.52-1.el7\nclickhouse-server.x86_64         19.11.9.52-1.el7\nclickhouse-server-common.x86_64  19.11.9.52-1.el7\nclickhouse-test.x86_64           19.11.9.52-1.el7\n```\n\n**Select specific version from specific branch**\n\nIn case we'd like to see all available versions of `19.11.X.Y` family, then select preferred version out of availbale for installation:\n```bash\nsudo yum list 'clickhouse*19.11.*' --showduplicates\n```\nWe'll see all available package versions from `19.11.X.Y` family:\n```text\nAvailable Packages\nclickhouse-client.x86_64         19.11.2.7-1.el7\nclickhouse-client.x86_64         19.11.3.11-1.el7\nclickhouse-client.x86_64         19.11.4.24-1.el7\nclickhouse-client.x86_64         19.11.6.31-1.el7\nclickhouse-client.x86_64         19.11.7.40-1.el7\nclickhouse-client.x86_64         19.11.8.46-1.el7\nclickhouse-client.x86_64         19.11.9.52-1.el7\nclickhouse-common-static.x86_64  19.11.2.7-1.el7\nclickhouse-common-static.x86_64  19.11.3.11-1.el7\nclickhouse-common-static.x86_64  19.11.4.24-1.el7\nclickhouse-common-static.x86_64  19.11.6.31-1.el7\n...\nand more\n```\n\n**Install specific version**\n\nBy now, we have picked up specific version (out of available) - let's install it:\n```bash\nsudo yum install -y clickhouse-server-19.11.7.40 clickhouse-client-19.11.7.40\n```\n\n\nand verify it is listed as installed\n```bash\n sudo yum list installed 'clickhouse*'\n```\n\nClickHouse packages should be listed as installed, something like this:\n```bash\nInstalled Packages\nclickhouse-client.x86_64                 19.11.7.40-1.el7           @Altinity_clickhouse\nclickhouse-common-static.x86_64          19.11.7.40-1.el7           @Altinity_clickhouse\nclickhouse-server.x86_64                 19.11.7.40-1.el7           @Altinity_clickhouse\nclickhouse-server-common.x86_64          19.11.7.40-1.el7           @Altinity_clickhouse\n```\n\nEnsure ClickHouse server is running\n```bash\nsudo /etc/init.d/clickhouse-server restart\n```\n\nAnd connect to it with `clickhouse-client`\n```bash\nclickhouse-client\n```\n\nClickHouse server should respond, something like this:\n```bash\nClickHouse client version 19.11.7.40.\nConnecting to localhost:9000 as user default.\nConnected to ClickHouse server version 19.11.7 revision 54423.\n\nip-172-31-37-226.ec2.internal :)\n```\n\nWell, all looks fine and ClickHouse installed from **RPM** packages!\n\nWe are all done!\n\n## Manual installation\n\nLet's add any of Altinity's repos - [general][pack_alt_repo] or [stable][pack_alt_stable_repo] manually\n\n### Install required packages\nWe'll need the following packages installed beforehands:\n  * `pygpgme` - helps handling gpg-signatures\n  * `yum-utils` - contains tools for handling source RPMs\n  * `coreutils` - contains core utils and we'll need `tee` command later\n  * `epel-release` - contains ClickHouse test package dependencies\n\n```bash\nsudo yum install -y pygpgme yum-utils coreutils epel-release\n```\n\n### Create required files\nNow let's create `yum`'s repository configuration file: `/etc/yum.repos.d/altinity_clickhouse.repo`.\nDepending on what CentOS version you are running you may need files for EL 6 or 7 version.\n\n```bash\n# For 'general' repo use this URL\nBASE_URL=\"https://packagecloud.io/altinity/clickhouse\"\n\n# For 'stable' repo use this URL\nBASE_URL=\"https://packagecloud.io/altinity/clickhouse-altinity-stable\"\n```\n\n#### EL6 repo file\n\nEL6 (**do NOT use with Amazon Linux**) ready-to-copy+paste command to create `yum`'s repo config file.\\\nIt writes `/etc/yum.repos.d/altinity_clickhouse.repo` file:\n```bash\ncat \u003c\u003cEOF | sudo tee /etc/yum.repos.d/altinity_clickhouse.repo\n[altinity_clickhouse]\nname=altinity_clickhouse\nbaseurl=${BASE_URL}/el/6/\\$basearch\nrepo_gpgcheck=1\ngpgcheck=0\nenabled=1\ngpgkey=${BASE_URL}/gpgkey\nsslverify=1\nsslcacert=/etc/pki/tls/certs/ca-bundle.crt\nmetadata_expire=300\n\n[altinity_clickhouse-source]\nname=altinity_clickhouse-source\nbaseurl=${BASE_URL}/el/6/SRPMS\nrepo_gpgcheck=1\ngpgcheck=0\nenabled=1\ngpgkey=${BASE_URL}/gpgkey\nsslverify=1\nsslcacert=/etc/pki/tls/certs/ca-bundle.crt\nmetadata_expire=300\nEOF\n```\n\n#### EL7 repo file\n\nEL7 **and Amazon Linux** ready-to-copy+paste command to create `yum`'s repo config file. \\\nIt writes `/etc/yum.repos.d/altinity_clickhouse.repo` file:\n```bash\ncat \u003c\u003cEOF | sudo tee /etc/yum.repos.d/altinity_clickhouse.repo\n[altinity_clickhouse]\nname=altinity_clickhouse\nbaseurl=${BASE_URL}/el/7/\\$basearch\nrepo_gpgcheck=1\ngpgcheck=0\nenabled=1\ngpgkey=${BASE_URL}/gpgkey\nsslverify=1\nsslcacert=/etc/pki/tls/certs/ca-bundle.crt\nmetadata_expire=300\n\n[altinity_clickhouse-source]\nname=altinity_clickhouse-source\nbaseurl=${BASE_URL}/el/7/SRPMS\nrepo_gpgcheck=1\ngpgcheck=0\nenabled=1\ngpgkey=${BASE_URL}/gpgkey\nsslverify=1\nsslcacert=/etc/pki/tls/certs/ca-bundle.crt\nmetadata_expire=300\nEOF\n```\n\n### Update cache\n\nAfter repo files created, let's update `yum`'s cache with packges from newly added repo\n```bash\nsudo yum -q makecache -y --disablerepo='*' --enablerepo='altinity*'\n```\n\n### Install packages manually\nPackages can be installed the same way as in section [Install packages](#install-packages) after script-based installation.\n\n\n## Conclusion\nNow we have ClickHouse **RPM** packages available for easy installation.\n\n[pack_alt_repos_list]: https://packagecloud.io/Altinity\n[pack_alt_repo]: https://packagecloud.io/Altinity/clickhouse\n[pack_alt_stable_repo]: https://packagecloud.io/Altinity/clickhouse-altinity-stable\n[pack_rpm_script]: https://packagecloud.io/Altinity/clickhouse/install#bash-rpm\n[pack_rpm_stable_script]: https://packagecloud.io/Altinity/clickhouse-altinity-stable/install#bash-rpm\n[alt_rpm_builder_repo]: https://github.com/Altinity/clickhouse-rpm\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAltinity%2Fclickhouse-rpm-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAltinity%2Fclickhouse-rpm-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAltinity%2Fclickhouse-rpm-install/lists"}