[转帖]ck的离线安装

ck,离线,安装 · 浏览次数 : 0

小编点评

## ClickHouse Installation Instructions This guide provides instructions for manually installing ClickHouse on your system. **1. Download the ClickHouse Binary** * Download the latest stable version of ClickHouse binary from the official website: `repo.clickhouse.tech/tgz/stable/下载的包:clickhouse-common-staticclickhouse-serverclickhouse-client单机安装tar -zxvf clickhouse-common-static-20.5.4.40.tgz` **2. Install ClickHouse** * Extract the downloaded binary to a suitable location on your system. * Make the extracted folder accessible for the user running the ClickHouse service. * Set appropriate permissions using `chmod` command. * Run the installation script `sudo doinst.sh` according to the on-screen instructions. * Follow the on-screen instructions to configure and start the ClickHouse server. **3. Verify the Installation** * Check the server status by running `ps -a | grep clickhouse`. * Access the ClickHouse web interface at `localhost:8080`. * Login using the default username and password (usually `root/root`). * You should see a welcome message and the version of ClickHouse. **4. Start the ClickHouse Service** * Run `sudo systemctl start clickhouse-server`. * Alternatively, you can start the service using `sudo systemctl enable clickhouse-server`. **5. Access the ClickHouse Web Interface** * Open your web browser and navigate to `localhost:8080`. * Enter the default username and password (usually `root/root`). * You will be taken to the ClickHouse web interface. **6. First Startup Configuration** * Click on "System" and then "First Start Wizard". * Follow the on-screen instructions to configure initial settings such as time zone, data directory, and logging options. * After the wizard, restart the server. **7. Additional Configuration** * You can configure additional settings and options in the "System" section of the web interface. * You can also connect to the server using SSH or other remote access tools. **Additional Notes** * Remember to replace `20.5.4.40` with the actual version you downloaded. * This guide provides basic installation instructions. For more advanced configurations, refer to the official ClickHouse documentation. * You can find detailed installation logs in `/var/log/clickhouse/clickhouse-server.log`.

正文

下载

下载地址: https://repo.clickhouse.tech/tgz/stable/

下载的包:

clickhouse-common-static

clickhouse-server

clickhouse-client

单机安装

tar -zxvf clickhouse-common-static-20.5.4.40.tgz cd clickhouse-common-static-20.5.4.40/install sudo doinst.sh tar -zxvf clickhouse-common-static-dbg-20.5.4.40.tgz cd clickhouse-common-static-dbg-20.5.4.40/install sudo doinst.sh tar -zxvf clickhouse-server-20.5.4.40.tgz cd clickhouse-server-20.5.4.40/install sudo doinst.sh tar -zxvf clickhouse-client-20.5.4.40.tgz cd clickhouse-client-20.5.4.40/install sudo doinst.sh

设置

内存限制设置

vi /etc/clickhouse-server/users.xml

<max_memory_usage></max_memory_usage> 单位:bytes

设置数据目录

vi /etc/clickhouse-server/config.xml

<path></data> 数据存储目录 <tmp_path><tmp_path> 临时缓存目录

启动服务

手动启动

clickhouse-server --config-file=/etc/clickhouse-server/config.xml

server启动

sudo service clickhouse-server start sudo service clickhouse-server status sudo service clickhouse-server stop sudo service clickhouse-server restart

systemctl启动

sudo systemctl start clickhouse-server sudo systemctl status clickhouse-server sudo systemctl stop clickhouse-server sudo systemctl restart clickhouse-server sudo systemctl enable clickhouse-server

查看服务是否启动

ps -aux | grep clickhouse

连接

用clickhouse-client连接本机clickhouse-server服务器:

clickhouse-client

用本机clickhouse-client连接远程clickhouse-server服务器:

clickhouse-client –host 192.168.3.54 –port 9000 –database default–user default –password “”

目录

  • /etc/clickhouse-server:服务端的配置文件目录,包括全局配置config.xml和用户配置users.xml等
  • /var/lib/clickhouse:默认的数据存储目录(通常会修改默认路径配置,将数据保存到大容量磁盘挂载的路径)
  • /var/log/clickhouse:默认保存日志的目录(最好也修改路径配置,将日志保存到大容量磁盘挂载的路径

集群安装

配置

3zk-2shards-2replicas)

<?xml version="1.0" encoding="utf-8"?> <yandex> <clickhouse_remote_servers> <default> <shard> <internal_replication>true</internal_replication> <replica> <host>172.17.0.8</host> <port>9000</port> </replica> <replica> <host>172.17.0.7</host> <port>9000</port> </replica> </shard> <shard> <internal_replication>true</internal_replication> <replica> <host>172.17.0.6</host> <port>9000</port> </replica> <replica> <host>172.17.0.5</host> <port>9000</port> </replica> </shard> </default> </clickhouse_remote_servers> <zookeeper-servers> <node index="1"> <host>172.17.0.4</host> <port>2181</port> </node> <node index="2"> <host>172.17.0.3</host> <port>2181</port> </node> <node index="3"> <host>172.17.0.2</host> <port>2181</port> </node> </zookeeper-servers> <listen_host>::</listen_host> <listen_host>0.0.0.0</listen_host> <listen_try>1</listen_try> <macros> <shard>1</shard> <replica>172.17.0.8</replica> </macros> </yandex>

zk目录说明

clickhouse └── tables ├── 1 │ ├── log_test │ │ ├── metadata #log_test表的元数据信息 │ │ ├── temp #临时节点,存储过程中的临时数据 │ │ └── mutations #表的变更信息,ClickHouse为区别标准SQL特定的一个名词 │ ├── log #写block时记录的log │ │ ├── log-0000000003 │ │ ├── log-0000000001 │ │ └── log-0000000002 │ ├── leader_election #副本选举leader时使用 │ │ ├── leader_election-0000000001 │ │ └── leader_election-0000000003 │ ├── colums #列信息 │ ├── blocks #和log是对应的,用于block去重 │ │ ├── 201908_12150410223201606212_2366670524718677664 │ │ ├── 201908_15367370223201604745_5325320524718463637 │ │ └── 201907_34543779872932958925_1436457470273464774 │ ├── nonincrement_block_numbers │ ├── replicas #存储各个副本的相关信息 │ │ └── 10.0.0.71 │ │ ├── is_lost #标记副本是否过时 │ │ ├── metadata #log_test表的元数据信息 │ │ ├── is_active #标记副本是否存活 │ │ ├── mutation_pointer │ │ ├── colums #列信息 │ │ ├── max_processed_insert_time │ │ ├── host #主机名或域名 │ │ ├── parts #存储数据所有的parts │ │ │ └── 201908_0_0_0 │ │ │ ├── checksums │ │ │ └── colums │ │ ├── flags #用于数据恢复 │ │ ├── log_pointer #log指针 │ │ ├── min_unprocessed_insert_time │ │ └── queue #临时处理队列 │ ├── quorum #与是否配置insert_quorum有关 │ │ ├── last_part │ │ └── failed_parts │ └── block_number #存储所有的分区值,会根据merge实时更新 │ └── 201908 └─ 2

与[转帖]ck的离线安装相似的内容:

[转帖]ck的离线安装

下载 下载地址: https://repo.clickhouse.tech/tgz/stable/ 下载的包: clickhouse-common-static clickhouse-server clickhouse-client 单机安装 tar -zxvf clickhouse-common-

[转帖]精通awk系列(19):awk流程控制之break、continue、next、nextfile、exit语句

https://www.cnblogs.com/f-ck-need-u/ 回到: Linux系列文章 Shell系列文章 Awk系列文章 break和continue break可退出for、while、do...while、switch语句。 continue可让for、while、do...wh

[转帖]

Linux ubuntu20.04 网络配置(图文教程) 因为我是刚装好的最小系统,所以很多东西都没有,在开始配置之前需要做下准备 环境准备 系统:ubuntu20.04网卡:双网卡 网卡一:供连接互联网使用网卡二:供连接内网使用(看情况,如果一张网卡足够,没必要做第二张网卡) 工具: net-to

[转帖]

https://cloud.tencent.com/developer/article/2168105?areaSource=104001.13&traceId=zcVNsKTUApF9rNJSkcCbB 前言 Redis作为高性能的内存数据库,在大数据量的情况下也会遇到性能瓶颈,日常开发中只有时刻

[转帖]ISV 、OSV、 SIG 概念

ISV 、OSV、 SIG 概念 2022-10-14 12:29530原创大杂烩 本文链接:https://www.cndba.cn/dave/article/108699 1. ISV: Independent Software Vendors “独立软件开发商”,特指专门从事软件的开发、生产、

[转帖]Redis 7 参数 修改 说明

2022-06-16 14:491800原创Redis 本文链接:https://www.cndba.cn/dave/article/108066 在之前的博客我们介绍了Redis 7 的安装和配置,如下: Linux 7.8 平台 Redis 7 安装并配置开机自启动 操作手册https://ww

[转帖]HTTPS中间人攻击原理

https://www.zhihu.com/people/bei-ji-85/posts 背景 前一段时间,公司北京地区上线了一个HTTPS防火墙,用来监听HTTPS流量。防火墙上线之前,邮件通知给管理层,我从我老大那里听说这个事情的时候,说这个有风险,然后意外地发现,很多人原来都不知道HTTPS防

[转帖]关于字节序(大小端)的一点想法

https://www.zhihu.com/people/bei-ji-85/posts 今天在一个技术群里有人问起来了,当时有一些讨论(不完全都是我个人的观点),整理一下: 为什么网络字节序(多数情况下)是大端? 早年设备的缓存很小,先接收高字节能快速的判断报文信息:包长度(需要准备多大缓存)、地

[转帖]awk提取某一行某一列的数据

https://www.jianshu.com/p/dbcb7fe2da56 1、提取文件中第1列数据 awk '{print $1}' filename > out.txt 2、提取前2列的文件 awk `{print $1,$2}' filename > out.txt 3、打印完第一列,然后打

[转帖]awk 中 FS的用法

https://www.cnblogs.com/rohens-hbg/p/5510890.html 在openwrt文件 ar71xx.sh中 查询设备类型时,有这么一句, machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /