Test setup for running a Databend cluster with 3 meta nodes and 1 query node.
test-bend-tests/
├── configs/
│ ├── meta-node1.toml # Meta node 1 (id=1, ports: grpc=9191, admin=29001, raft=27001)
│ ├── meta-node2.toml # Meta node 2 (id=2, ports: grpc=9192, admin=29002, raft=27002)
│ ├── meta-node3.toml # Meta node 3 (id=3, ports: grpc=9193, admin=29003, raft=27003)
│ └── query-node1.toml # Query node 1 (HTTP=8000, MySQL=3307)
├── test_cluster.py # Main test script
└── README.md # This file
IMPORTANT: You must install the databend_test_helper library before running this test:
cd ../databend_test_helper
pip install -e .-
Build Databend binaries (debug):
cd ../.. # Go to project root make build
-
Run the test cluster:
cd scripts/test-bend-tests python test_cluster.py
If you get ModuleNotFoundError: No module named 'databend_test_helper', you forgot step 1 in Prerequisites.
- Starts meta nodes in sequence (node1 → node2 → node3)
- Starts query node (connects to all 3 meta nodes)
- Shows cluster status and connection info
- Monitors health - exits if any process dies
- Graceful shutdown on Ctrl+C
Once running, you can connect to:
- HTTP API:
http://127.0.0.1:8000 - MySQL:
mysql://root@127.0.0.1:3307(no password)
All logs are written to _databend_data/logs/:
meta1/,meta2/,meta3/- Meta node logsquery1/- Query node logs
All data is stored in _databend_data/:
meta1/,meta2/,meta3/- Raft dataquery1/- Query datacache/query1/- Query cachespill/query1/- Query spill files
Bring up cluster:
python test_cluster.py
Run test:
python concurrent_sql_test.py --threads 10 -i 1000 --servers localhost:8000,localhost:8001,localhost:8002,localhost:8003,localhost:8004 --query='SELECT count(*) FROM yy a JOIN yy b ON a.number < b.number WHERE a.number * b.number < 1000000 and a.number < 10000;'
# run a single test:
bendsql --user ana --password '123' --query='SELECT count(*) FROM yy a JOIN yy b ON a.number < b.number WHERE a.number * b.number < 1000000 and a.number < 10000;'
Check pending status:
bendsql --user ana --password '123' --query='show processlist;'
# or
bendsql --user ana --password '123' --query='show processlist;' | grep '\[.*' -o | sort