docker安装clickhouse_docker 安装clickhouse 20.3

下载并启动 clickhouse 20.3

docker run -d --name clickhouse- --ulimit nofile=262144:262144 -p 9007:8123 -p 9008:9000 -p 9009:9009 yandex/clickhouse-server

docker run -d --name gxhh-clickhouse202010 --ulimit nofile=262144:262144 -p 9007:8123 -p 9008:9000 -p 9009:9009

-v /etc:/epdata0828/docker/data yandex/clickhouse-server

启动失败

解决办法:vi /etc/selinux/config

将 SELINUX 属性改为 disabled,然后保存重启(reboot)服务器即可,然后启动容器就好

把clickhouse 的4个 rpm 上传到 已创建好的docker 容器里,然后执行如下几个命令 ,docker的安装就完成了

[root@1f36a5634d9c soft]# ls

CLICKHOUSE-KEY.GPG clickhouse-common-static-dbg-20.3.8.53-2.x86_64.rpm

clickhouse-client-20.3.8.53-2.noarch.rpm clickhouse-server-20.3.8.53-2.noarch.rpm

clickhouse-common-static-20.3.8.53-2.x86_64.rpm clickhouse-test-20.3.8.53-2.noarch.rpm

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]# rpm --import /root/CLICKHOUSE-KEY.GPG

error: /root/CLICKHOUSE-KEY.GPG: import read failed(2).

[root@1f36a5634d9c soft]# rpm --import CLICKHOUSE-KEY.GPG

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]# rpm -ivh clickhouse-common-static-20.3.8.53-2.x86_64.rpm

Verifying... ################################# [100%]

Preparing... ################################# [100%]

Updating / installing...

1:clickhouse-common-static-20.3.8.5################################# [100%]

[root@1f36a5634d9c soft]# rpm -ivh clickhouse-server-20.3.8.53-2.noarch.rpm

Verifying... ################################# [100%]

Preparing... ################################# [100%]

Updating / installing...

1:clickhouse-server-20.3.8.53-2 ################################# [100%]

Synchronizing state of clickhouse-server.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.

Executing: /usr/lib/systemd/systemd-sysv-install enable clickhouse-server

Created symlink /etc/systemd/system/multi-user.target.wants/clickhouse-server.service → /etc/systemd/system/clickhouse-server.service.

Path to data directory in /etc/clickhouse-server/config.xml: /var/lib/clickhouse/

[root@1f36a5634d9c soft]# rpm -ivh clickhouse-common-static-dbg-20.3.8.53-2.x86_64.rpm

Verifying... ################################# [100%]

Preparing... ################################# [100%]

Updating / installing...

1:clickhouse-common-static-dbg-20.3################################# [100%]

[root@1f36a5634d9c soft]# rpm -ivh clickhouse-client-20.3.8.53-2.noarch.rpm

Verifying... ################################# [100%]

Preparing... ################################# [100%]

Updating / installing...

1:clickhouse-client-20.3.8.53-2 ################################# [100%]

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]#

[root@1f36a5634d9c soft]# rpm -ivh clickhouse-client-20.3.8.53-2.noarch.rpm

Verifying... ################################# [100%]

Preparing... ################################# [100%]

package clickhouse-client-20.3.8.53-2.noarch is already installed

[root@1f36a5634d9c soft]# service clickhouse-server start

Start clickhouse-server service: Path to data directory in /etc/clickhouse-server/config.xml: /var/lib/clickhouse/

DONE

[root@1f36a5634d9c soft]# clickhouse-client

ClickHouse client version 20.3.8.53 (official build).

Connecting to localhost:9000 as user default.

Connected to ClickHouse server version 20.3.8 revision 54433.

## 挂载卷

把docker 里clickhouse的配置文件copy出来

docker cp clickhouse-:/etc/clickhouse-server/ /epdata0828/docker/data/etc/clickhouse-server/

修改 /etc/clickhouse-server/config.xml 中 65行 注释去掉::

docker exec -it clickhouse- /bin/bash

docker run -d --name gxhh-clickhouse202010-1 --privileged=true --ulimit nofile=262144:262144 -p 9016:22 -p 9017:8123 -p 9018:9000 -p 9019:9009 centos8:v1

启动失败

解决办法:vi /etc/selinux/config

将 SELINUX 属性改为 disabled,然后保存重启(reboot)服务器即可,然后启动容器就好

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值