ClickHouse setup
Guide to setting up ClickHouse for Raven platform
This document provides detailed instructions on setting up ClickHouse for the Raven platform. ClickHouse is used to store and query data efficiently within the Raven platform. You have the option to use ClickHouse’s SaaS offering for a fully managed experience or deploy ClickHouse on a cloud provider’s compute instance using Bitnami’s image for a self-hosted setup.
Options for Setting Up ClickHouse
1. ClickHouse SaaS Offering
Using ClickHouse’s SaaS offering is the simplest way to get started. It eliminates the need for maintaining, monitoring, and patching a self-hosted ClickHouse database. More information on the SaaS offering can be found on the ClickHouse official website.
2. Self-Hosted ClickHouse on Cloud Provider
For a self-hosted setup, you can use the image provided by Bitnami to deploy a compute instance with ClickHouse preconfigured and ready to run. This approach offers more control and customization over your ClickHouse instance.
AWS EC2 Setup
-
Launch EC2 Instance using Bitnami AMI Use the Bitnami ClickHouse AMI available here to launch an EC2 instance.
-
Terraform Setup The provided Terraform example repo includes a script to set up a ClickHouse EC2 instance. You can find the script here.
-
Allow Access to Port 9000 Ensure the EC2 instance’s security group allows inbound access to port 9000 from your EKS cluster. This port is necessary for the microservices to connect to the ClickHouse database.
GCP Compute Engine Setup
-
Launch Compute Engine Instance using Bitnami Image Use the Bitnami ClickHouse image available here to launch a Compute Engine instance.
-
Terraform Setup The provided Terraform example repo includes a script to set up a ClickHouse Compute Engine instance. You can find the script here.
-
Allow Access to Port 9000 Ensure the Compute Engine instance’s firewall rules allow inbound access to port 9000 from your GKE cluster. This port is necessary for the microservices to connect to the ClickHouse database.
Azure Virtual Machines Setup
-
Launch Virtual Machine using Bitnami Image Use the Bitnami ClickHouse image available here to launch a Virtual Machine instance.
-
Terraform Setup The provided Terraform example repo includes a script to set up a ClickHouse Virtual Machine instance. You can find the script here.
-
Allow Access to Port 9000 Ensure the Virtual Machine’s network security group allows inbound access to port 9000 from your AKS cluster. This port is necessary for the microservices to connect to the ClickHouse database.
Getting ClickHouse Credentials
After setting up the compute instance, follow these steps to retrieve the ClickHouse credentials:
-
SSH into the Instance Use the SSH key found in Secret Manager (if you used the provided Terraform example) to access the instance.
For AWS EC2:
For GCP Compute Engine:
For Azure Virtual Machines:
-
Retrieve Credentials Run the following command to get the ClickHouse credentials:
This will display the credentials needed to configure your microservices.
Configuring Microservices
Use the extracted ClickHouse credentials to configure your microservices. The configuration can be applied in the Helm chart used to deploy the microservices. Refer to the Helm Installation Guide for detailed instructions.
Example Helm Values File (values.yaml
)
Replace <clickhouse_host>
and <clickhouse_password>
with the values retrieved from the compute instance.
Conclusion
Setting up ClickHouse can be done using either the SaaS offering for a fully managed experience or by deploying a self-hosted instance on your preferred cloud provider using Bitnami’s image. Follow the provided steps to retrieve the necessary credentials and configure your microservices for seamless integration with ClickHouse. For further assistance, refer to the Raven Documentation or contact support.