Docker Compose V2 安装 ClickHouse v20.6.8.5 经验分享

news2024/9/23 13:24:33

前言

ClickHouse 是一款开源的分布式列式数据库管理系统,专门设计用于高性能的大数据分析和查询。
目前项目中用到的一个场景是将mongo的数据同步到clickhouse,使用clickhouse做报表,后续也将分享同步和使用方案

  • 使用 Docker Compose 部署单机版,小项目和自己测试够用了,生产使用集群,基于此方案后续有需要我再尝试整理

安装

  • 安装目录:/app/clickhouse
  • 镜像:yandex/clickhouse-server:20.6.8.5
  • 版本: v20.6.8.5
  • 配置文件文档:配置文件
  • 端口说明:Network ports ,单机部署可以就暴露 8123(连接),9363(prometheus );ps:如果使用 Archery v1.10 连接需要使用 9000 端口

获取默认配置文件

默认配置文件: config.xml, users.xml

  1. 从容器内拷贝配置文件到容器外部主机
    (创建 work 目录,进入运行的 clickhouse 容器后会将默认的配置文件(config.xml, users.xml)复制到 work 目录)
    • 创建容器获取容器内的默认配置文件
      mkdir ./work
      docker run -it --rm --entrypoint=/bin/bash -v ./work:/work --privileged=true --user=root yandex/clickhouse-server:20.6.8.5
      进入容器后复制配置到work文件夹
      cp -r /etc/clickhouse-server/* /work
      exit
      
  2. ./work/config.xml
    • <?xml version="1.0"?>
      <!--
        NOTE: User and query level settings are set up in "users.xml" file.
        If you have accidentially specified user-level settings here, server won't start.
        You can either move the settings to the right place inside "users.xml" file
         or add <skip_check_for_incorrect_settings>1</skip_check_for_incorrect_settings> here.
      -->
      <yandex>
          <logger>
              <!-- Possible levels: https://github.com/pocoproject/poco/blob/poco-1.9.4-release/Foundation/include/Poco/Logger.h#L105 -->
              <level>trace</level>
              <log>/var/log/clickhouse-server/clickhouse-server.log</log>
              <errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
              <size>1000M</size>
              <count>10</count>
              <!-- <console>1</console> --> <!-- Default behavior is autodetection (log to console if not daemon mode and is tty) -->
      
              <!-- Per level overrides (legacy):
      
              For example to suppress logging of the ConfigReloader you can use:
              NOTE: levels.logger is reserved, see below.
              -->
              <!--
              <levels>
                <ConfigReloader>none</ConfigReloader>
              </levels>
              -->
      
              <!-- Per level overrides:
      
              For example to suppress logging of the RBAC for default user you can use:
              (But please note that the logger name maybe changed from version to version, even after minor upgrade)
              -->
              <!--
              <levels>
                <logger>
                  <name>ContextAccess (default)</name>
                  <level>none</level>
                </logger>
                <logger>
                  <name>DatabaseOrdinary (test)</name>
                  <level>none</level>
                </logger>
              </levels>
              -->
          </logger>
      
          <send_crash_reports>
              <!-- Changing <enabled> to true allows sending crash reports to -->
              <!-- the ClickHouse core developers team via Sentry https://sentry.io -->
              <!-- Doing so at least in pre-production environments is highly appreciated -->
              <enabled>false</enabled>
              <!-- Change <anonymize> to true if you don't feel comfortable attaching the server hostname to the crash report -->
              <anonymize>false</anonymize>
              <!-- Default endpoint should be changed to different Sentry DSN only if you have -->
              <!-- some in-house engineers or hired consultants who're going to debug ClickHouse issues for you -->
              <endpoint>https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277</endpoint>
          </send_crash_reports>
      
          <!--display_name>production</display_name--> <!-- It is the name that will be shown in the client -->
          <http_port>8123</http_port>
          <tcp_port>9000</tcp_port>
          <mysql_port>9004</mysql_port>
          <!-- For HTTPS and SSL over native protocol. -->
          <!--
          <https_port>8443</https_port>
          <tcp_port_secure>9440</tcp_port_secure>
          -->
          <!-- Used with https_port and tcp_port_secure. Full ssl options list: https://github.com/ClickHouse-Extras/poco/blob/master/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h#L71 -->
          <openSSL>
              <server> <!-- Used for https server AND secure tcp port -->
                  <!-- openssl req -subj "/CN=localhost" -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /etc/clickhouse-server/server.key -out /etc/clickhouse-server/server.crt -->
                  <certificateFile>/etc/clickhouse-server/server.crt</certificateFile>
                  <privateKeyFile>/etc/clickhouse-server/server.key</privateKeyFile>
                  <!-- openssl dhparam -out /etc/clickhouse-server/dhparam.pem 4096 -->
                  <dhParamsFile>/etc/clickhouse-server/dhparam.pem</dhParamsFile>
                  <verificationMode>none</verificationMode>
                  <loadDefaultCAFile>true</loadDefaultCAFile>
                  <cacheSessions>true</cacheSessions>
                  <disableProtocols>sslv2,sslv3</disableProtocols>
                  <preferServerCiphers>true</preferServerCiphers>
              </server>
      
              <client> <!-- Used for connecting to https dictionary source and secured Zookeeper communication -->
                  <loadDefaultCAFile>true</loadDefaultCAFile>
                  <cacheSessions>true</cacheSessions>
                  <disableProtocols>sslv2,sslv3</disableProtocols>
                  <preferServerCiphers>true</preferServerCiphers>
                  <!-- Use for self-signed: <verificationMode>none</verificationMode> -->
                  <invalidCertificateHandler>
                      <!-- Use for self-signed: <name>AcceptCertificateHandler</name> -->
                      <name>RejectCertificateHandler</name>
                  </invalidCertificateHandler>
              </client>
          </openSSL>
      
          <!-- Default root page on http[s] server. For example load UI from https://tabix.io/ when opening http://localhost:8123 -->
          <!--
          <http_server_default_response><![CDATA[<html ng-app="SMI2"><head><base href="http://ui.tabix.io/"></head><body><div ui-view="" class="content-ui"></div><script src="http://loader.tabix.io/master.js"></script></body></html>]]></http_server_default_response>
          -->
      
          <!-- Port for communication between replicas. Used for data exchange. -->
          <interserver_http_port>9009</interserver_http_port>
      
          <!-- Hostname that is used by other replicas to request this server.
               If not specified, than it is determined analoguous to 'hostname -f' command.
               This setting could be used to switch replication to another network interface.
            -->
          <!--
          <interserver_http_host>example.yandex.ru</interserver_http_host>
          -->
      
          <!-- Listen specified host. use :: (wildcard IPv6 address), if you want to accept connections both with IPv4 and IPv6 from everywhere. -->
          <!-- <listen_host>::</listen_host> -->
          <!-- Same for hosts with disabled ipv6: -->
          <!-- <listen_host>0.0.0.0</listen_host> -->
      
          <!-- Default values - try listen localhost on ipv4 and ipv6: -->
          <!--
          <listen_host>::1</listen_host>
          <listen_host>127.0.0.1</listen_host>
          -->
          <!-- Don't exit if ipv6 or ipv4 unavailable, but listen_host with this protocol specified -->
          <!-- <listen_try>0</listen_try> -->
      
          <!-- Allow listen on same address:port -->
          <!-- <listen_reuse_port>0</listen_reuse_port> -->
      
          <!-- <listen_backlog>64</listen_backlog> -->
      
          <max_connections>4096</max_connections>
          <keep_alive_timeout>3</keep_alive_timeout>
      
          <!-- Maximum number of concurrent queries. -->
          <max_concurrent_queries>100</max_concurrent_queries>
      
          <!-- Maximum memory usage (resident set size) for server process.
               Zero value or unset means default. Default is "max_server_memory_usage_to_ram_ratio" of available physical RAM.
               If the value is larger than "max_server_memory_usage_to_ram_ratio" of available physical RAM, it will be cut down.
      
               The constraint is checked on query execution time.
               If a query tries to allocate memory and the current memory usage plus allocation is greater
                than specified threshold, exception will be thrown.
      
               It is not practical to set this constraint to small values like just a few gigabytes,
                because memory allocator will keep

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1946542.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【C#】visual studio打包winForm(依赖DLL)为安装程序exe

0.简介 IDE&#xff1a;VS2022 平台&#xff1a;C# .NetFramework4.7 WinForm界面 有GDAL、EEplus库的依赖&#xff0c;所以在其他未安装环境的电脑中功能无法使用。 1. 安装 1.1 运行文件 在VS扩展中选择管理扩展&#xff0c;Microsoft Visual Studio Installer Projects …

C#测试控制台程序调用Quartz.NET的基本用法

Quartz.Net是常用的任务调用框架之一&#xff0c;既能在客户端程序中使用&#xff0c;也支持在网页程序后台调用。本文结合参考文献4中的示例代码学习其在控制台程序中的基本用法。   VS2022新建控制台项目&#xff0c;在Nuget包管理器中搜索并安装Quartz包&#xff0c;如下所…

51单片机嵌入式开发:18、STC89C52RC嵌入式DS1302实时时钟实验及数码管显示

STC89C52RC嵌入式DS1302实时时钟实验及数码管显示 STC89C52RC嵌入式DS1302实时时钟实验及数码管显示1 概述1.1 DS1302简介1.2 DS1302功能和特点1.3 DS1302工作原理1.4 DS1302应用领域 2 DS1302设计原理2.1 引脚说明2.2 寄存器说明及使用&#xff08;1&#xff09;命令cmd字节说…

Redis的缓存问题:缓存穿透、缓存击穿和缓存雪崩

目录 一、缓存穿透 1、问题描述 2、解决方案 二、缓存击穿 1、问题描述 2、解决方案 三、缓存雪崩 1、问题描述 2、解决方案 3、雪崩案例 一、缓存穿透 1、问题描述 缓存穿透指的是⼤量请求的 key根本不存在于缓存中&#xff0c;每次针对此key的请求从缓存获取不到…

报红:找不到名称ref ts(2304)、‘ref‘ is not defined. eslint(no-undef)

接上篇 在上篇介绍了使用 unplugin-auto-import 和 unplugin-vue-components 配置完成后&#xff0c;项目可以正常运行&#xff0c;并且页面也正常显示&#xff0c;但vscode里就是报红 这个报红可能是由于 ts 发出的&#xff0c;也可能是由于 eslint 发出的 具体可以用鼠标…

如何使用 API list 极狐GitLab 群组中的镜像仓库?

GitLab 是一个全球知名的一体化 DevOps 平台&#xff0c;很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab &#xff1a;https://gitlab.cn/install?channelcontent&utm_sourcecsdn 是 GitLab 在中国的发行版&#xff0c;专门为中国程序员服务。可以一键式部署…

某数据泄露防护(DLP)系统NetSecConfigAjax接口SQL注入漏洞复现 [附POC]

文章目录 某数据泄露防护(DLP)系统NetSecConfigAjax接口SQL注入漏洞复现 [附POC]0x01 前言0x02 漏洞描述0x03 影响版本0x04 漏洞环境0x05 漏洞复现1.访问漏洞环境2.构造POC3.复现某数据泄露防护(DLP)系统NetSecConfigAjax接口SQL注入漏洞复现 [附POC] 0x01 前言 免责声明:请…

云计算实训13——DNS域名解析、ntp时间服务器配置、主从DNS配置、多区域DNS搭建

一、DNS域名解析 1.正向解析 将域名解析为IP地址 DNS正向解析核心配置 (1)安装bind [rootdns ~]# yum -y install bind (2)编辑配置文件 编辑named.conf文件&#xff0c;限定访问权限 [rootdns ~]# vim /etc/named.conf 编辑named.rfc文件&#xff0c;指定要访问的域名 [ro…

大语言模型推理优化--键值缓存--Key-value Cache

文章目录 一、生成式预训练语言模型 GPT 模型结构二、FastServe 框架三、Key-value Cache1.大模型推理的冗余计算2.Self Attention3.KV Cache 一、生成式预训练语言模型 GPT 模型结构 目前&#xff0c;深度神经网络推理服务系统已经有一些工作针对生成式预训练语言模型 GPT 的独…

【Gin】架构的精妙编织:Gin框架中组合模式的革新实践与技术深度解析(上)

【Gin】架构的精妙编织&#xff1a;Gin框架中组合模式的革新实践与技术深度解析(上) 大家好 我是寸铁&#x1f44a; 【Gin】架构的精妙编织&#xff1a;Gin框架中组合模式的革新实践与技术深度解析(上)✨ 喜欢的小伙伴可以点点关注 &#x1f49d; 前言 本次文章分为上下两部分…

QT--线程

一、线程QThread QThread 类提供不依赖平台的管理线程的方法&#xff0c;如果要设计多线程程序&#xff0c;一般是从 QThread继承定义一个线程类&#xff0c;在自定义线程类里进行任务处理。qt拥有一个GUI线程,该线程阻塞式监控窗体,来自任何用户的操作都会被gui捕获到,并处理…

Umi-OCR:功能强大且易于使用的本地照片识别软件

Umi-OCR是一款开源且免费的离线OCR&#xff08;光学字符识别&#xff09;软件&#xff0c;可让您轻松从照片中提取文本。它支持多种语言&#xff0c;并具有许多其他功能使其成为照片识别任务的绝佳选择。 Umi-OCR的优势 离线操作&#xff1a; Umi-OCR无需互联网连接即可工作&…

Python实现websocket连接服务器报rejected WebSocket connection: HTTP 401

1. websockets报HTTP 401解决办法 代码如下&#xff1a; #!/usr/bin/env python import asyncio import websockets import requestsuri ws://192.168.20.167/websocket msg {"type":6,"param":{"businessType":3,"cmd":1,"f…

mysql 数据库空间统计sql

mysql 数据库空间统计 文章目录 mysql 数据库空间统计说明一、数据库存储代码二、查询某个数据库的所有表的 代码总结 说明 INFORMATION_SCHEMA Table Reference 表参考 information_schema是‌MySQL中的一个特殊数据库&#xff0c;它存储了关于所有其他数据库的元数据信息。…

20240724-然后用idea创建一个Java项目/配置maven环境/本地仓储配置

1.创建一个java项目 &#xff08;1&#xff09;点击页面的create project&#xff0c;然后next &#xff08;2&#xff09;不勾选&#xff0c;继续next &#xff08;3&#xff09;选择新项目名称&#xff0c;新项目路径&#xff0c;然后Finsh&#xff0c;在新打开的页面选择…

无人机上磁航技术详解

磁航技术&#xff0c;也被称为地磁导航&#xff0c;是一种利用地球磁场信息来实现导航的技术。在无人机领域&#xff0c;磁航技术主要用于辅助惯性导航系统&#xff08;INS&#xff09;进行航向角的测量与校正&#xff0c;提高无人机的飞行稳定性和准确性。其技术原理是&#x…

康谋分享 | 自动驾驶联合仿真——功能模型接口FMI(四)

在上一篇文章 “康谋分享 | 自动驾驶联合仿真——功能模型接口FMI&#xff08;三&#xff09;”&#xff0c;我们讲述了在构建FMU中&#xff0c;如何通过fmi_simple_car.cpp来实现FMI2.0&#xff0c;即如何实现一个简单的车辆模型来进行车辆动力学仿真。今天康谋接着展示如何通…

MFC与QT中禁用Esc、Alt+F4、关闭图标

在业务中&#xff0c;我们需要按指定的方式才能关闭当前对话框。如下图需输入密码点击确认后&#xff0c;界面才能关闭。 1.禁用关闭按钮 在对话框初始化部分添加将关闭按钮禁用 //MFC CMenu *pSysMenu GetSystemMenu(FALSE); ASSERT(pSysMenu ! NULL); pSysMenu->EnableM…

Visual Studio Code + vue快速安装配置Node.js+Vue+webpack+vscode

第一部分&#xff1a;Node.js 第一步&#xff1a;下载Node.js 方法1&#xff1a;链接 下载 | Node.js 中文网 (nodejs.cn) 方法2&#xff1a;百度网盘 链接&#xff1a;https://pan.baidu.com/s/1zIqu8H9rb_I1i-1OWD7swQ?pwdaurk 提取码&#xff1a;aurk --来自百度网盘…

spring MVC 简单案例(3)留言板

一、留言板 1&#xff09;前端代码 messagewall.html <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title…