Building the Connection URL
Use the connection URL to supply connection information to the data store that you are accessing.
Connecting to a Drillbit
The following is the format of a connection URL for connecting to a drillbit, where [Host] is the DNS or IP address of the server:
jdbc:drill:drillbit=[Host]
By default, the connector connects to port 31010.
You can specify optional settings such as the number of the TCP port to connect to or any of the connection properties supported by the connector or your Drill implementation. For a list of the properties available in the connector,
The following is the format of a connection URL that specifies some optional settings:
jdbc:drill:drillbit=[Host]:[Port];[Property1]=[Value];
[Property2]=[Value];...
For example, to connect to port 31500 on a drillbit and authenticate the connection using a user name and password, you would use the following connection URL:
jdbc:drill:drillbit=192.168.1.1:31500;AuthMech=Plain;
UID=simba;PWD=simba
Important:
- Properties are case-sensitive.
- Do not duplicate properties in the connection URL.
Connecting to Multiple Drillbits
To connect to multiple drillbits, include the DNS or IP address of each drillbit in the connection URL, separated by a comma. For example, to connect to drillbits at 192.168.39.43 on port 31500 and to 192.168.39.56 on port 31010, you would use the following connection URL:
jdbc:drill:drillbit=192.168.39.43:31500,192.168.39.56:31010
Connecting to a ZooKeeper Cluster
The following is the format of a connection URL for connecting to a ZooKeeper cluster, where [ServerList] is a comma-separated list of servers in your ZooKeeper cluster and [ClusterName] is the unique name of the drillbit cluster that you want to use:
jdbc:drill:zk=[ServerList]/drill/[ClusterName]
Optionally, you can specify any of the connection properties supported by the connector or your Drill implementation. For a list of the properties available in the connector,
The following is the format of a connection URL that specifies some optional settings:
jdbc:drill:zk=[ServerList]/drill/[ClusterName];[Property1]=[Value];[Property2]=[Value];...
For example, to connect to a ZooKeeper cluster and authenticate the connection using a user name and password, you would use the following connection URL:
jdbc:drill:zk=192.168.39.43:5181, 192.168.1.1:31010/drill/
drillbits1;AuthMech=Plain;UID=simba;PWD=simba
Important:
- Properties are case-sensitive.
- Do not duplicate properties in the connection URL.