首页 > 系统相关 >Clickhouse的极简安装-之二(macos+linux)

Clickhouse的极简安装-之二(macos+linux)

时间:2023-08-22 18:24:29浏览次数:48  
标签:bin macos Creating Clickhouse server usr linux ARCH clickhouse

Clickhouse的极简安装-之二(macos+linux)


StudyFrom

https://clickhouse.com/docs/en/install

然后简单的获取方式:
curl https://clickhouse.com/  > ck.url

其实可以看到他的安装命令了. 

命令拆解

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
        # If the system has >=ARMv8.2 (https://en.wikipedia.org/wiki/AArch64), choose the corresponding build, else fall back to a v8.0
        # compat build. Unfortunately, the ARM ISA level cannot be read directly, we need to guess from the "features" in /proc/cpuinfo.
        # Also, the flags in /proc/cpuinfo are named differently than the flags passed to the compiler (cmake/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

二进制的洗洗

明显可以看到, 安装文件
linux 如果是x86架构:  amd64 
      如果没有SSE42那么就是: amd64compat
linux 如果arm架构:    aarch64
      如果是飞腾架构:  aarch64v80compat
macos 如果是x86的机器: macos
      如果是m2的机器:  macos-aarch64

获取精确的下载地址

https://builds.clickhouse.com/master/${DIR}/clickhouse

然后进行替换就可以了. 
比如 linux机器的话 就是:
wget https://builds.clickhouse.com/master/amd64/clickhouse

linux的话可以直接使用命令或者是二进制进行安装

安装方式

将 clickhouse 二进制文件放到 /usr/bin 目录下
执行clickhouse install 就可以. 

注意事项

最新的latest 的clickhouse 的二进制无法再鲲鹏上面运行
需要降级处理一下:
一般可以从如下网站进行下载 tar.gz包 
https://repo.clickhouse.tech/tgz/stable/

需要注意 一般进需要 static 的那个包里面的clickhouse 文件.
与上一步安装方式完全一样. 
1. 分发文件
scp /usr/bin/clickhouse [email protected]:/usr/bin/
2. 安装
clickhouse install
3. 测试验证
clickhouse-local -q "select 1"
1

注意安装的效果为:

ClickHouse binary is already located at /usr/bin/clickhouse
Creating symlink /usr/bin/clickhouse-server to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-client to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-local to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-benchmark to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-copier to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-obfuscator to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-git-import to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-compressor to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-format to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-extract-from-config to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-keeper to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-keeper-converter to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-disks to /usr/bin/clickhouse.
Creating clickhouse group if it does not exist.
 groupadd -r clickhouse
Creating clickhouse user if it does not exist.
 useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse clickhouse
Will set ulimits for clickhouse user in /etc/security/limits.d/clickhouse.conf.
Creating config directory /etc/clickhouse-server.
Creating config directory /etc/clickhouse-server/config.d that is used for tweaks of main server configuration.
Creating config directory /etc/clickhouse-server/users.d that is used for tweaks of users configuration.
Data path configuration override is saved to file /etc/clickhouse-server/config.d/data-paths.xml.
Log path configuration override is saved to file /etc/clickhouse-server/config.d/logger.xml.
User directory path configuration override is saved to file /etc/clickhouse-server/config.d/user-directories.xml.
OpenSSL path configuration override is saved to file /etc/clickhouse-server/config.d/openssl.xml.
Creating log directory /var/log/clickhouse-server.
Creating data directory /var/lib/clickhouse.
Creating pid directory /var/run/clickhouse-server.
 chown -R clickhouse:clickhouse '/var/log/clickhouse-server'
 chown -R clickhouse:clickhouse '/var/run/clickhouse-server'
 chown  clickhouse:clickhouse '/var/lib/clickhouse'
Enter password for default user:
Password for default user is empty string. See /etc/clickhouse-server/users.xml and /etc/clickhouse-server/users.d to change it.
Setting capabilities for clickhouse binary. This is optional.
 chown -R clickhouse:clickhouse '/etc/clickhouse-server'

ClickHouse has been successfully installed.

Start clickhouse-server with:
 sudo clickhouse start

Start clickhouse-client with:
 clickhouse-client

标签:bin,macos,Creating,Clickhouse,server,usr,linux,ARCH,clickhouse
From: https://www.cnblogs.com/jinanxiaolaohu/p/17649355.html

相关文章

  • 如何在linux下快速查看一个文件的列数
     使用`awk`命令:```bashawk'{printNF;exit}'文件名```这个命令将打印文件的第一行的列数,并立即退出。如果只关心文件的第一行列数,这是一个快速的方法。使用`head`命令:```bashhead-n1文件名|awk'{printNF}'```这个命令将打印文件的第一行,并通过管道将其传递给......
  • 14.linux命令ps
    14.linux命令ps1.psaux对进程进行监测和控制,首先必须要了解当前进程的情况,也就是需要查看当前进程,而ps命令(ProcessStatus)就是最基本同时也是非常强大的进程查看命令。使用该命令可以确定有哪些进程正在运行和运行的状态、进程是否结束、进程有没有僵尸、哪些进程占用了过......
  • 如何在Kali Linux上安装remmina
    在本教程中,我们学习如何在KaliLinux上安装remmina。remmina是GTK+远程桌面客户端介绍在本教程中,我们学习如何remmina在KaliLinux上安装。什么是remminaremmina:Remmina是一个用GTK+编写的远程桌面客户端,旨在对需要在大型显示器或小型上网本前处理大量远程计算机......
  • 13.Linux中fork函数详解(附图解与代码实现)
    13.Linux中fork函数详解(附图解与代码实现)我们先来看个代码,判断一下这个代码的输出结果会是什么样的,先不要去看运行结果,判断好后再去看看是否和你的预期结果一致。#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<string.h>intmain(void){ pid_tpid; ......
  • Linux
    了解Linux操作系统:控制硬件和支持软件运行的计算机程序。常见的操作系统:windows,macOS,Linux,IOSlinux分为内核和发行版本:内核:操作和控制硬件的核心东西发行版本:是Linux内核与各种常用软件的产品组合,就是我们常说的操作系统常用的发行版本:Ubuntu、CentOS、Redhat搭建环境双系统优点:运......
  • Linux硬链接和符号链接
    硬链接多个文件名指向同一个物理内存地址符号链接类似于C的指针 ......
  • linux忘记root密码
    转https://www.rstk.cn/news/292606.html?action=onClick 1、虚拟机运行到这个页面,按下‘e’键 2、找到ro 3、将ro改成rw并在后面加一个rd.break 4、敲下以下代码,这里我们改的是root的密码,输入密码不会显示,且要输两遍密码,之后touch一个文件--> /.autorela......
  • Linux命令的连接符
    &&逻辑与如果ipa命令执行失败,那么不执行whoami;如果ipa命令执行成功,那么执行whoami。ipa&&whoami||逻辑或如果ipa命令执行成功,那么不执行whoami;如果ipa命命执行失败,那么执行whoami。ipa||whoami;ipa命令先执行,无论是否成功,都会执行whoami。ipa;whoami|管道符**前......
  • Linux架构
    内核:管理硬件资源,对上层应用程序提供运行时环境系统调用:内核给上层应用程序提供的接口库函数:对系统调用进行包装,方便程序员使用(如printf,scanf,malloc,free)shell:命令解析器,一般,命令都是一些简单的可执行程序注:脚本:命令的集合应用程序(最上层)给个图: ......
  • EasyCVR视频融合平台Linux环境下CGO调用C接口推流异常,H.265转H.264失败的原因是?
    EasyCVR视频融合云平台采用云边端一体化架构,可以将分散在仓储各处的前端监控设备(如IPC、NVR等)集中接入,并提供实时视频监控、视频录像、云存储、录像检索与回放、智能告警、云台控制、平台级联、服务器集群等视频能力服务。通过实时高清视频监控,仓储管理人员可以高效地监管人员和货......