Apache Drill
Overview
Apache Drill is the open-source, schema-free distributed SQL query engine for big data exploration. It runs ANSI SQL directly against files (JSON, Parquet, CSV), object storage, NoSQL stores and relational databases, with no schemas or ETL to define up front. The SecureAnyCloud image installs Apache Drill 1.20.0 on OpenJDK 11 at /opt/drill, protects the Web UI with a unique admin password generated on the first boot of every VM, and is backed by 24/7 SecureAnyCloud support.
What you get:
- Apache Drill 1.20.0 drillbit on OpenJDK 11 at
/opt/drill, run as a dedicateddrillsystem user. - A local single-node Apache ZooKeeper (
zookeeper.service) on loopback:2181for Drill cluster coordination. - An nginx reverse proxy on
:80in front of the Drill Web UI / REST API (:8047). The JDBC/ODBC user port is31010. - A dedicated Azure data disk at
/var/lib/drillholding Drill'ssys.store, query profiles, logs and the ZooKeeper data. It is separate from the OS disk and re-provisioned with every VM. - A per-VM Web UI admin password (
DRILL_ADMIN_PASSWORD) generated at first boot and stored in a root-only file, with PLAIN/htpasswd authentication. zookeeper.service,drill.serviceandnginx.serviceas systemd units, enabled and active.- 24/7 SecureAnyCloud support.
Prerequisites
You need:
- An active Azure subscription, an SSH key pair, and a VNet and subnet in the target region.
- A VM size of Standard_B4ms (4 vCPU / 16 GiB RAM), which is a good starting point for the drillbit JVM. Scale up for larger scans and concurrency.
- NSG inbound rules that allow
22/tcpfrom your management network and80/tcpfor the Web UI. Front the Web UI with TLS for public exposure (see Enabling HTTPS). - Optionally, an NSG rule for the Drill user port
31010. It is bound on the VM's private IP for JDBC/ODBC clients inside your VNet, so open it in the NSG only for the application networks that need it.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Apache Drill by SecureAnyCloud and select Create.
On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).
Review the dedicated data disk on the Disks tab, then select Review + create and Create.
Step 2 - Deploy from the Azure CLI
Accept the Marketplace terms once per subscription, then create the VM:
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:apache-drill-ubuntu-24-04:default:latest
az vm create \
--resource-group <your-rg> \
--name drill \
--image sac1647283583153:apache-drill-ubuntu-24-04:default:latest \
--size Standard_B4ms \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_ed25519.pub \
--vnet-name <your-vnet> --subnet <your-subnet> \
--public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name drill --port 80 --priority 1010Step 3 - Connect to your VM
SSH in to the VM as azureuser:
ssh azureuser@<vm-public-ip>Step 4 - Confirm the services are running
Check that ZooKeeper, Drill and nginx are active:
systemctl is-active zookeeper.service drill.service nginx.serviceAll three services report active. On first boot, the drillbit can take a minute or two to start fully while the JVM warms up and registers with ZooKeeper. The Web UI port 8047 and the user RPC port 31010 come up once it is ready.
Step 5 - Retrieve your Web UI password
Your VM generates its own Web UI admin password on first boot and writes it to a root-only file. Print the admin user and password:
sudo grep -E '^DRILL_ADMIN_USER|^DRILL_ADMIN_PASSWORD' /root/drill-credentials.txtThe DRILL_ADMIN_PASSWORD value is the password. Sign in to the Web UI as admin with it.
Step 6 - Open the Drill Web UI
Browse to http://<vm-public-ip>/ and sign in as admin with the password from Step 5.
The Drill Web UI shows the cluster (drillbits, ports, version and uptime), a SQL Query editor, completed-query Profiles and runtime Metrics.
Step 7 - Run a SQL query through the REST API
Drill's Web UI is backed by a REST API. Log in to obtain a session cookie, then run a query against the bundled classpath dataset cp.`employee.json`. The request goes to the local drillbit through nginx:
PW='<DRILL_ADMIN_PASSWORD>'
CJ=$(mktemp)
curl -s -c "$CJ" -o /dev/null -X POST \
--data-urlencode 'j_username=admin' --data-urlencode "j_password=$PW" \
http://127.0.0.1/j_security_check
curl -s -b "$CJ" -X POST -H 'Content-Type: application/json' \
-d '{"queryType":"SQL","query":"SELECT employee_id, full_name, position_title FROM cp.`employee.json` LIMIT 5"}' \
http://127.0.0.1/query.json rm -f "$CJ"The response is JSON containing a queryId, the result columns and the matching rows. You can submit any SQL that Drill supports the same way.
Step 8 - Check the Drill version and cluster
Confirm the running version and the registered drillbits by querying Drill's system tables:
PW='<DRILL_ADMIN_PASSWORD>'
CJ=$(mktemp)
curl -s -c "$CJ" -o /dev/null -X POST \
--data-urlencode 'j_username=admin' --data-urlencode "j_password=$PW" \
http://127.0.0.1/j_security_check
curl -s -b "$CJ" -X POST -H 'Content-Type: application/json' \
-d '{"queryType":"SQL","query":"SELECT version FROM sys.version"}' http://127.0.0.1/query.json
curl -s -b "$CJ" -X POST -H 'Content-Type: application/json' \
-d '{"queryType":"SQL","query":"SELECT hostname, user_port, http_port FROM sys.drillbits"}' http://127.0.0.1/query.json rm -f "$CJ"sys.version returns 1.20.0, and sys.drillbits lists the single node with its user (31010) and http (8047) ports.
Step 9 - Query your own data and connect clients
Drill queries files and object storage directly. Configure storage plugins in the Web UI Storage tab, for example a dfs workspace pointing at a directory of Parquet/JSON/CSV, or Azure Blob via the dfs plugin with the Azure connector. Then run SELECT ... FROM dfs.\/path/to/data`. For BI tools and applications, connect over JDBC/ODBC to the Drill user port at:31010from inside your VNet (open31010/tcp` in the NSG for those application networks only).
Enabling HTTPS
For production, terminate TLS at nginx with a real domain pointed at the VM's public IP. Install certbot and request a certificate, replacing the domain with yours:
sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.example.comBackup and maintenance
Drill's working state (sys.store, query profiles, logs and the ZooKeeper data) lives on the dedicated data disk at /var/lib/drill. Snapshot that disk in Azure to back up cluster and query state. Keep the OS patched with sudo apt update && sudo apt upgrade. The drillbit restarts cleanly with sudo systemctl restart drill, and ZooKeeper with sudo systemctl restart zookeeper.
Support
This image is backed by 24/7 SecureAnyCloud support. Contact us by email and chat for help with storage plugins, query tuning, JDBC/ODBC connectivity, authentication, TLS and backups.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on Azure
Launch Apache Drill on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
This image runs Apache Drill, the open source, schema-free distributed SQL query engine. Drill runs standard ANSI SQL directly against files (JSON, Parquet, CSV), relational databases, NoSQL stores and object storage, with no schema definition or data loading step. You point Drill at your data and query it in place.
What you get:
- Apache Drill 1.22.0 installed under
/opt/drill. It runs as a dedicated unprivilegeddrillsystem account under a systemd service that starts the drillbit on boot and restarts it on failure. The runtime is a headless OpenJDK 11. - A coordinating ZooKeeper. A single-node Apache ZooKeeper, bound to loopback, coordinates the drillbit.
- A dedicated data volume. The drillbit
sys.store, query profiles and the ZooKeeper data directory live on an independently resizable EBS data volume mounted at/var/lib/drill, so your query state survives instance replacement. - Authentication turned on. Apache Drill ships with authentication disabled. This image enables Drill Web and REST authentication using the PLAIN mechanism with an htpasswd credential store, and designates
adminas a Drill administrator. The Web console is locked behind a sign-in, and only the admin account can manage storage plugins and system options. - A drillbit that is never exposed directly. It binds to
127.0.0.1:8047(Web and REST) and to the instance private address for the RPC ports. An nginx reverse proxy publishes the Web console on port 80. - A unique admin password per instance. The password is generated on the first boot of every deployed instance, so two instances launched from the same Amazon Machine Image never share a password. It is written to
/root/drill-credentials.txtwith mode 0600, so only the root user can read it.
The drillbit is a JVM application and takes a short time to start after first boot before the Web console answers.
Prerequisites
Before you deploy this image, you need:
- An Amazon Web Services account where you can launch EC2 instances.
- IAM permissions to launch instances, create security groups and subscribe to AWS Marketplace products.
- An EC2 key pair in the target Region for SSH access to the instance.
- A VPC and subnet in the target Region, with a security group that allows inbound port 22 from your management network and port 80 for the Web console.
- The AWS CLI (version 2) installed locally, if you plan to deploy from the command line.
Launch the instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for Apache Drill. Select the SecureAnyCloud listing and choose Select, then choose Continue on the subscription summary.
Pick an instance type of m5.large or larger. Choose your EC2 key pair under Key pair (login). Under Network settings, select your VPC and subnet, and either create or select a security group that opens port 22 from your management network and port 80 for the Web console. Leave the root volume at the default size or larger.
Select Launch instance. First-boot initialisation generates the admin password. The JVM drillbit then takes a short time to become ready after the instance state becomes Running and the status checks pass.
Launch the instance from the AWS CLI
This command launches an instance from the SecureAnyCloud Apache Drill Marketplace AMI into an existing subnet and security group. Replace <ami-id> with the AMI ID shown on the Marketplace listing, <key-name> with your EC2 key pair name, <subnet-id> with your subnet ID, and <security-group-id> with a security group that opens ports 22 and 80 as described above.
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type m5.large \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=apache-drill}]'When the instance reaches the Running state and its status checks pass, note its public IP address or DNS name from the EC2 console or with aws ec2 describe-instances.
Connect to your instance
Connect over SSH with your key pair. The login user for Ubuntu 24.04 is ubuntu:
ssh -i <key-name>.pem ubuntu@<public-ip>Retrieve the admin password
The Drill admin password is unique to your instance and was generated on first boot. Read it as root with the command below. The file lists the console URL, the admin user (admin) and the generated password. Store the password somewhere safe.
sudo cat /root/drill-credentials.txtConfirm Apache Drill is running
Over SSH, confirm that ZooKeeper, the drillbit and the nginx proxy are all active.
sudo systemctl is-active zookeeper drill nginxAll three services should report active. The drillbit binds to loopback for the Web console, and nginx fronts it on port 80. Confirm that the unauthenticated health endpoint answers locally:
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1/healthThis returns 200 once nginx and the drillbit are up. You can also confirm the drillbit is listening on its Web and RPC ports:
sudo ss -tlnp | grep -E ':8047|:31010'Sign in to the Web console
The Apache Drill Web console is served on port 80 by nginx. In a browser, go to:
http://<instance-public-ip>/The cluster overview page lists the online drillbit, its version and its ports. Choose Log In at the top right and sign in as admin with the password from the credentials file. As an administrator, you can use the query editor, query profiles, storage plugin configuration and system options.
Run a SQL query
Open the Query tab. Drill queries self-describing data in place, so you can query the bundled sample data straight away. Enter a query and choose Submit:
SELECT full_name, position_title, salary FROM cp.`employee.json` LIMIT 10The results are returned as a sortable, searchable grid, and the query is recorded as a completed profile.
You can also run queries against the REST API. This command signs in with the per-instance admin password and runs the same query, returning JSON:
PW=$(sudo grep '^DRILL_ADMIN_PASSWORD=' /root/drill-credentials.txt | cut -d= -f2-)
CJ=$(mktemp)
curl -s -c "$CJ" -o /dev/null -X POST \
--data-urlencode 'j_username=admin' --data-urlencode "j_password=$PW" \
http://127.0.0.1/j_security_check
curl -s -b "$CJ" -X POST -H 'Content-Type: application/json' \
-d '{"queryType":"SQL","query":"SELECT * FROM cp.`employee.json` LIMIT 5"}' \
http://127.0.0.1/query.json rm -f "$CJ"Review query profiles
Open the Profiles tab to see the history of completed and running queries. Each profile records the query text, the user, the state, the duration and the foreman drillbit. Open a profile to inspect the full execution plan and operator-level metrics.
Configure storage plugins
Drill reads data through storage plugins. Open the Storage page to enable, disable and configure plugins. The page is available to the admin account, which this image designates as a Drill administrator. From here you can add a plugin for Amazon S3, a local or network file system, a relational database over JDBC, or one of the other supported sources, and define workspaces and file formats. Once a plugin is configured, you query its data with the same SQL you used against the sample data, for example SELECT * FROM s3.mybucket.data/events.parquet``.
Storage plugin definitions are persisted in the ZooKeeper-backed system store, so they survive a drillbit restart and instance replacement.
Connect JDBC and ODBC clients
Applications and BI tools connect to Drill over its user RPC port (31010) using the Drill JDBC or ODBC drivers. They authenticate with the admin user and the per-instance password.
The RPC port is bound to the instance private address and is not opened in the image's security group by default. Open port 31010 to trusted client networks, or tunnel it over SSH, before connecting a client. The Web console remains the simplest way to run ad hoc SQL.
The data volume
The drillbit sys.store, the query profiles and the ZooKeeper data directory live on a dedicated EBS volume mounted at /var/lib/drill. This keeps query state off the operating system disk and lets you resize or snapshot it independently. Confirm the mount with:
df -h /var/lib/drillTo grow the store, expand the EBS volume in the AWS console, then grow the filesystem on the instance with sudo resize2fs on the underlying device. Because the query state lives on this volume, it survives instance replacement when you re-attach or restore the volume.
Enable HTTPS
nginx serves the Web console over plain HTTP on port 80. For production use, place it behind TLS. Obtain a certificate for your domain, for example a managed certificate on an Application Load Balancer in front of the instance, or Certbot installed on the instance.
Then configure nginx to listen on 443 with your certificate and proxy to 127.0.0.1:8047, exactly as the bundled site does for port 80. Keep the Drill login in place. Restrict the security group so ports 80 and 443 are reachable only from the networks that use the console.
Backup and maintenance
Back up your query state and storage plugin configuration by snapshotting the /var/lib/drill EBS volume, which captures the data tier including the ZooKeeper store.
Apply operating system security updates with sudo apt-get update && sudo apt-get upgrade, and reboot when a new kernel is installed. ZooKeeper, Apache Drill and nginx start automatically on boot, and the drillbit takes a short time to become ready again after a reboot.
Support
This image is published and supported by SecureAnyCloud. Support covers deployment, storage plugin configuration, query authoring and optimisation, authentication, JDBC and ODBC connectivity, TLS and JVM tuning. Contact SecureAnyCloud through the support channel listed on the AWS Marketplace listing.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on AWS
Launch Apache Drill on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com