Attach S3 as a storage engine to ClickHouse

You can move part of your data to S3 by easily connecting your S3 bucket to your ClickHouse table.

You can configure your server using this example:

<clickhouse>
    <storage_configuration>
        ...
        <disks>
            <s3>
                <type>s3</type>
                <endpoint>https://sample-bucket.s3.us-east-2.amazonaws.com/tables/</endpoint>
                <access_key_id>your_access_key_id</access_key_id>
                <secret_access_key>your_secret_access_key</secret_access_key>
                <region></region>
                <metadata_path>/var/lib/clickhouse/disks/s3/</metadata_path>
                <cache_enabled>true</cache_enabled>
            <data_cache_enabled>true</data_cache_enabled>   
                <cache_path>/var/lib/clickhouse/disks/s3/cache/</cache_path>
            </s3>
        </disks>
        ...
    </storage_configuration>
</clickhouse>

After modification you obviously need to restart your server.

To attach your connected S3 bucket to the table, you can use this instruction:

Table with TTL to S3

More information is available here:

Last updated