centos7 docker安装clickhouse

1. 下载clickhouse镜像

        clickhouse-server docker hub镜像地址clickhouse/clickhouse-server - Docker Image | Docker Hub

docker pull clickhouse/clickhouse-server

直接下载镜像非常慢,换用docker hub国内镜像源

[root@localhost yum.repos.d]# cat /etc/docker/daemon.json 
{
    "registry-mirrors": [
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn"
    ]
}

2. 创建并启动clickhouse容器

docker run -d --privileged -p 18123:8123 -p19000:9000 --name clickhouse --ulimit nofile=262144:262144 clickhouse/clickhouse-server

3. 测试

[root@cdh1 ~]# echo 'SELECT version()' | curl 'http://localhost:18123/' --data-binary @-
23.5.3.24

        启动成功

4. 安装遇到的问题

一开始安装使用的docker run命令没有加--privileged,容器启动会报如下错误,加上--privileged后正常启动

[root@cdh1 ~]# docker logs clickhouse
stat: cannot statx '/var/lib/clickhouse/': Operation not permitted
stat: cannot statx '/var/log/clickhouse-server': Operation not permitted
stat: cannot statx '/var/log/clickhouse-server': Operation not permitted
stat: cannot statx '/var/lib/clickhouse/tmp/': Operation not permitted
stat: cannot statx '/var/lib/clickhouse/user_files/': Operation not permitted
stat: cannot statx '/var/lib/clickhouse/format_schemas/': Operation not permitted
ls: cannot access '/docker-entrypoint-initdb.d/': Operation not permitted
Processing configuration file '/etc/clickhouse-server/config.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/docker_related_config.xml'.
Logging trace to /var/log/clickhouse-server/clickhouse-server.log
Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
Cannot add message to the log: Sending crash reports is disabled
Poco::Exception. Code: 1000, e.code() = 0, Exception: Could not determine time zone from TZ variable value: 'Asia/Shanghai': filesystem error: in canonical: Operation not permitted ["/usr/share/zoneinfo/"] [""], Stack trace (when copying this message, always include the lines below):

0. DateLUT::DateLUT() @ 0x000000000e333ab8 in /usr/bin/clickhouse
1. OwnPatternFormatter::formatExtended(DB::ExtendedLogMessage const&, String&) const @ 0x000000000e5d35f2 in /usr/bin/clickhouse
2. DB::OwnFormattingChannel::logExtended(DB::ExtendedLogMessage const&) @ 0x000000000e5cf573 in /usr/bin/clickhouse
3. DB::OwnSplitChannel::logSplit(Poco::Message const&) @ 0x000000000e5d4259 in /usr/bin/clickhouse
4. DB::OwnSplitChannel::tryLogSplit(Poco::Message const&) @ 0x000000000e5d40a4 in /usr/bin/clickhouse
5. DB::OwnSplitChannel::log(Poco::Message const&) @ 0x000000000e5d3dd5 in /usr/bin/clickhouse
6. SentryWriter::initialize(Poco::Util::LayeredConfiguration&) @ 0x000000000e5c695e in /usr/bin/clickhouse
7. BaseDaemon::initializeTerminationAndSignalProcessing() @ 0x000000000e5bc71b in /usr/bin/clickhouse
8. BaseDaemon::initialize(Poco::Util::Application&) @ 0x000000000e5b94d4 in /usr/bin/clickhouse
9. DB::Server::initialize(Poco::Util::Application&) @ 0x000000000e3cf723 in /usr/bin/clickhouse
10. Poco::Util::Application::run() @ 0x0000000017c4557a in /usr/bin/clickhouse
11. DB::Server::run() @ 0x000000000e3cf57e in /usr/bin/clickhouse
12. Poco::Util::ServerApplication::run(int, char**) @ 0x0000000017c58cb9 in /usr/bin/clickhouse
13. mainEntryClickHouseServer(int, char**) @ 0x000000000e3cc546 in /usr/bin/clickhouse
14. main @ 0x00000000087fb92f in /usr/bin/clickhouse
15. ? @ 0x00007f21a6483d90 in ?
16. __libc_start_main @ 0x00007f21a6483e40 in ?
17. _start @ 0x0000000007f281ee in /usr/bin/clickhouse
 (version 23.5.3.24 (official build))
Cannot add message to the log: Pipe capacity is 1.00 MiB
Poco::Exception. Code: 1000, e.code() = 0, Exception: Could not determine time zone from TZ variable value: 'Asia/Shanghai': filesystem error: in canonical: Operation not permitted ["/usr/share/zoneinfo/"] [""], Stack trace (when copying this message, always include the lines below):

0. DateLUT::DateLUT() @ 0x000000000e333ab8 in /usr/bin/clickhouse
1. OwnPatternFormatter::formatExtended(DB::ExtendedLogMessage const&, String&) const @ 0x000000000e5d35f2 in /usr/bin/clickhouse
2. DB::OwnFormattingChannel::logExtended(DB::ExtendedLogMessage const&) @ 0x000000000e5cf573 in /usr/bin/clickhouse
3. DB::OwnSplitChannel::logSplit(Poco::Message const&) @ 0x000000000e5d4259 in /usr/bin/clickhouse
4. DB::OwnSplitChannel::tryLogSplit(Poco::Message const&) @ 0x000000000e5d40a4 in /usr/bin/clickhouse
5. DB::OwnSplitChannel::log(Poco::Message const&) @ 0x000000000e5d3dd5 in /usr/bin/clickhouse
6. DB::LazyPipeFDs::tryIncreaseSize(int) @ 0x000000000e38707f in /usr/bin/clickhouse
7. BaseDaemon::initializeTerminationAndSignalProcessing() @ 0x000000000e5bc8b4 in /usr/bin/clickhouse
8. BaseDaemon::initialize(Poco::Util::Application&) @ 0x000000000e5b94d4 in /usr/bin/clickhouse
9. DB::Server::initialize(Poco::Util::Application&) @ 0x000000000e3cf723 in /usr/bin/clickhouse
10. Poco::Util::Application::run() @ 0x0000000017c4557a in /usr/bin/clickhouse
11. DB::Server::run() @ 0x000000000e3cf57e in /usr/bin/clickhouse
12. Poco::Util::ServerApplication::run(int, char**) @ 0x0000000017c58cb9 in /usr/bin/clickhouse
13. mainEntryClickHouseServer(int, char**) @ 0x000000000e3cc546 in /usr/bin/clickhouse
14. main @ 0x00000000087fb92f in /usr/bin/clickhouse
15. ? @ 0x00007f21a6483d90 in ?
16. __libc_start_main @ 0x00007f21a6483e40 in ?
17. _start @ 0x0000000007f281ee in /usr/bin/clickhouse
 (version 23.5.3.24 (official build))
Poco::Exception. Code: 1000, e.code() = 0, System exception: cannot start thread, Stack trace (when copying this message, always include the lines below):

0. Poco::ThreadImpl::startImpl(Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Runnable>>) @ 0x0000000017dab56e in /usr/bin/clickhouse
1. Poco::Thread::start(Poco::Runnable&) @ 0x0000000017dac4cb in /usr/bin/clickhouse
2. BaseDaemon::initializeTerminationAndSignalProcessing() @ 0x000000000e5bc964 in /usr/bin/clickhouse
3. BaseDaemon::initialize(Poco::Util::Application&) @ 0x000000000e5b94d4 in /usr/bin/clickhouse
4. DB::Server::initialize(Poco::Util::Application&) @ 0x000000000e3cf723 in /usr/bin/clickhouse
5. Poco::Util::Application::run() @ 0x0000000017c4557a in /usr/bin/clickhouse
6. DB::Server::run() @ 0x000000000e3cf57e in /usr/bin/clickhouse
7. Poco::Util::ServerApplication::run(int, char**) @ 0x0000000017c58cb9 in /usr/bin/clickhouse
8. mainEntryClickHouseServer(int, char**) @ 0x000000000e3cc546 in /usr/bin/clickhouse
9. main @ 0x00000000087fb92f in /usr/bin/clickhouse
10. ? @ 0x00007f21a6483d90 in ?
11. __libc_start_main @ 0x00007f21a6483e40 in ?
12. _start @ 0x0000000007f281ee in /usr/bin/clickhouse
 (version 23.5.3.24 (official build))

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值