由于文件权限,clickhouse无法附加部件

qmelpv7a  于 2021-07-15  发布在  ClickHouse
关注(0)|答案(1)|浏览(577)

备份分区并将其加载到另一个示例时遇到问题。
我做了以下工作

ALTER TABLE Test FREEZE PARTITION 201912

从shadow获取生成的分区并将其移动到分离文件夹下的另一个示例,然后运行 ALTER TABLE Test ATTACH PARTITION 201912 “拒绝访问文件/…附加\u 2019…”失败/
这很奇怪,因为我用777权限设置了整个lib,它正在发生,知道吗?
附加错误

2019.12.16 08:28:55.541817 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Debug> executeQuery: (from [::ffff:127.0.0.1]:47426) ALTER TABLE test ATTACH PARTITION 201912
2019.12.16 08:28:55.541967 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Debug> default.test: Looking for parts for partition 201912 in detached/
2019.12.16 08:28:55.542005 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Debug> default.test: Found part 201912_0_1_1
2019.12.16 08:28:55.542020 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Debug> default.test: 1 of them are active
2019.12.16 08:28:55.542053 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Debug> default.test: Checking parts
2019.12.16 08:28:55.542061 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Debug> default.test: Checking part attaching_201912_0_1_1
2019.12.16 08:28:55.543951 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Trace> default.test: Renaming temporary part detached/attaching_201912_0_1_1 to 201912_6_6_0.
2019.12.16 08:28:55.544832 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Debug> MemoryTracker: Peak memory usage (total): 0.00 B.
2019.12.16 08:28:55.544864 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Error> executeQuery: Poco::Exception. Code: 1000, e.code() = 1, e.displayText() = Access to file denied: insufficient permissions: /data/clickhouse/data/data/default/test/detached/attaching_201912_0_1_1 (version 19.16.3.6 (official build) (from [::ffff:127.0.0.1]:47426) (in query: ALTER TABLE test ATTACH PARTITION 201912 )
2019.12.16 08:28:55.544954 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Debug> MemoryTracker: Peak memory usage (for query): 0.00 B.
2019.12.16 08:28:55.544972 [ 65 ] {b62d9630-7ab2-48a4-89a5-47d296151802} <Information> TCPHandler: Processed in 0.003 sec
doinxwow

doinxwow1#

chown -R clickhouse  /var/lib/clickhouse

这为我解决了这个问题

相关问题