一、Docker安装
1. docker-compose配置文件
version: "3" networks: rhxy-network: external: true services: clickhouse: image: clickhouse/clickhouse-server:23.12.2.59-alpine container_name: clickhouse hostname: clickhouse restart: on-failure ports: - "18123:8123" - "19000:9000" networks: - rhxy-network volumes: - /rhxy/clickhouse/data:/var/lib/clickhouse - /rhxy/clickhouse/log/:/var/log/clickhouse-server/ # - /rhxy/clickhouse/etc/:/etc/clickhouse-server/ environment: TZ: Asia/Shanghai ulimits: nofile: soft: 262144 hard: 262144
2. 端口介绍
A. 8123(HTTP)端口:用于通过HTTP协议与该数据库进行交互,支持RESTful API和HTTP查询语法,通常用在执行查询、获取数据和管理CK集群;
B. 9000(TCP)端口:用于通过TCP/IP协议与该数据库进行交互,使用自定义二进制协议进行通信,支持更高的并发性和高性能,通常用于大规模数据导入、导出和数据处理等高性能场景。
3. 数据导入
A. 本地SQL文件导入:insert into rhxy_log from infile '/var/log/clickhouse-server/rhxy_log.sql' FORMAT MySQLDump,注意DDL语句将会跳过。
标签:HTTP,log,server,ClickHouse,var,rhxy,安装,clickhouse From: https://www.cnblogs.com/ruhuanxingyun/p/17981133