Deploy Databend With MinIO
tip
Expected deployment time: 5 minutes ⏱
This guideline will deploy Databend(standalone) with MinIO step by step.
1. Deploy MinIO
Run a standalone MinIO server via Docker:
docker run -d -p 9900:9000 --name minio \
-e "MINIO_ACCESS_KEY=minioadmin" \
-e "MINIO_SECRET_KEY=minioadmin" \
-v /tmp/data:/data \
-v /tmp/config:/root/.minio \
minio/minio server /data
We recommend using aws cli to create a new MinIO bucket:
export AWS_ACCESS_KEY_ID=minioadmin
export AWS_SECRET_ACCESS_KEY=minioadmin
export AWS_EC2_METADATA_DISABLED=true
aws --endpoint-url http://127.0.0.1:9900/ s3 mb s3://databend
2. Download
You can find the latest binaries on the github release page or build from source.
mkdir databend && cd databend
- Linux
- MacOS
- Arm
curl -LJO https://github.com/datafuselabs/databend/releases/download/v0.7.22-nightly/databend-v0.7.22-nightly-x86_64-unknown-linux-musl.tar.gz
curl -LJO https://github.com/datafuselabs/databend/releases/download/v0.7.22-nightly/databend-v0.7.22-nightly-aarch64-apple-darwin.tar.gz
curl -LJO https://github.com/datafuselabs/databend/releases/download/v0.7.22-nightly/databend-v0.7.22-nightly-aarch64-unknown-linux-musl.tar.gz
- Linux
- MacOS
- Arm
tar xzvf databend-v0.7.22-nightly-x86_64-unknown-linux-musl.tar.gz
tar xzvf databend-v0.7.22-nightly-aarch64-apple-darwin.tar.gz
tar xzvf databend-v0.7.22-nightly-aarch64-unknown-linux-musl.tar.gz
3. Deploy databend-meta (Standalone)
databend-meta is a global service for the meta data(such as user, table schema etc.).
3.1 Create databend-meta.toml
databend-meta.toml
log_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"
3.2 Start the databend-meta
./databend-meta -c ./databend-meta.toml > meta.log 2>&1 &
3.3 Check databend-meta
curl -I http://127.0.0.1:8101/v1/health
Check the response is HTTP/1.1 200 OK
.
4. Deploy databend-query (Standalone)
4.1 Create databend-query.toml
databend-query.toml
[log]
log_level = "INFO"
log_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]
# databend-meta grpc api address.
meta_address = "127.0.0.1:9101"
meta_username = "root"
meta_password = "root"
[storage]
# fs|s3
storage_type = "s3"
[storage.fs]
[storage.s3]
bucket = "databend"
endpoint_url = "http://127.0.0.1:9900"
access_key_id = "minioadmin"
secret_access_key = "minioadmin"
4.2 Start databend-query
./databend-query -c ./databend-query.toml > query.log 2>&1 &
4.3 Check databend-query
curl -I http://127.0.0.1:8001/v1/health
Check the response is HTTP/1.1 200 OK
.
5. 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 |
+------+