Ubuntu 手动下载安装ClickHouse

释放双眼,带上耳机,听听看~!

安装包列表: 对应的包作用如下

  • clickhouse-common-static — ClickHouse编译的二进制文件。
  • clickhouse-server — 创建clickhouse-server软连接,并安装默认配置服务
  • clickhouse-client — 创建clickhouse-client客户端工具软连接,并安装客户端配置文件。
  • clickhouse-common-static-dbg — 带有调试信息的ClickHouse二进制文件。

如果有公网服务器,可以采用镜像源apt的方式安装

sudo apt-get install -y apt-transport-https ca-certificates dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754

echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee \
    /etc/apt/sources.list.d/clickhouse.list
sudo apt-get update

sudo apt-get install -y clickhouse-server clickhouse-client

sudo service clickhouse-server start
clickhouse-client # or "clickhouse-client --password" if you've set up a password.

下载对应依赖包

https://packages.clickhouse.com/deb/pool/stable/

wget https://packages.clickhouse.com/deb/pool/stable/clickhouse-common-static-dbg_21.3.19.1_amd64.deb
wget https://packages.clickhouse.com/deb/pool/stable/clickhouse-common-static_21.3.19.1_amd64.deb
wget https://packages.clickhouse.com/deb/pool/stable/clickhouse-server_21.3.19.1_all.deb
wget https://packages.clickhouse.com/deb/pool/stable/clickhouse-client_21.3.19.1_all.deb

安装ClickHouse

 dpkg -i clickhouse-common-static-dbg_21.3.19.1_amd64.deb 
 dpkg -i clickhouse-common-static_21.3.19.1_amd64.deb 
 dpkg -i clickhouse-server_21.3.19.1_all.deb 
 dpkg -i clickhouse-client_21.3.19.1_all.deb 

配置文件修改

修改配置文件vi /etc/clickhouse-server/config.xml

  1. 将相关的数据/日志等目录改成/data/puser/software/clickhouse
  2. 修改http端口8123
  3. 配置::

配置<include_from>/etc/clickhouse-server/metrika.xml</include_from>

配置资源限制

vi /etc/clickhouse-server/users.xml

  1. 设置最大使用内存40000000000
  2. 设置登录密码password

启动服务

service clickhouse-server start
service clickhouse-server  stop      停止
service clickhouse-server  start      启动
service clickhouse-server  restart    重启

查看服务信息

root@iZ2zeipez8ut08dv6ypru0Z:~# lsof -i:8123
COMMAND     PID       USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
clickhous 23544 clickhouse   23u  IPv4 107310      0t0  TCP *:8123 (LISTEN)

root@iZ2zeipez8ut08dv6ypru0Z:~# netstat -lntup|grep 8123
tcp        0      0 0.0.0.0:8123            0.0.0.0:*               LISTEN      23544/clickhouse-se 

本地连接测试

root@iZ2zeipez8ut08dv6ypru0Z:~# clickhouse-client --host=127.0.0.1 --password
ClickHouse client version 21.3.19.1 (official build).
Password for user (default): 
Connecting to 127.0.0.1:9000 as user default.
Connected to ClickHouse server version 21.3.19 revision 54447.

iZ2zeipez8ut08dv6ypru0Z :) show databases;

SHOW DATABASES

Query id: 573824f8-246a-4a7c-acb6-f3b3e2bb22b8

┌─name────┐
│ default │
│ system  │
└─────────┘

2 rows in set. Elapsed: 0.002 sec. 

给TA买糖
共{{data.count}}人
人已赞赏
MySQLUbuntu

Ubuntu 二进制安装mysql 5.7

2022-8-19 15:32:49

Ubuntu报错锦集

Code: 210. DB::NetException: Connection refused (localhost:9000)

2022-8-19 18:05:01

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索