clickhouse-安装部署

官网文档

1.采用Debian包方式安装

# 设置Debian仓库
sudo apt-get install -y apt-transport-https ca-certificates dirmngr
GNUPGHOME=$(mktemp -d)
sudo GNUPGHOME="$GNUPGHOME" gpg --no-default-keyring --keyring /usr/share/keyrings/clickhouse-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8919F6BD2B48D754
sudo rm -r "$GNUPGHOME"
sudo chmod +r /usr/share/keyrings/clickhouse-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | sudo tee \
    /etc/apt/sources.list.d/clickhouse.list
sudo apt-get update

# 安装服务和客户端
sudo apt-get install -y clickhouse-server clickhouse-client

# 启动并登录clickhouse
sudo service clickhouse-server start
clickhouse-client # or "clickhouse-client --password" if you've set up a password.

# 在生产环境中,我们强烈建议在专用节点上运行 ClickHouse Keeper。在测试环境中,如果您决定在同一台服务器上运行 ClickHouse Server 和 ClickHouse Keeper,则无需安装 ClickHouse Keeper,因为它包含在 ClickHouse 服务器中。 此命令仅在独立的 ClickHouse Keeper 服务器上需要
# 安装clickhouse-keeper
sudo apt-get install -y clickhouse-keeper
# 启用并启动clickhouse-keeper
sudo systemctl enable clickhouse-keeper
sudo systemctl start clickhouse-keeper
sudo systemctl status clickhouse-keeper

2.采用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_VERSION

case $(uname -m) in
  x86_64) ARCH=amd64 ;;
  aarch64) ARCH=arm64 ;;
  *) echo "Unknown architecture $(uname -m)"; exit 1 ;;
esac

for PKG in clickhouse-common-static clickhouse-common-static-dbg clickhouse-server clickhouse-client clickhouse-keeper
do
  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"
done

tar -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" configure
sudo /etc/init.d/clickhouse-server start

tar -xzvf "clickhouse-client-$LATEST_VERSION-${ARCH}.tgz" \
  || tar -xzvf "clickhouse-client-$LATEST_VERSION.tgz"
sudo "clickhouse-client-$LATEST_VERSION/install/doinst.sh"

具体包的解释

clickhouse-common-static— 安装ClickHouse编译的二进制文件。
clickhouse-server— 创建符号链接并安装默认服务器配置。clickhouse-server
clickhouse-client— 为 和其他与客户端相关的工具创建符号链接。并安装客户端配置文件。clickhouse-client
clickhouse-common-static-dbg— 安装带有调试信息的 ClickHouse 编译二进制文件。
clickhouse-keeper- 用于在专用的 ClickHouse Keeper 节点上安装 ClickHouse Keeper。如果您在与ClickHouse服务器相同的服务器上运行ClickHouse Keeper,则无需安装此软件包。安装 ClickHouse Keeper 和默认的 ClickHouse Keeper 配置文件。

你可能感兴趣的:(clickhouse,clickhouse,windows)