Drill无法在CLI运行:执行sqlline命令时出现报错
Hey Aman, let's troubleshoot why your Drill CLI connection is failing. I’ve worked through similar issues with Drill-Zookeeper setups before, so here are the most common checks and fixes to try:
First, fix the command syntax
Thebin>prefix in your command is just the terminal prompt, not part of the actual command. From Drill'sbindirectory, run this corrected version:./sqlline -u "jdbc:drill:zk=<zk node1 ip>:5181,<zk node2 ip>:5181,<zk node3 ip>:5181"Double-check for typos in IP addresses—even a single wrong digit can break the connection.
Verify Zookeeper node reachability
Make sure your client machine can communicate with all three ZK nodes. Test connectivity usingpingandtelnetfor each node:ping <zk node1 ip> telnet <zk node1 ip> 5181If either test fails, you’ve got a network issue. Check firewall rules, security groups, or routing between your client and ZK cluster. Also, a common gotcha: Drill defaults to using ZK port 2181. If your ZK cluster is using 5181 intentionally, that’s fine—but if it’s using the default port, update your JDBC URL to use 2181 instead.
Check Zookeeper cluster health
Even if nodes are reachable, the ZK cluster might be unhealthy. On any ZK node, run:zkServer.sh statusYou should see one node marked as "leader" and the rest as "followers". If any node shows "standalone" or "error", resolve the ZK cluster issues before trying to connect Drill.
Validate Drillbit registration with Zookeeper
Ensure your Drillbits are running and registered with ZK. On a Drill node, check the Drillbit status:drillbit.sh statusThen use the ZK CLI to confirm Drillbits are listed:
zkCli.sh [zk: localhost:5181(CONNECTED) 0] ls /drill/drillbits1You should see entries for each running Drillbit. If none appear, start the Drillbits with
drillbit.sh start.Match Drill's ZK configuration to your CLI URL
On your Drill nodes, opendrill-override.confand verify thezk.connectsetting matches the connect string in your CLI command:drill.exec: { cluster-id: "drillbits1", zk.connect: "<zk node1 ip>:5181,<zk node2 ip>:5181,<zk node3 ip>:5181" }Mismatched strings will prevent the client from finding the Drill cluster.
Check for authentication requirements
If your ZK cluster uses SASL/Kerberos authentication, you’ll need to add auth parameters to your JDBC URL. For example:./sqlline -u "jdbc:drill:zk=<zk node1 ip>:5181,<zk node2 ip>:5181,<zk node3 ip>:5181;auth=kerberos;principal=drill/<hostname>@YOUR_REALM.COM"Ensure your client has a valid
krb5.conffile and keytab if using Kerberos.
If you still hit issues, share the exact error message you’re seeing (e.g., connection timeout, authentication failure) — that will help narrow down the root cause faster.
内容的提问来源于stack exchange,提问作者Aman Raturi

