安装 您所在的位置:网站首页 tft最新安装包下载 安装

安装

2023-05-19 21:03| 来源: 网络整理| 查看: 265

安装系统要求​

ClickHouse可以在任何具有x86_64,AArch64或PowerPC64LE CPU架构的Linux,FreeBSD或Mac OS X上运行。

官方预构建的二进制文件通常针对x86_64进行编译,并利用SSE 4.2指令集,因此,除非另有说明,支持它的CPU使用将成为额外的系统需求。下面是检查当前CPU是否支持SSE 4.2的命令:

$ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"

要在不支持SSE 4.2或AArch64,PowerPC64LE架构的处理器上运行ClickHouse,您应该通过适当的配置调整从源代码构建ClickHouse。

可用安装包​DEB安装包​

建议使用Debian或Ubuntu的官方预编译deb软件包。运行以下命令来安装包:

sudo apt-get install -y apt-transport-https ca-certificates dirmngrsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee \ /etc/apt/sources.list.d/clickhouse.listsudo apt-get updatesudo apt-get install -y clickhouse-server clickhouse-clientsudo service clickhouse-server startclickhouse-client # or "clickhouse-client --password" if you've set up a password.Deprecated Method for installing deb-packagessudo apt-get install apt-transport-https ca-certificates dirmngrsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4echo "deb https://repo.clickhouse.com/deb/stable/ main/" | sudo tee \ /etc/apt/sources.list.d/clickhouse.listsudo apt-get updatesudo apt-get install -y clickhouse-server clickhouse-clientsudo service clickhouse-server startclickhouse-client # or "clickhouse-client --password" if you set up a password.

如果您想使用最新的版本,请用testing替代stable(我们只推荐您用于测试环境)。

你也可以从这里手动下载安装包:下载。

安装包列表:

clickhouse-common-static — ClickHouse编译的二进制文件。clickhouse-server — 创建clickhouse-server软连接,并安装默认配置服务clickhouse-client — 创建clickhouse-client客户端工具软连接,并安装客户端配置文件。clickhouse-common-static-dbg — 带有调试信息的ClickHouse二进制文件。RPM安装包​

推荐使用CentOS、RedHat和所有其他基于rpm的Linux发行版的官方预编译rpm包。

首先,您需要添加官方存储库:

sudo yum install -y yum-utilssudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.reposudo yum install -y clickhouse-server clickhouse-clientsudo /etc/init.d/clickhouse-server startclickhouse-client # or "clickhouse-client --password" if you set up a password.

For systems with zypper package manager (openSUSE, SLES):

sudo zypper addrepo -r https://packages.clickhouse.com/rpm/clickhouse.repo -gsudo zypper --gpg-auto-import-keys refresh clickhouse-stablesudo zypper install -y clickhouse-server clickhouse-clientsudo /etc/init.d/clickhouse-server startclickhouse-client # or "clickhouse-client --password" if you set up a password.Deprecated Method for installing rpm-packagessudo yum install yum-utilssudo rpm --import https://repo.clickhouse.com/CLICKHOUSE-KEY.GPGsudo yum-config-manager --add-repo https://repo.clickhouse.com/rpm/clickhouse.reposudo yum install clickhouse-server clickhouse-clientsudo /etc/init.d/clickhouse-server startclickhouse-client # or "clickhouse-client --password" if you set up a password.

如果您想使用最新的版本,请用testing替代stable(我们只推荐您用于测试环境)。prestable有时也可用。

然后运行命令安装:

sudo yum install clickhouse-server clickhouse-client

你也可以从这里手动下载安装包:下载。

Tgz安装包​

如果您的操作系统不支持安装deb或rpm包,建议使用官方预编译的tgz软件包。

所需的版本可以通过curl或wget从存储库https://packages.clickhouse.com/tgz/下载。

下载后解压缩下载资源文件并使用安装脚本进行安装。以下是一个最新稳定版本的安装示例:

LATEST_VERSION=$(curl -s https://packages.clickhouse.com/tgz/stable/ | \ grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sort -V -r | head -n 1)export LATEST_VERSIONcase $(uname -m) in x86_64) ARCH=amd64 ;; aarch64) ARCH=arm64 ;; *) echo "Unknown architecture $(uname -m)"; exit 1 ;;esacfor PKG in clickhouse-common-static clickhouse-common-static-dbg clickhouse-server clickhouse-clientdo curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$LATEST_VERSION-${ARCH}.tgz" \ || curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$LATEST_VERSION.tgz"donetar -xzvf "clickhouse-common-static-$LATEST_VERSION-${ARCH}.tgz" \ || tar -xzvf "clickhouse-common-static-$LATEST_VERSION.tgz"sudo "clickhouse-common-static-$LATEST_VERSION/install/doinst.sh"tar -xzvf "clickhouse-common-static-dbg-$LATEST_VERSION-${ARCH}.tgz" \ || tar -xzvf "clickhouse-common-static-dbg-$LATEST_VERSION.tgz"sudo "clickhouse-common-static-dbg-$LATEST_VERSION/install/doinst.sh"tar -xzvf "clickhouse-server-$LATEST_VERSION-${ARCH}.tgz" \ || tar -xzvf "clickhouse-server-$LATEST_VERSION.tgz"sudo "clickhouse-server-$LATEST_VERSION/install/doinst.sh" configuresudo /etc/init.d/clickhouse-server starttar -xzvf "clickhouse-client-$LATEST_VERSION-${ARCH}.tgz" \ || tar -xzvf "clickhouse-client-$LATEST_VERSION.tgz"sudo "clickhouse-client-$LATEST_VERSION/install/doinst.sh"Deprecated Method for installing tgz archivesexport LATEST_VERSION=$(curl -s https://repo.clickhouse.com/tgz/stable/ | \ grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sort -V -r | head -n 1)curl -O https://repo.clickhouse.com/tgz/stable/clickhouse-common-static-$LATEST_VERSION.tgzcurl -O https://repo.clickhouse.com/tgz/stable/clickhouse-common-static-dbg-$LATEST_VERSION.tgzcurl -O https://repo.clickhouse.com/tgz/stable/clickhouse-server-$LATEST_VERSION.tgzcurl -O https://repo.clickhouse.com/tgz/stable/clickhouse-client-$LATEST_VERSION.tgztar -xzvf clickhouse-common-static-$LATEST_VERSION.tgzsudo clickhouse-common-static-$LATEST_VERSION/install/doinst.shtar -xzvf clickhouse-common-static-dbg-$LATEST_VERSION.tgzsudo clickhouse-common-static-dbg-$LATEST_VERSION/install/doinst.shtar -xzvf clickhouse-server-$LATEST_VERSION.tgzsudo clickhouse-server-$LATEST_VERSION/install/doinst.shsudo /etc/init.d/clickhouse-server starttar -xzvf clickhouse-client-$LATEST_VERSION.tgzsudo clickhouse-client-$LATEST_VERSION/install/doinst.sh

对于生产环境,建议使用最新的stable版本。你可以在GitHub页面https://github.com/ClickHouse/ClickHouse/tags找到它,它以后缀`-stable`标志。

Docker安装包​

要在Docker中运行ClickHouse,请遵循Docker Hub上的指南。它是官方的deb安装包。

其他环境安装包​

对于非linux操作系统和Arch64 CPU架构,ClickHouse将会以master分支的最新提交的进行编译提供(它将会有几小时的延迟)。

macOS — curl -O 'https://builds.clickhouse.com/master/macos/clickhouse' && chmod a+x ./clickhouseFreeBSD — curl -O 'https://builds.clickhouse.com/master/freebsd/clickhouse' && chmod a+x ./clickhouseAArch64 — curl -O 'https://builds.clickhouse.com/master/aarch64/clickhouse' && chmod a+x ./clickhouse

下载后,您可以使用clickhouse client连接服务,或者使用clickhouse local模式处理数据,不过您必须要额外在GitHub下载server和users配置文件。

不建议在生产环境中使用这些构建版本,因为它们没有经过充分的测试,但是您可以自行承担这样做的风险。它们只是ClickHouse功能的一个部分。

使用源码安装​

要手动编译ClickHouse, 请遵循Linux或Mac OS X说明。

您可以编译并安装它们,也可以使用不安装包的程序。通过手动构建,您可以禁用SSE 4.2或AArch64 cpu。

Client: programs/clickhouse-client Server: programs/clickhouse-server

您需要创建一个数据和元数据文件夹,并为所需的用户chown授权。它们的路径可以在服务器配置(src/programs/server/config.xml)中改变,默认情况下它们是:

/opt/clickhouse/data/default/ /opt/clickhouse/metadata/default/

在Gentoo上,你可以使用emerge clickhouse从源代码安装ClickHouse。

启动​

如果没有service,可以运行如下命令在后台启动服务:

$ sudo /etc/init.d/clickhouse-server start

日志文件将输出在/var/log/clickhouse-server/文件夹。

如果服务器没有启动,检查/etc/clickhouse-server/config.xml中的配置。

您也可以手动从控制台启动服务器:

$ clickhouse-server --config-file=/etc/clickhouse-server/config.xml

在这种情况下,日志将被打印到控制台,这在开发过程中很方便。

如果配置文件在当前目录中,则不需要指定——config-file参数。默认情况下,它的路径为./config.xml。

ClickHouse支持访问限制设置。它们位于users.xml文件(与config.xml同级目录)。 默认情况下,允许default用户从任何地方访问,不需要密码。可查看user/default/networks。 更多信息,请参见Configuration Files。

启动服务后,您可以使用命令行客户端连接到它:

$ clickhouse-client

默认情况下,使用default用户并不携带密码连接到localhost:9000。还可以使用--host参数连接到指定服务器。

终端必须使用UTF-8编码。 更多信息,请参阅Command-line client。

示例:

$ ./clickhouse-clientClickHouse client version 0.0.18749.Connecting to localhost:9000.Connected to ClickHouse server version 0.0.18749.:) SELECT 1SELECT 1┌─1─┐│ 1 │└───┘1 rows in set. Elapsed: 0.003 sec.:)

恭喜,系统已经工作了!

为了继续进行实验,你可以尝试下载测试数据集或查看教程。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有