首页 > 其他分享 >Install clickhouse

Install clickhouse

时间:2024-08-20 10:09:14浏览次数:5  
标签:elif echo clickhouse Install fi ARCH DIR

Install script

#!/bin/sh -e

OS=$(uname -s)
ARCH=$(uname -m)

DIR=

if [ "${OS}" = "Linux" ]
then
    if [ "${ARCH}" = "x86_64" -o "${ARCH}" = "amd64" ]
    then
        # Require at least x86-64 + SSE4.2 (introduced in 2006). On older hardware fall back to plain x86-64 (introduced in 1999) which
        # guarantees at least SSE2. The caveat is that plain x86-64 builds are much less tested than SSE 4.2 builds.
        HAS_SSE42=$(grep sse4_2 /proc/cpuinfo)
        if [ "${HAS_SSE42}" ]
        then
            DIR="amd64"
        else
            DIR="amd64compat"
        fi
    elif [ "${ARCH}" = "aarch64" -o "${ARCH}" = "arm64" ]
    then
        # Dispatch between standard and compatibility builds, see cmake/cpu_features.cmake for details. Unfortunately, (1) the ARM ISA level
        # cannot be read directly, we need to guess from the "features" in /proc/cpuinfo, and (2) the flags in /proc/cpuinfo are named
        # differently than the flags passed to the compiler in cpu_features.cmake.
        HAS_ARMV82=$(grep -m 1 'Features' /proc/cpuinfo | awk '/asimd/ && /sha1/ && /aes/ && /atomics/ && /lrcpc/')
        if [ "${HAS_ARMV82}" ]
        then
            DIR="aarch64"
        else
            DIR="aarch64v80compat"
        fi
    elif [ "${ARCH}" = "powerpc64le" -o "${ARCH}" = "ppc64le" ]
    then
        DIR="powerpc64le"
    elif [ "${ARCH}" = "riscv64" ]
    then
        DIR="riscv64"
    elif [ "${ARCH}" = "s390x" ]
    then
        DIR="s390x"
    fi
elif [ "${OS}" = "FreeBSD" ]
then
    if [ "${ARCH}" = "x86_64" -o "${ARCH}" = "amd64" ]
    then
        DIR="freebsd"
    fi
elif [ "${OS}" = "Darwin" ]
then
    if [ "${ARCH}" = "x86_64" -o "${ARCH}" = "amd64" ]
    then
        DIR="macos"
    elif [ "${ARCH}" = "aarch64" -o "${ARCH}" = "arm64" ]
    then
        DIR="macos-aarch64"
    fi
fi

if [ -z "${DIR}" ]
then
    echo "Operating system '${OS}' / architecture '${ARCH}' is unsupported."
    exit 1
fi

clickhouse_download_filename_prefix="clickhouse"
clickhouse="$clickhouse_download_filename_prefix"

if [ -f "$clickhouse" ]
then
    read -p "ClickHouse binary ${clickhouse} already exists. Overwrite? [y/N] " answer
    if [ "$answer" = "y" -o "$answer" = "Y" ]
    then
        rm -f "$clickhouse"
    else
        i=0
        while [ -f "$clickhouse" ]
        do
            clickhouse="${clickhouse_download_filename_prefix}.${i}"
            i=$(($i+1))
        done
    fi
fi

URL="https://builds.clickhouse.com/master/${DIR}/clickhouse"
echo
echo "Will download ${URL} into ${clickhouse}"
echo
curl "${URL}" -o "${clickhouse}" && chmod a+x "${clickhouse}" || exit 1
echo
echo "Successfully downloaded the ClickHouse binary, you can run it as:
    ./${clickhouse}"

if [ "${OS}" = "Linux" ]
then
    echo
    echo "You can also install it:
    sudo ./${clickhouse} install"
fi

标签:elif,echo,clickhouse,Install,fi,ARCH,DIR
From: https://www.cnblogs.com/waketzheng/p/18368881

相关文章

  • 【Linux_install】详细的Ubuntu和win双系统安装指南
    @目录1.前期准备1.1制作启动盘1.2关闭快速启动、安全启动、bitlocker1.2.1原因1.2.2进入BIOSshell命令行进入BIOSwindows设置中高级启动在开机时狂按某个键进入BIOS1.2.3关闭Fastboot和Secureboot1.3划分磁盘空间1.3.1查看目前的虚拟内存大小2.开始安装2.1使用启动盘启动......
  • 问题:ETL中写入数据到Clickhouse抛出 Code: 27. DB::ParsingException: Cannot parse i
    问题描述问题:ETL中写入数据到Clickhouse抛出Code:27.DB::ParsingException:Cannotparseinput问题原因:目标字段的长度和精度不足以容纳源字段问题解决方法:案例1:源是timestamp,目标是datetime修改结果:创建目标表的时候选择高精度的字段类型案例2:源是带有小数的......
  • 解锁强强组合: 使用 Kafka + ClickHouse 快速搭建流数据实时处理平台(DoubleCloud 博
    我们想要解决的问题让我们深入一个现实场景:设想你负责汇总多个销售点系统产生的大量数据。这些数据需要被实时处理并在高级分析仪表板上展示,以提供全面的洞察。在数据处理领域,速度至关重要。ClickHouse作为速度之王,它从不减速且异常迅速。其在并发处理方面的高效性以及成本效......
  • @clickhouse/client-web部署后出现ClickHose query error:crypto.randomUUID is not a
    crypto.randomUUID报错我这里是因为使用使用@clickhouse/client-web组件,在服务器部署后在浏览器访问界面导致的crypto.randomUUIDisnotafunction报错如果你用http://localhost:端口,在服务器浏览器上访问这个部署的页面,发现不会报错,这是因为,你使用localhost访问......
  • failed to solve: process “/bin/sh -c yum -y install vim“ did not complete succ
    网上有好多种方法(都试过了只有方法四可以用):方法一:systemctl restart  docker(生产上不建议)方法二:看看你的网络是否有问题,检查一下网络连通性方法三:有可能是容器版本的问题,推荐使用centos7,看网上说最新的镜像会有这类的的问题方法四:就像这个博主大佬说的修改主机源修改......
  • pyinstall通过配置.spec文件引用资源文件
    pyinstall通过配置.spec文件引用资源文件pyinstall可以自动将所有依赖的.py文件连接起来编译成一个可执行exe文件,但是如果在程序中使用了外部资源,如图片,或者是其它的配置文件的时候。pyinstall直接编译生成的exe文件可能会找不到程序中引用的资源。这时候我们就需要进入.spec......
  • 14.第五天(第二部分):Installing and Maintaining the IDSM-2
    idsm-2performance:500mbpssize:1ru/slotprocessor:dual1.1.3ghzoperatingsystem:linux即支持在线模式也支持离线模式port1:不能配置只是发送tcpresetport2:commandports7and8:sensing口,已经做好trunkvlanmap既能对二层又能对三层流量控制ipaccess-listexi......
  • rocky minum necessary for installation
    安装依赖yum-yinstallgccautomakeautoconflibtoolmakeyum-yinstallpcre-developensslopenssl-develgd-develgccgcc-c++yasm-1.3.0 安装cdyasm-1.3.0./configuremake&&makeinstall安装ffmpegcdffmpeg-xxx./configure--prefix=/usr/local/ffm......
  • clickhouse_mergeTree
    MergeTree类型Clickhouse中最强大的表引擎当属MergeTree(合并树)引擎及该系列(*MergeTree)中的其他引擎。MergeTree系列的引擎被设计用于插入极大量的数据到一张表当中。数据可以以数据片段的形式一个接着一个的快速写入,数据片段在后台按照一定的规则进行合并。相比在插入时不......
  • 解决:The GPG keys listed for the "MySQL 8.0 Community Server" repository are alre
    安装mysql提示Retrievingkeyfromfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysqlTheGPGkeyslistedforthe"MySQL8.0CommunityServer"repositoryarealreadyinstalledbuttheyarenotcorrectforthispackage.CheckthatthecorrectkeyURLsarecon......