首页 > 系统相关 >Linux 安装 Clickhouse

Linux 安装 Clickhouse

时间:2022-12-15 18:45:20浏览次数:40  
标签:xml -- 安装 server Clickhouse Linux config el7 clickhouse


下载:https://packagecloud.io/Altinity/clickhouse

wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/7/clickhouse-server-common-20.8.3.18-1.el7.x86_64.rpm/download.rpm
yum install clickhouse-server-common-20.8.3.18-1.el7.x86_64

wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/7/clickhouse-common-static-20.8.3.18-1.el7.x86_64.rpm/download.rpm
yum install clickhouse-common-static-20.8.3.18-1.el7.x86_64

wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/7/clickhouse-server-20.8.3.18-1.el7.x86_64.rpm/download.rpm
yum install clickhouse-server-20.8.3.18-1.el7.x86_64

wget --content-disposition https://packagecloud.io/Altinity/clickhouse/packages/el/7/clickhouse-client-20.8.3.18-1.el7.x86_64.rpm/download.rpm
yum install clickhouse-client-20.8.3.18-1.el7.x86_64


安装包后到对应目录中,进行安装:
    安装命令:rpm -ivh ./clickhouse-*.rpm
全部安装完无错误信息即可,在过程中可能会出现缺少安装包的情况,此时需要将缺失的依赖补齐即可

    1. /etc/clickhouse-server : 服务端的配置文件目录,包括全局配置config.xml 和用户配置users.xml,其中如需要外网访问则需要打开config.xml中更改配置:
    其中需要放开<listen_host>::</listen_host>的注释即可
    2. /var/lib/clickhouse : 默认的数据存储目录,通常会修改,将数据保存到大容量磁盘路径中
    3. /var/log/cllckhouse-server : 默认保存日志的目录,通常会修改,将数据保存到大容量磁盘路径中

启动服务:
    启动:service clickhouse-server start
    重启:service clickhouse-server restart
        systemctl start clickhouse-server
        systemctl status clickhouse-server
        systemctl stop clickhouse-server
    [root@localhost clickhouse-server]# 
    service clickhouse-server start
    start clickhouse-server service: Path to data directory in /etc/clickhouse-server/config.xml: /var/lib/clickhouse/
    DONE

可以在/var/log/clickhouse-server/目录中查看日志。
如果服务没有启动,请检查配置文件 /etc/clickhouse-server/config.xml

手动从控制台启动服务器:
    clickhouse-server --config-file=/etc/clickhouse-server/config.xml
    sudo -u clickhouse clickhouse-server --config-file=/etc/clickhouse-server/config.xml
连接:
    clickhouse-client
    
测试:select 1

API:https://clickhouse.com/docs/zh/getting-started/install/
【错误1】:Effective user of the process (root) does not match the owner of the data (clickhouse). Run under 'sudo -u clickhouse'.
    解决:更改目录权限:chown -R clickhouse:clickhouse /etc/clickhouse-server /var/log/clickhouse-server

#添加关方存储库:
    sudo yum install -y yum-utils
    sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
    sudo yum install -y clickhouse-server clickhouse-client
#如果没有service,可以运行如下命令在后台启动服务:
    sudo /etc/init.d/clickhouse-server start 
#使用命令行客户端连接
    clickhouse-client # or "clickhouse-client --password" if you set up a password.

【错误2】:DB::Exception: Cannot lock file /var/lib/clickhouse/status. Another server instance in same directory is already running.
    解决:ps -ef | grep clickhouse-server
          kill -9 $pid
          可能不起作用,可使用 ps -ef 查到所有进程再删除 
【】<Error> Application: DNS error: EAI: -9
    解决:本机没有开放ipv6,只能对ipv4生效。可以考虑在config.xml中,把<listen_host>::</listen_host> 改成<listen_host>0.0.0.0</listen_host>
    
【】:Memory limit (for query) exceeded: would use 9.31 GiB (attempt to allocate chunk of 1048576 bytes), maximum: 9.31 GiB
    解决:修改user.xml里max_memory_usage 值,把他改大一些,默认是953M,不到1G,可以改到2G

【】Include not found: clickhouse_remote_servers
    Include not found: clickhouse_compression
    Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = Exception: Cannot set max size of core file to 1073741824, e.what() = Exception
    解决:没有开放core文件写入,使用命令: ulimit -c 1073741824, 开放即可。

【】Access to file denied: /var/log/clickhouse-server/clickhouse-server.err.log 
    解决:到目录下删除 clickhouse-server.err.log  文件

标签:xml,--,安装,server,Clickhouse,Linux,config,el7,clickhouse
From: https://www.cnblogs.com/zhey/p/16985818.html

相关文章

  • Linux 安装 GitLab
    *********************************************************************************官网:https://about.gitlab.com/    Product——>InstallGitLab——>选......
  • Rocky Linux9.1 手动配置静态IP
    #修改网络的配置文件[root@zabbix~]#vim/etc/NetworkManager/system-connections/ens192.nmconnection[connection]id=ens192uuid=0572911c-bd45-33c3-9442-c896e0320......
  • 使用Rsync在 Linux 上传输文件的示例
    在Linux操作系统上,“rsync”代表远程同步同步。它是用于将文件和目录从源(SRC)同步(复制)到目标(DEST)的实用程序。文件和目录可以在本地主机上同步,也可以在远程主机上......
  • 自制linux系统
    附加一块磁盘并进行分区,至少分区2个,一个用于/boot一个用于根目录/在将创建的分区进行格式化并挂载在/mnt/boot和/mnt/root下分别代表为根目录和boot目录对磁盘464个字节......
  • Linux 常用命令整理
    【常用命令】  查询当前时间:date  修改时间:tzselect #根据提示输入编号  显示当前绝对路径:pwd  重启系统:reboot  在指定文件中查找某内容:grep"某......
  • Linux安装 nginx
    安装nginx:在linux下安装nginx,首先需要安装gcc-c++编译器。执行文件make和安装nginx依赖的pcre和zlib包。最后安装nginx即可。  yum-yinstallmake  yum-y......
  • Linux 安装 Jdk1.8
    1、下载:jdk1.8.0_131-linux-64.tar.gz2、解压:tar-zxvfjdk1.8.0_131-linux-64.tar.gz3、修改环境变量:vi/etc/profile   到文件最低部添加:     exportJA......
  • Linux 安装 Flink
    文档:https://ifeve.com/flink-quick-start/下载地址:https://flink.apache.org/downloads.html下载:https://dlcdn.apache.org/flink/flink-1.15.1/flink-1.15.1-bin-scal......
  • Docker安装和基本原理及镜像管理
    一、Docker概述1.1IT架构的演进:裸金属→虚拟机→容器→函数化、代码化   云计算涌现出很多改变传统IT架构和运维方式的新技术,比如虚拟机、容器、微服务......
  • jmeter安装
    jmeter下载地址(注意jdk版本要1.8+)https://jmeter.apache.org/download_jmeter.cgijmeter添加环境变量系统环境变量中添加JMETER_HOME在path中添加D:\soft\jmete......