Scale Query Service Nodes
Overview
This guide will walk you through the process of scaling your Databend Query Service cluster. You can either add new nodes (scale up) or remove existing nodes (scale down) from your cluster.
Prerequisites
- Have completed Deploy Query Service and have a running Query Service node
- Have completed Prepare Package Environment on the new node (for scale up)
- Have sudo privileges on the nodes
Scale Up: Add New Query Service Node
To add a new Query Service node, follow the steps in Deploy Query Service on the new node. Make sure to:
-
Copy the configuration from an existing node:
sudo mkdir -p /etc/databend
sudo scp root@<existing-node-ip>:/etc/databend/databend-query.toml /etc/databend/ -
Follow the deployment steps in Deploy Query Service to install and start the service.
-
After deployment, verify the new node is added to the cluster:
bendsql -h 127.0.0.1 -u root
SELECT * FROM system.clusters;
Scale Down: Remove Query Service Node
To remove a Query Service node from the cluster, simply stop the service on that node:
sudo systemctl stop databend-query
The node will be automatically removed from the cluster. You can verify the cluster status from any remaining node:
bendsql -h 127.0.0.1 -u root
SELECT * FROM system.clusters;
Troubleshooting
If you encounter issues:
-
Check the service status:
sudo systemctl status databend-query
-
View the logs for detailed error messages:
sudo journalctl -u databend-query -f
-
Common issues and solutions:
- Permission denied: Ensure the databend user has proper permissions
- Port already in use: Check if another service is using the configured ports
- Configuration errors: Verify the configuration file syntax and paths
- Meta Service connection issues: Ensure the Meta Service is accessible from the new node
Next Steps
After successfully scaling your Query Service cluster, you can:
- Scale Meta Service Nodes (if needed)
- Upgrade Query Service (if needed)