Skip to main content

Deploy Databend With Wasabi Object Storage

tip

Expected deployment time: 5 minutes ⏱

Wasabi is a cheaper object storage and 100% compatible with Amazon S3.

From its official website, they proclaim 80% Less than Amazon S3 and No Fees for Egress.

Before you begin

1. Download

You can find the latest binaries on the github release page or build from source.

mkdir databend && cd databend
curl -LJO https://github.com/datafuselabs/databend/releases/download/v0.7.26-nightly/databend-v0.7.26-nightly-x86_64-unknown-linux-musl.tar.gz
tar xzvf databend-v0.7.26-nightly-x86_64-unknown-linux-musl.tar.gz

2. Deploy databend-meta (Standalone)

databend-meta is a global service for the meta data(such as user, table schema etc.).

2.1 Create databend-meta.toml

databend-meta.toml
dir = "metadata/_logs"
admin_api_address = "127.0.0.1:8101"
grpc_api_address = "127.0.0.1:9101"

[raft_config]
id = 1
single = true
raft_dir = "metadata/datas"

2.2 Start the databend-meta

./databend-meta -c ./databend-meta.toml > meta.log 2>&1 &

2.3 Check databend-meta

curl -I  http://127.0.0.1:8101/v1/health

Check the response is HTTP/1.1 200 OK.

3. Deploy databend-query (Standalone)

3.1 Create databend-query.toml

databend-query.toml
[log]
level = "INFO"
dir = "benddata/_logs"

[query]
# For admin RESET API.
admin_api_address = "127.0.0.1:8001"

# Metrics.
metric_api_address = "127.0.0.1:7071"

# Cluster flight RPC.
flight_api_address = "127.0.0.1:9091"

# Query MySQL Handler.
mysql_handler_host = "127.0.0.1"
mysql_handler_port = 3307

# Query ClickHouse Handler.
clickhouse_handler_host = "127.0.0.1"
clickhouse_handler_port = 9001

# Query HTTP Handler.
http_handler_host = "127.0.0.1"
http_handler_port = 8081

tenant_id = "tenant1"
cluster_id = "cluster1"

[meta]
meta_address = "127.0.0.1:9101"
meta_username = "root"
meta_password = "root"

[storage]
# fs|s3
type = "s3"

[storage.fs]

[storage.s3]
# How to create a bucket:
bucket = "<your-bucket>"

# You can get the URL from:
# https://wasabi-support.zendesk.com/hc/en-us/articles/360015106031-What-are-the-service-URLs-for-Wasabi-s-different-regions-
endpoint_url = "https://s3.us-east-2.wasabisys.com"

# How to get access_key_id and secret_access_key:
access_key_id = "<your-key-id>"
secret_access_key = "<your-access-key>"

[storage.azblob]
tip

In this example Wasabi region is us-east-2.

3.2 Start databend-query

./databend-query -c ./databend-query.toml > query.log 2>&1 &

3.3 Check databend-query

curl -I  http://127.0.0.1:8001/v1/health

Check the response is HTTP/1.1 200 OK.

4. Play

mysql -h127.0.0.1 -uroot -P3307 
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(1), (2);
SELECT * FROM t1
+------+
| a |
+------+
| 1 |
| 2 |
+------+