Friday, July 1, 2016

Understanding Drill's znodes

Goal:

znodes in zookeeper for Apache Drill is the brain.
It has the most important the cluster level information.
This article walks through those information in the brain.

Env:

Drill 1.6

Solution:

1. How to logon zookeeper?

Firstly find the zookeeper connection string by:
maprcli node listzookeepers
Zookeepers
v5.poc.com:5181,v6.poc.com:5181,v7.poc.com:5181
Then ssh to one of above zookeeper nodes, and logon zookeeper:
/opt/mapr/zookeeper/zookeeper-3.4.5/bin/zkCli.sh -server v5.poc.com:5181,v6.poc.com:5181,v7.poc.com:5181

2. Drill's znodes have 4 sub directories

ls /drill
[sys.storage_plugins, my_cluster_com-drillbits, sys.options, running]

a. sys.storage_plugins

This contains the storage plugin configurations.
ls /drill/sys.storage_plugins
[hive, kudu, dfs, cp, hbase, mylocal, mongo]
get /drill/sys.storage_plugins/hive
{
  "type" : "hive",
  "enabled" : false,
  "configProps" : {
    "hive.metastore.uris" : "",
    "javax.jdo.option.ConnectionURL" : "jdbc:derby:;databaseName=../sample-data/drill_hive_db;create=true",
    "hive.metastore.warehouse.dir" : "/tmp/drill_hive_wh",
    "fs.default.name" : "file:///",
    "hive.metastore.sasl.enabled" : "false"
  }
}
cZxid = 0x200000234
ctime = Thu Apr 21 07:35:32 GMT-05:00 2016
mZxid = 0x200000234
mtime = Thu Apr 21 07:35:32 GMT-05:00 2016
pZxid = 0x200000234
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 346
numChildren = 0

b. <Drill Cluster Name>-drillbits

This contains current drillbits. Each drillbit is showing as a hash value here.
If you kill/shutdown one drillbit, that drillbit will disappear from this znodes, that is why I mean "current".
This result will also match the output from "select * from sys.drillbits;" in sqlline.
ls /drill/my2_cluster_com-drillbits
[f57860a1-cb6a-47f5-b479-dd72ea98f209, 7253a7e9-22bc-487b-8314-32f3eae29006, 3009e2ce-224b-4e41-b3dc-1757e8ed3234]
get /drill/my2_cluster_com-drillbits/f57860a1-cb6a-47f5-b479-dd72ea98f209

$f57860a1-cb6a-47f5-b479-dd72ea98f209�����*

v5.poc.com���� ��
cZxid = 0x2000003fc
ctime = Thu Jun 23 05:16:01 GMT-05:00 2016
mZxid = 0x2000003fc
mtime = Thu Jun 23 05:16:01 GMT-05:00 2016
pZxid = 0x2000003fc
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x1536120903a001a
dataLength = 71
numChildren = 0

c. running

Any starting or running(not completed nor failed) queries will be shown here.
Its query ID will be listed here.
ls /drill/running
[288992bf-f8d3-b53c-7264-14933915dc76]
You can find the query profile from Drill web UI also:
http://<Drillbit>:8047/profiles/288992bf-f8d3-b53c-7264-14933915dc76

d. sys.options

Any system-level changed parameters will be shown here.
If all the parameters are default, it is empty like this:
ls /drill/sys.options
[]
After you change one parameter at system level:
0: jdbc:drill:zk=v5.poc.com:5181,v6.poc.com:5> alter system set `exec.errors.verbose`=true;
+-------+-------------------------------+
|  ok   |            summary            |
+-------+-------------------------------+
| true  | exec.errors.verbose updated.  |
+-------+-------------------------------+
1 row selected (0.144 seconds)
Then that znodes will show:
ls /drill/sys.options
[exec.errors.verbose]


No comments:

Post a Comment

Popular Posts