在clickhouse配置目录下config.d创建storage.xml文件
- <yandex>
- <storage_configuration>
- <disks>
- <default>
- <keep_free_space_bytes>1024</keep_free_space_bytes>
- </default>
- <vdb>
- <path>/data/vdb/</path>
- </vdb>
- <vdc>
- <path>/data/vdc/</path>
- </vdc>
- </disks>
- <policies>
- <storage>
- <volumes>
- <hot_volume>
- <disk>vdc</disk>
- <max_data_part_size_bytes>29000000</max_data_part_size_bytes>
- </hot_volume>
- <cold_volume>
- <disk>vdb</disk>
- </cold_volume>
- </volumes>
- </storage>
- </policies>
- </storage_configuration>
- </yandex>
使用示例
- ENGINE = MergeTree
- ORDER BY Id
- SETTINGS storage_policy = 'storage', index_granularity = 8192