hue整合zookeeper thrift server查看znodes

Query. Explore. Repeat.
Hue is an open source smart Analytics Workbench.
http://gethue.com/
Apache ZooKeeper is an effort to develop and maintain an open-source server which enables highly reliable distributed coordination.
http://zookeeper.apache.org/
需要用到的zookeeper源码https://github.com/apache/zookeeper/tree/master/src/contrib/rest
hue和zookeeper安装过程略

zookeeper thrift server

下载已发布版本的源码或者直接clone git上的源码
事先启动zookeeper集群
修改配置文件,添加zookeeper地址
查看或修改zookeeper thrift server的端口号,默认9998

1
2
3
4
5
6
7
8
9
10
git clone https://github.com/apache/zookeeper.git
tar zxvf zookeeper
cd zookeeper/src/contrib/rest
vi conf/rest.properties
......
rest.port = 9998

# plain configuration <context-path>;<host-port>
rest.endpoint.1 = /;bigdata-master:2181,bigdata-slave-1:2181,bigdata-slave-2:2181
......

ant run编译运行,首次运行会下载需要的依赖包
后续运行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# ant run
Buildfile: /bigdata/zookeeper-3.4.5/contrib/rest/zookeeper/src/contrib/rest/build.xml

checkMainIsAvailable:

checkMainCompiled:

setjarname:

check-contrib:

init:
[echo] contrib: rest

init-contrib:

ivy-download:

ivy-init:

ivy-retrieve:
[ivy:retrieve] :: Apache Ivy 2.4.0 - 20141213170938 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: file = /bigdata/zookeeper-3.4.5/contrib/rest/zookeeper/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: org.apache.zookeeper#rest;dev
[ivy:retrieve] confs: [default]
[ivy:retrieve] found org.slf4j#slf4j-api;1.7.5 in maven2
[ivy:retrieve] found org.slf4j#slf4j-log4j12;1.7.5 in maven2
[ivy:retrieve] found log4j#log4j;1.2.17 in maven2
[ivy:retrieve] found asm#asm;3.1 in maven2
[ivy:retrieve] found com.sun.grizzly#grizzly-servlet-webserver;1.9.8 in maven2
[ivy:retrieve] found com.sun.grizzly#grizzly-http;1.9.8 in maven2
[ivy:retrieve] found com.sun.grizzly#grizzly-framework;1.9.8 in maven2
[ivy:retrieve] found com.sun.grizzly#grizzly-utils;1.9.8 in maven2
[ivy:retrieve] found com.sun.grizzly#grizzly-rcm;1.9.8 in maven2
[ivy:retrieve] found com.sun.grizzly#grizzly-portunif;1.9.8 in maven2
[ivy:retrieve] found com.sun.grizzly#grizzly-http-servlet;1.9.8 in maven2
[ivy:retrieve] found javax.servlet#servlet-api;2.5 in maven2
[ivy:retrieve] found com.sun.jersey#jersey-server;1.1.5.1 in maven2
[ivy:retrieve] found com.sun.jersey#jersey-core;1.1.5.1 in maven2
[ivy:retrieve] found javax.ws.rs#jsr311-api;1.1.1 in maven2
[ivy:retrieve] found com.sun.jersey#jersey-json;1.1.5.1 in maven2
[ivy:retrieve] found org.codehaus.jettison#jettison;1.1 in maven2
[ivy:retrieve] found stax#stax-api;1.0.1 in maven2
[ivy:retrieve] found com.sun.xml.bind#jaxb-impl;2.1.12 in maven2
[ivy:retrieve] found javax.xml.bind#jaxb-api;2.1 in maven2
[ivy:retrieve] found javax.xml.stream#stax-api;1.0-2 in maven2
[ivy:retrieve] found javax.activation#activation;1.1 in maven2
[ivy:retrieve] found org.codehaus.jackson#jackson-core-asl;1.1.1 in maven2
[ivy:retrieve] :: resolution report :: resolve 603ms :: artifacts dl 33ms
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 23 | 0 | 0 | 0 || 23 | 0 |
---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: org.apache.zookeeper#rest
[ivy:retrieve] confs: [default]
[ivy:retrieve] 0 artifacts copied, 14 already retrieved (0kB/11ms)
[ivy:retrieve] :: retrieving :: org.apache.zookeeper#rest
[ivy:retrieve] confs: [default]
[ivy:retrieve] 0 artifacts copied, 9 already retrieved (0kB/7ms)

zookeeperbuildcontrib.compile:
[echo] contrib: rest
[javac] /bigdata/zookeeper-3.4.5/contrib/rest/zookeeper/src/contrib/build-contrib.xml:125: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

compile:

jar:
[echo] contrib: rest

run:
[echo] contrib: rest
[java] Starting grizzly ...
[java] Started / - WADL: http://localhost:9998/application.wadl
[java] Server started.

hue配置重启查看

手动安装的hue修改hue的配置文件hue.ini
ambari-hdp集成的hue修改hue-zookeeper-site.xml

hue.ini或者新版本的pseudo-distributed.ini

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[zookeeper]

[[clusters]]

[[[default]]]
# Zookeeper ensemble. Comma separated list of Host/Port.
# e.g. localhost:2181,localhost:2182,localhost:2183
host_ports=bigdata-master:2181,bigdata-slave-1:2181,bigdata-slave-2:2181

# The URL of the REST contrib service (required for znode browsing).
rest_url=http://bigdata-master:9998

# Name of Kerberos principal when using security.
## principal_name=zookeeper

hue-zookeeper-site.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<property>
<name>host_ports</name>
<value>{{zookeeper_host_port}}</value>
<display-name>Host Ports</display-name>
<description>Zookeeper ensemble. Comma separated list of Host/Port. e.g. localhost:2181,localhost:2182,localhost:2183</description>
<on-ambari-upgrade add="true"/>
</property>

<property>
<name>rest_url</name>
<value>{{rest_url}}</value>
<display-name>Rest URL</display-name>
<description>The URL of the REST contrib service (required for znode browsing)</description>
<on-ambari-upgrade add="true"/>
</property>

配置修改后重启hue,查看效果

image
image
image
image
image
image
image

邵志鹏 wechat
扫一扫上面的二维码关注我的公众号
0%