searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

clickhosue报filesystem error: rename: Permission

2024-08-29 02:13:53
4
0

最近windows环境借助dockerdesktop一个容器目的使用clickhouse/clickhouse-server:24.7.3.42

 

创建容器命令如下

docker run -d -p 8123:8123 -p 9000:9000 -p 9009:9009 --ulimit nofile=262144:262144 -v C:\clickhouse24.7.3\db:/var/lib/clickhouse/ -v C:\clickhouse24.7.3\log:/var/log/clickhouse-server/ -v C:\clickhouse24.7.3\conf\users.xml:/etc/clickhouse-server/users.d/*.xml -v C:\clickhouse24.7.3\conf\config.xml:/etc/clickhouse-server/config.d/*.xml --name clickhouse-server-24-7-3-42  clickhouse/clickhouse-server:24.7.3.42

 

容器创建好之后进入容器执行

clickhouse-client -m --password
create database test;
use test;
CREATE TABLE demo
(
    `demo_id` String,
    `demo_name` String,
    `create_time` DateTime64(3) DEFAULT toDateTime64(now64(), 3)
)
ENGINE = ReplacingMergeTree(create_time)
PARTITION BY toYYYYMMDD(create_time)
PRIMARY KEY (create_time, demo_id)
ORDER BY (create_time, demo_id)
SETTINGS index_granularity = 8192;

insert into demo (demo_id,demo_name) values ("1","name1");

 

然后开始报错

cfb6bb886635 :) insert into demo (demo_id,demo_name) values ('1','name1');

INSERT INTO demo (demo_id, demo_name) FORMAT Values

Query id: 0bb8ef4c-3868-44ce-b486-80799342078b

↘ Progress: 1.00 rows, 24.00 B (396.97 rows/s., 9.53 KB/s.)                                                                                                                                                                                                                                                                      
1 row in set. Elapsed: 0.060 sec. 

Received exception from server (version 24.7.3):
Code: 1001. DB::Exception: Received from localhost:9000. DB::Exception: std::__1::__fs::filesystem::filesystem_error: filesystem error: in rename: Permission denied ["/var/lib/clickhouse/store/5d4/5d4d3bf8-3d1f-4b6d-ad70-87f5b996f37f/tmp_insert_20240827_1_1_0/"] ["/var/lib/clickhouse/store/5d4/5d4d3bf8-3d1f-4b6d-ad70-87f5b996f37f/20240827_1_1_0/"]. (STD_EXCEPTION)

在GitHub上有clickhouse相关的issue说明

WSL problem.
Use internal ext4 filesystem, mapped volumes C:\clickhouse\data are unable to work, because they don't support some ext4 features.

意思就是文件系统格式没有给出具体解决方案

这样就把本地挂载目录去掉重新创建一个容器进去执行相同操作,问题得到解决

 

继续搜索发现还有其他issue说明

it correctly reports "Permission denied" when the filesystem is misconfigured, e.g., the directories are in different mount points, or the filesystem does not support Unix permissions, or the filesystem reports an error for any other reason.

 

之所以这个因为挂载目录异常挂载不同目录或者不支持文件系统都有可能有报错。可以针对性提供解决方案挂载目录尽可能相同目录文件系统改成unix文件系统或者直接不使用挂载目录

0条评论
0 / 1000
aslannnnnn
5文章数
0粉丝数
aslannnnnn
5 文章 | 0 粉丝
原创

clickhosue报filesystem error: rename: Permission

2024-08-29 02:13:53
4
0

最近windows环境借助dockerdesktop一个容器目的使用clickhouse/clickhouse-server:24.7.3.42

 

创建容器命令如下

docker run -d -p 8123:8123 -p 9000:9000 -p 9009:9009 --ulimit nofile=262144:262144 -v C:\clickhouse24.7.3\db:/var/lib/clickhouse/ -v C:\clickhouse24.7.3\log:/var/log/clickhouse-server/ -v C:\clickhouse24.7.3\conf\users.xml:/etc/clickhouse-server/users.d/*.xml -v C:\clickhouse24.7.3\conf\config.xml:/etc/clickhouse-server/config.d/*.xml --name clickhouse-server-24-7-3-42  clickhouse/clickhouse-server:24.7.3.42

 

容器创建好之后进入容器执行

clickhouse-client -m --password
create database test;
use test;
CREATE TABLE demo
(
    `demo_id` String,
    `demo_name` String,
    `create_time` DateTime64(3) DEFAULT toDateTime64(now64(), 3)
)
ENGINE = ReplacingMergeTree(create_time)
PARTITION BY toYYYYMMDD(create_time)
PRIMARY KEY (create_time, demo_id)
ORDER BY (create_time, demo_id)
SETTINGS index_granularity = 8192;

insert into demo (demo_id,demo_name) values ("1","name1");

 

然后开始报错

cfb6bb886635 :) insert into demo (demo_id,demo_name) values ('1','name1');

INSERT INTO demo (demo_id, demo_name) FORMAT Values

Query id: 0bb8ef4c-3868-44ce-b486-80799342078b

↘ Progress: 1.00 rows, 24.00 B (396.97 rows/s., 9.53 KB/s.)                                                                                                                                                                                                                                                                      
1 row in set. Elapsed: 0.060 sec. 

Received exception from server (version 24.7.3):
Code: 1001. DB::Exception: Received from localhost:9000. DB::Exception: std::__1::__fs::filesystem::filesystem_error: filesystem error: in rename: Permission denied ["/var/lib/clickhouse/store/5d4/5d4d3bf8-3d1f-4b6d-ad70-87f5b996f37f/tmp_insert_20240827_1_1_0/"] ["/var/lib/clickhouse/store/5d4/5d4d3bf8-3d1f-4b6d-ad70-87f5b996f37f/20240827_1_1_0/"]. (STD_EXCEPTION)

在GitHub上有clickhouse相关的issue说明

WSL problem.
Use internal ext4 filesystem, mapped volumes C:\clickhouse\data are unable to work, because they don't support some ext4 features.

意思就是文件系统格式没有给出具体解决方案

这样就把本地挂载目录去掉重新创建一个容器进去执行相同操作,问题得到解决

 

继续搜索发现还有其他issue说明

it correctly reports "Permission denied" when the filesystem is misconfigured, e.g., the directories are in different mount points, or the filesystem does not support Unix permissions, or the filesystem reports an error for any other reason.

 

之所以这个因为挂载目录异常挂载不同目录或者不支持文件系统都有可能有报错。可以针对性提供解决方案挂载目录尽可能相同目录文件系统改成unix文件系统或者直接不使用挂载目录

文章来自个人专栏
音视频文章
5 文章 | 1 订阅
0条评论
0 / 1000
请输入你的评论
0
0