【问题标题】:Data directory permissions on host for Clickhouse installation via docker on Windows在 Windows 上通过 docker 安装 Clickhouse 的主机上的数据目录权限
【发布时间】:2019-12-14 12:05:54
【问题描述】:

我有与以下链接类似的问题,但在 powershell 中,因为我在 Windows 10 中运行 clickhouse docker 容器。

Data directory permissions on host for Clickhouse installation via docker

我的设置是这样运行的:

docker run -d -p 8124:8124 --name my_database --ulimit nofile=262144:262144 --volume=E:/:/var/lib/clickhouse yandex/clickhouse-server

E 驱动器是我的 windows 计算机上的驱动器之一。

在运行合并树表创建时,我似乎无法访问 /var/lib/clickhouse/data。似乎 clickhouse 客户端没有获得足够的权限来访问此文件系统。错误如下所示:

Access to file denied: /var/lib/clickhouse/data/default/test_mergetree/tmp_insert_20150731_20150731_8_8_0

由于我在 powershell 中,我不确定如何解决这个问题。我正在尝试访问文件系统以授予 powershell 权限:

类似的东西

ICACLS "var/lib/clickhouse/data" /setowner "administrator"

但是由于 clickhouse 被 dockerized 似乎我找不到路径:

The system cannot find the path specified.

我必须运行 docker compose 吗?还是我以错误的方式处理这个问题?

尝试 1

我已尝试运行以下命令:

docker run --rm -i --entrypoint /bin/sh yandex/clickhouse-server -c id clickhouse

#got back:
uid=0(root) gid=0(root) groups=0(root)

#went into the system and ran
docker exec -it container-id bash 
chown -R 0:0 /var/lib/clickhouse

#got back
chown: cannot read directory '/var/lib/clickhouse/System Volume Information': Permission denied

【问题讨论】:

    标签: windows powershell docker clickhouse


    【解决方案1】:

    原来这是一个在 windows docker desktop 中尚未修复的问题:

    https://github.com/docker/for-win/issues/39

    卷安装是必需的。但是我通过将磁盘映像更改为目标主机驱动器来解决它。在设置 -> 高级 -> 将虚拟硬盘映像更改为您想要的驱动器,您可以在该驱动器中写入。请注意,您仍然无法访问原始数据。

    【讨论】:

      【解决方案2】:

      您应该在 Linux 而不是 Windows 中运行 docker 和 clickhouse。

      【讨论】:

        猜你喜欢
        • 2018-04-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-10-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-12-13
        相关资源
        最近更新 更多