Skip to content

Commit 03934b2

Browse files
authored
fix incorrect delopy on docker (#2908)
* fix incorrect delopy on docker * fix incorrect delopy on docker
1 parent a581c9b commit 03934b2

File tree

1 file changed

+58
-184
lines changed

1 file changed

+58
-184
lines changed

docs/en/guides/10-deploy/01-deploy/01-non-production/00-deploying-local.md

Lines changed: 58 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -15,63 +15,9 @@ The MinIO deployment covered in this guide is only suitable for development and
1515

1616
Before you start, ensure you have the following prerequisites in place:
1717

18-
- Ensure that [Docker](https://www.docker.com/) is installed on your local machine.
18+
- Ensure that [Docker](https://www.docker.com/) is installed on your local machine.
1919
- Ensure that BendSQL is installed on your machine. See [Installing BendSQL](/guides/sql-clients/bendsql/#installing-bendsql) for instructions on how to install BendSQL using various package managers.
2020

21-
### Deploy MinIO
22-
23-
1. Pull and run the MinIO image as a container with the following command:
24-
25-
:::note
26-
27-
- We change the console address to `9001` here to avoid port conflicts.
28-
- The command also sets the root user credentials (`ROOTUSER`/`CHANGEME123`) which you will need to provide for authentication in the next steps. If you make changes to the root user credentials at this point, ensure that you maintain consistency throughout the entire process.
29-
:::
30-
31-
```shell
32-
docker run -d --name minio \
33-
-e "MINIO_ACCESS_KEY=ROOTUSER" \
34-
-e "MINIO_SECRET_KEY=CHANGEME123" \
35-
-p 9000:9000 \
36-
-p 9001:9001 \
37-
minio/minio server /data \
38-
--address :9000 \
39-
--console-address :9001
40-
```
41-
42-
2. Run the command `docker logs minio` to find the MinIO API and console (WebUI) addresses in the log message:
43-
44-
```shell
45-
docker logs minio
46-
```
47-
48-
```
49-
INFO: WARNING: MINIO_ACCESS_KEY and MINIO_SECRET_KEY are deprecated.
50-
Please use MINIO_ROOT_USER and MINIO_ROOT_PASSWORD
51-
INFO: Formatting 1st pool, 1 set(s), 1 drives per set.
52-
INFO: WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.
53-
MinIO Object Storage Server
54-
Copyright: 2015-2025 MinIO, Inc.
55-
License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
56-
Version: RELEASE.2025-04-03T14-56-28Z (go1.24.2 linux/arm64)
57-
58-
API: http://172.17.0.2:9000 http://127.0.0.1:9000
59-
WebUI: http://172.17.0.2:9001 http://127.0.0.1:9001
60-
61-
Docs: https://docs.min.io
62-
INFO:
63-
You are running an older version of MinIO released 5 days before the latest release
64-
Update: Run `mc admin update ALIAS`
65-
```
66-
67-
3. Open your web browser on your local machine and visit the MinIO console using the WebUI address shown (`http://127.0.0.1:9001`) in the logs above.
68-
69-
![Alt text](/img/deploy/docker-minio.png)
70-
71-
4. Log into the MinIO console with the credentials `ROOTUSER`/`CHANGEME123`, and create a bucket named `databend`.
72-
73-
![Alt text](/img/deploy/docker-bucket.png)
74-
7521
### Deploy Databend
7622

7723
1. Pull and run the Databend image as a container with the following command:
@@ -83,128 +29,47 @@ INFO:
8329
:::
8430

8531
```shell
86-
docker run -d \
87-
--name databend \
88-
-p 3307:3307 \
89-
-p 8000:8000 \
90-
-p 8124:8124 \
91-
-p 8900:8900 \
92-
-e QUERY_DEFAULT_USER=databend \
93-
-e QUERY_DEFAULT_PASSWORD=databend \
94-
-e QUERY_STORAGE_TYPE=s3 \
95-
-e AWS_S3_ENDPOINT=http://host.docker.internal:9000 \
96-
-e AWS_S3_BUCKET=databend \
97-
-e AWS_ACCESS_KEY_ID=ROOTUSER \
98-
-e AWS_SECRET_ACCESS_KEY=CHANGEME123 \
99-
datafuselabs/databend
32+
vim docker-compose.yml
33+
34+
services:
35+
minio:
36+
image: docker.io/minio/minio
37+
command: server /data
38+
ports:
39+
- "9000:9000"
40+
environment:
41+
- MINIO_ACCESS_KEY=MINIO_ADMIN
42+
- MINIO_SECRET_KEY=MINIO_SECRET
43+
volumes:
44+
- ./data:/data
45+
healthcheck:
46+
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
47+
interval: 30s
48+
timeout: 5s
49+
retries: 3
50+
databend:
51+
image: datafuselabs/databend
52+
environment:
53+
- QUERY_DEFAULT_USER=databend
54+
- QUERY_DEFAULT_PASSWORD=databend
55+
- QUERY_STORAGE_TYPE=s3
56+
- AWS_S3_ENDPOINT=http://minio:9000
57+
- AWS_S3_BUCKET=databend
58+
- AWS_ACCESS_KEY_ID=MINIO_ADMIN
59+
- AWS_SECRET_ACCESS_KEY=MINIO_SECRET
60+
ports:
61+
- "3307:3307"
62+
- "8000:8000"
63+
- "8080:8080"
64+
depends_on:
65+
minio:
66+
condition: service_started
10067
```
10168

102-
2. Run the command `docker logs databend` to check the Databend log message and ensure the Databend container has started successfully:
103-
104-
```shell
105-
docker logs databend
106-
```
69+
2. Start Databend
10770

10871
```shell
109-
==> QUERY_CONFIG_FILE is not set, using default: /etc/databend/query.toml
110-
==> /tmp/std-meta.log <==
111-
Databend Metasrv
112-
113-
Version: v1.2.697-d40f88cc51-simd(1.85.0-nightly-2025-02-14T11:57:01.874747910Z)
114-
Working DataVersion: V004(2024-11-11: WAL based raft-log)
115-
116-
Raft Feature set:
117-
Server Provide: { append:v0, install_snapshot:v1, install_snapshot:v3, vote:v0 }
118-
Client Require: { append:v0, install_snapshot:v3, vote:v0 }
119-
120-
Disk Data: V002(2023-07-22: Store snapshot in a file); Upgrading: None
121-
Dir: /var/lib/databend/meta
122-
123-
Log File: enabled=true, level='Warn,databend_=Info,openraft=Info', dir=/var/log/databend, format=json, limit=48
124-
Stderr: enabled=false(To enable: LOG_STDERR_ON=true or RUST_LOG=info), level=WARN, format=text
125-
Raft Id: 0; Cluster: foo_cluster
126-
Dir: /var/lib/databend/meta
127-
Status: single
128-
129-
HTTP API listen at: 127.0.0.1:28002
130-
gRPC API listen at: 127.0.0.1:9191 advertise: -
131-
Raft API listen at: 127.0.0.1:28004 advertise: 055b9e5d09a9:28004
132-
133-
Upgrade ondisk data if out of date: V002
134-
Find and clean previous unfinished upgrading
135-
Upgrade on-disk data
136-
From: V002(2023-07-22: Store snapshot in a file)
137-
To: V003(2024-06-27: Store snapshot in rotbl)
138-
No V002 snapshot, skip upgrade
139-
Finished upgrading: V003
140-
Upgrade on-disk data
141-
From: V003(2024-06-27: Store snapshot in rotbl)
142-
To: V004(2024-11-11: WAL based raft-log)
143-
Upgrade V003 raft log in sled db to V004
144-
Clean upgrading: V003 -> V004 (cleaning)
145-
Remove V003 log from sled db
146-
Removing sled tree: header
147-
Removing sled tree: raft_log
148-
Removing sled tree: raft_state
149-
Done: Remove V003 log from sled db
150-
Removing: /var/lib/databend/meta/heap
151-
Removing: /var/lib/databend/meta/conf
152-
Removing: /var/lib/databend/meta/db
153-
Removing: /var/lib/databend/meta/DO_NOT_USE_THIS_DIRECTORY_FOR_ANYTHING
154-
Finished upgrading: V004
155-
Upgrade ondisk data finished: V004
156-
Wait for 180s for active leader...
157-
Leader Id: 0
158-
Metrics: id=0, Leader, term=1, last_log=Some(3), last_applied=Some(T1-N0.3), membership={log_id:Some(T1-N0.3), {voters:[{0:EmptyNode}], learners:[]}}
159-
160-
Register this node: {id=0 raft=055b9e5d09a9:28004 grpc=}
161-
162-
Register-node: Ok
163-
164-
Databend Metasrv started
165-
166-
==> /tmp/std-query.log <==
167-
Databend Query
168-
169-
Version: v1.2.697-d40f88cc51(rust-1.85.0-nightly-2025-02-14T11:30:59.842308760Z)
170-
171-
Logging:
172-
file: enabled=true, level='INFO', dir=/var/log/databend, format=json, limit=48
173-
stderr: enabled=false(To enable: LOG_STDERR_ON=true or RUST_LOG=info), level=WARN, format=text
174-
175-
Meta: connected to endpoints [
176-
"0.0.0.0:9191",
177-
]
178-
179-
Memory:
180-
limit: unlimited
181-
allocator: jemalloc
182-
config: percpu_arena:percpu,oversize_threshold:0,background_thread:true,dirty_decay_ms:5000,muzzy_decay_ms:5000
183-
184-
Cluster: standalone
185-
186-
Storage: s3 | bucket=databend,root=,endpoint=http://host.docker.internal:9000
187-
Disk cache:
188-
storage: none
189-
path: DiskCacheConfig { max_bytes: 21474836480, path: "./.databend/_cache", sync_data: true }
190-
reload policy: reset
191-
192-
Builtin users: databend
193-
194-
Builtin UDFs:
195-
196-
Admin
197-
listened at 0.0.0.0:8080
198-
MySQL
199-
listened at 0.0.0.0:3307
200-
connect via: mysql -u${USER} -p${PASSWORD} -h0.0.0.0 -P3307
201-
Clickhouse(http)
202-
listened at 0.0.0.0:8124
203-
usage: echo 'create table test(foo string)' | curl -u${USER} -p${PASSWORD}: '0.0.0.0:8124' --data-binary @-
204-
echo '{"foo": "bar"}' | curl -u${USER} -p${PASSWORD}: '0.0.0.0:8124/?query=INSERT%20INTO%20test%20FORMAT%20JSONEachRow' --data-binary @-
205-
Databend HTTP
206-
listened at 0.0.0.0:8000
207-
usage: curl -u${USER} -p${PASSWORD}: --request POST '0.0.0.0:8000/v1/query/' --header 'Content-Type: application/json' --data-raw '{"sql": "SELECT avg(number) FROM numbers(100000000)"}'
72+
docker compose up
20873
```
20974

21075
### Connect to Databend
@@ -226,17 +91,26 @@ Started web server at 127.0.0.1:8080
22691
You're all set! Now, you can execute a simple query to verify the deployment:
22792

22893
```sql
229-
databend@localhost:8000/default> SELECT NOW();
230-
231-
SELECT NOW()
232-
233-
┌────────────────────────────┐
234-
│ now() │
235-
│ Timestamp │
236-
├────────────────────────────┤
237-
│ 2025-04-10 03:14:06.778815 │
238-
└────────────────────────────┘
239-
1 row read in 0.003 sec. Processed 1 row, 1 B (333.33 rows/s, 333 B/s)
94+
🐳 databend@default:) CREATE OR REPLACE TABLE students (uid Int16, name String, age Int16);
95+
🐳 databend@default:) INSERT INTO students VALUES (8888, 'Alice', 50);
96+
97+
╭─────────────────────────╮
98+
number of rows inserted │
99+
│ UInt64 │
100+
├─────────────────────────┤
101+
1
102+
╰─────────────────────────╯
103+
1 row written in 0.059 sec. Processed 1 row, 19 B (16.95 rows/s, 322 B/s)
104+
105+
🐳 databend@default:) SELECT * FROM students;
106+
107+
╭──────────────────────────────────────────────────────╮
108+
│ uid │ name │ age │
109+
│ Nullable(Int16) │ Nullable(String) │ Nullable(Int16) │
110+
├─────────────────┼──────────────────┼─────────────────┤
111+
8888 │ Alice │ 50
112+
╰──────────────────────────────────────────────────────╯
113+
1 row read in 0.008 sec. Processed 1 row, 28 B (125 rows/s, 3.42 KiB/s)
240114
```
241115

242116
<!-- <LanguageFileParse

0 commit comments

Comments
 (0)