WSL2 Docker安装Clickhouse 导入数据报错
-
Docker 启动 Clickhouse
docker run -d -p 18123:8123 -p19000:9000 --name clickhouse-server -v /mnt/e/container/clickhouse/data:/var/lib/clickhouse/ --ulimit nofile=262144:262144 clickhouse/clickhouse-server
导入官方示例数据抱错
INSERT INTO trips SELECT * FROM s3( 'https://datasets-documentation.s3.eu-west-3.amazonaws.com/nyc-taxi/trips_{1..2}.gz', 'TabSeparatedWithNames', " `trip_id` UInt32, `vendor_id` Enum8('1' = 1, '2' = 2, '3' = 3, '4' = 4, 'CMT' = 5, 'VTS' = 6, 'DDS' = 7, 'B02512' = 10, 'B02598' = 11, 'B02617' = 12, 'B02682' = 13, 'B02764' = 14, '' = 15), `pickup_date` Date, `pickup_datetime` DateTime, `dropoff_date` Date, `dropoff_datetime` DateTime, `store_and_fwd_flag` UInt8, `rate_code_id` UInt8, `pickup_longitude` Float64, `pickup_latitude` Float64, `dropoff_longitude` Float64, `dropoff_latitude` Float64, `passenger_count` UInt8, `trip_distance` Float64, `fare_amount` Float32, `extra` Float32, `mta_tax` Float32, `tip_amount` Float32, `tolls_amount` Float32, `ehail_fee` Float32, `improvement_surcharge` Float32, `total_amount` Float32, `payment_type` Enum8('UNK' = 0, 'CSH' = 1, 'CRE' = 2, 'NOC' = 3, 'DIS' = 4), `trip_type` UInt8, `pickup` FixedString(25), `dropoff` FixedString(25), `cab_type` Enum8('yellow' = 1, 'green' = 2, 'uber' = 3), `pickup_nyct2010_gid` Int8, `pickup_ctlabel` Float32, `pickup_borocode` Int8, `pickup_ct2010` String, `pickup_boroct2010` String, `pickup_cdeligibil` String, `pickup_ntacode` FixedString(4), `pickup_ntaname` String, `pickup_puma` UInt16, `dropoff_nyct2010_gid` UInt8, `dropoff_ctlabel` Float32, `dropoff_borocode` UInt8, `dropoff_ct2010` String, `dropoff_boroct2010` String, `dropoff_cdeligibil` String, `dropoff_ntacode` FixedString(4), `dropoff_ntaname` String, `dropoff_puma` UInt16 ") SETTINGS input_format_try_infer_datetimes = 0
错误提示
Code: 481. DB::Exception: Received from localhost:9000. DB::ErrnoException. DB::ErrnoException: Cannot set modification time to file: /var/lib/clickhouse/store/e04/e049a765-386f-4d0d-a8cf-a113277b7d2a/tmp_insert_201507_1_1_0/: , errno: 1, strerror: Operation not permitted. (PATH_ACCESS_DENIED)
-
解决办法。wsl 挂载windows的目录有问题,直接在wsl里面建一个目录,然后挂载
docker run -d -p 18123:8123 -p19000:9000 --name clickhouse-server -v ~/volumes/clickhouse/data:/var/lib/clickhouse/ --ulimit nofile=262144:262144 clickhouse/clickhouse-server 5c3e31d25eefd758715b2e54b7b42e048cc9991d52efa4ea1506269fc55bbf19