1. Home
  2. Knowledge Base
  3. ClickHouse
  4. Use S3 Storage in ClickHouse : AWS Configuration
  1. Home
  2. Knowledge Base
  3. ClickHouse Cloud
  4. Use S3 Storage in ClickHouse : AWS Configuration
  1. Home
  2. Knowledge Base
  3. ClickHouse DBA
  4. Use S3 Storage in ClickHouse : AWS Configuration

Use S3 Storage in ClickHouse : AWS Configuration

In this post, we would like to configure an AWS S3 bucket for use in ClickHouse step by step. In the next part of this series, we’ll talk about configuration on the ClickHouse server side.

Therefore, we would like to create and configure AWS IAM user and S3 bucket.

For AWS configuration, we created detailed information with screenshots. You can access this information here.

Create and Configure IAM User

You can find steps for creating user:

  • Under AWS IAM, select “ADD Users

  • Enter username with credential type to “Access key – Programmatic access”.

  • Do not add user to any groups or do not add tags to user(accept default options until step 5).

  • In step 5, note down the access key and secret access key for use in the ClickHouse storage configuration.

  • Click the user that you created in the “Users screen.
  • Copy the ARN (Amazon Resource Name) and save it for use when configuring the access policy for the bucket.

Create and Configure S3 Bucket

Now, it is time to create and configure S3 bucket. Here is the steps:

  • Select “Create Bucket” in S3 section.
  • At that point, enter a bucket name (All other options should be set to default) and click “Create Bucket” at the bottom of the page.
  • After creating bucket, you should see your new bucket under “Buckets
  • Check your bucket and copy the ARN. (It is used in creating storage policies at the ClickHouse server)
  • Select the bucket’s link in the “Buckets” section and select “Create Folder” to create a folder to use as ClickHouse storage.
  • Enter a folder name and select Create folder. (All other options should be set to default.)
  • Check the created folder and copy the URL for use in the ClickHouse storage configuration.
  • Select the created bucket and choose the “Permissions” tab.
  • Click on the “Edit” button in the “Bucket Policy” section and add the policy above with your credentials and information.
{
    "Version": "2012-10-17",
    "Id": "Policy1",
    "Statement": [
        {
            "Sid": "CHS3_1",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::<YOUR_IAM_ID>:user/<YOUR_USER>"
            },
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::<YOUR_BUCKET>",
                "arn:aws:s3:::<YOUR_BUCKET>/*"
            ]
        }
    ]
}

In this part of the article, we discuss S3 configuration for use in ClickHouse. In the next post, we’ll configure ClickHouse to use S3 as a disk.

References

Was this article helpful?

Related Articles

CHISTADATA IS COMMITTED TO OPEN SOURCE SOFTWARE AND BUILDING HIGH PERFORMANCE COLUMNSTORES

In the spirit of freedom, independence and innovation. ChistaDATA Corporation is not affiliated with ClickHouse Corporation 

Need Support?

Can't find the answer you're looking for?
Contact Support

ChistaDATA Inc. Knowledge base is licensed under the Apache License, Version 2.0 (the “License”)

Copyright 2022 ChistaDATA Inc

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.