kylin的编译与安装

一、下载kylin

git clone https://github.com/apache/kylin kylin

二、安装maven、nodejs

1.maven的安装参照百度,这里不再赘述

2.nodejs的安装参考http://www.runoob.com/nodejs/nodejs-install-setup.html

CentOS 下安装 Node.js
1、下载源码,你需要在https://nodejs.org/en/download/下载最新的Nodejs版本,本文以v0.10.24为例:
cd /usr/local/src/
wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
2、解压源码
tar zxvf node-v0.10.24.tar.gz
3、 编译安装
cd node-v0.10.24
./configure --prefix=/usr/local/node/0.10.24
make
make install
4、 配置NODE_HOME,进入profile编辑环境变量
vim /etc/profile
设置nodejs环境变量,在 export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL 一行的上面添加如下内容:
#set for nodejs
export NODE_HOME=/usr/local/node/0.10.24
export PATH=$NODE_HOME/bin:$PATH
:wq保存并退出,编译/etc/profile 使配置生效
source /etc/profile
验证是否安装配置成功
node -v
输出 v0.10.24 表示配置成功
npm模块安装路径
/usr/local/node/0.10.24/lib/node_modules/

三、编译kylin

1.解压kylin

tar -xzvf apache-kylin-2.1.0-src.tar.gz

2.编译kylin

apache-kylin-2.1.0/build/script
./package.sh -P cdh5.5.2
............等待编译中

3.出现如下问题,未成功编译

> phantomjs@1.9.20 install /home/hadoop/test/apache-kylin-2.1.0/webapp/node_modules/grunt-contrib/node_modules/grunt-contrib-jasmine/node_modules/grunt-lib-phantomjs/node_modules/phantomjs
> node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /home/hadoop/test/apache-kylin-2.1.0/webapp/node_modules/grunt-contrib/node_modules/grunt-contrib-jasmine/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...

Error making request.
Error: connect ECONNREFUSED
    at errnoException (net.js:901:11)
    at Object.afterConnect [as oncomplete] (net.js:892:19)

Please report this full log at https://github.com/Medium/phantomjs
npm http 304 https://registry.npmjs.org/hoek

> phantomjs@1.9.20 install /home/hadoop/test/apache-kylin-2.1.0/webapp/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs
> node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /home/hadoop/test/apache-kylin-2.1.0/webapp/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...


Error making request.
Error: connect ECONNREFUSED
    at errnoException (net.js:901:11)
    at Object.afterConnect [as oncomplete] (net.js:892:19)

Please report this full log at https://github.com/Medium/phantomjs
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/home/hadoop/test/apache-kylin-2.1.0/webapp/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs'
npm ERR! error rolling back  grunt-contrib@0.7.0 { [Error: ENOTEMPTY, rmdir '/home/hadoop/test/apache-kylin-2.1.0/webapp/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/home/hadoop/test/apache-kylin-2.1.0/webapp/node_modules/grunt-contrib/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs' }
npm ERR! phantomjs@1.9.20 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs@1.9.20 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-642.el6.x86_64
npm ERR! command "/usr/local/node/0.10.24/bin/node" "/usr/local/node/0.10.24/bin/npm" "install"
npm ERR! cwd /home/hadoop/test/apache-kylin-2.1.0/webapp
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/hadoop/test/apache-kylin-2.1.0/webapp/npm-debug.log
npm ERR! not ok code 0

问题解决办法:安装 PhantomJS 安装过程如下:

1.1下载PhantomJS参考:http://www.cnblogs.com/zengguowang/p/6911812.html
下载地址:https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
1.2解压
bzip2 -d phantomjs-2.1.1-linux-x86_64.tar.bz2
tar xvf phantomjs-2.1.1-linux-x86_64.tar -C /usr/local/
1.3安装依赖
安装依赖软件
yum -y install wget fontconfig
mv /usr/local/phantomjs-2.1.1-linux-x86_64/ /usr/local/phantomjs
1.4环境变量设置
vim /etc/profile
#set for phantomjs
PHANTOMJS_HOME=/usr/local/phantomjs
PATH=$PATH:$PHANTOMJS_HOME/bin
export PHANTOMJS_HOME PATH

source /etc/profile

1.5验证
phantomjs 

 继续编译:

./package.sh -P cdh5.5.2

 看到如下结果,表示编译成功:

 四、安装kylin

 4.1解压二进制包

# tar -xzvf apache-kylin-2.1.0-bin.tar.gz -C /opt​

4.2配置环境变量

导出环境变量KYLIN_HOME:
# vi /etc/profile
export KYLIN_HOME=/opt/apache-kylin-2.1.0-bin
# source /etc/profile
 
Kylin启动还需要配置HIVE_CONF、HCAT_HOME
# vi /opt/hadoopclient/Hive/component_env
export HIVE_CONF=/opt/hadoopclient/Hive/config
export HCAT_HOME=/opt/hadoopclient/Hive/HCatalog

4.2检查设置

Kylin检查环境设置:
# cd /opt/apache-kylin-2.1.0-bin/bin
# ./check-env.sh​

4.3修改kylin配置

Hive client使用beeline:
# vi /opt/apache-kylin-2.1.0-bin/conf/kylin.properties
kylin.hive.client=beeline
kylin.hive.beeline.params=-n root -u 'jdbc:hive2://162.1.93.103:24002,162.1.93.102:24002,162.1.93.101:24002/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;sasl.qop=auth-conf;auth=KERBEROS;principal=hive/hadoop.hadoop.com@HADOOP.COM'

4.4启动kylin

# ./kylin.sh start​

启动kylin失败!!,问题描述如下:

/kylin_metadata/lock
Exception in thread "main" java.lang.IllegalArgumentException: Failed to find metadata store by url: kylin_metadata@hbase
    at org.apache.kylin.common.persistence.ResourceStore.createResourceStore(ResourceStore.java:89)
    at org.apache.kylin.common.persistence.ResourceStore.getStore(ResourceStore.java:101)
    at org.apache.kylin.rest.service.AclTableMigrationTool.checkIfNeedMigrate(AclTableMigrationTool.java:94)
    at org.apache.kylin.tool.AclTableMigrationCLI.main(AclTableMigrationCLI.java:41)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.kylin.common.persistence.ResourceStore.createResourceStore(ResourceStore.java:83)
    ... 3 more
Caused by: java.lang.NoSuchMethodError: org.apache.hadoop.hbase.HTableDescriptor.addFamily(Lorg/apache/hadoop/hbase/HColumnDescriptor;)Lorg/apache/hadoop/hbase/HTableDescriptor;
    at org.apache.kylin.storage.hbase.HBaseConnection.createHTableIfNeeded(HBaseConnection.java:320)
    at org.apache.kylin.storage.hbase.HBaseResourceStore.createHTableIfNeeded(HBaseResourceStore.java:110)
    at org.apache.kylin.storage.hbase.HBaseResourceStore.<init>(HBaseResourceStore.java:91)
    ... 8 more
2017-10-18 16:53:46,956 INFO  [Thread-1] client.ConnectionManager$HConnectionImplementation:1705 : Closing zookeeper sessionid=0x35ec685fa820019
2017-10-18 16:53:46,962 INFO  [Thread-1] zookeeper.ZooKeeper:684 : Session: 0x35ec685fa820019 closed
2017-10-18 16:53:46,962 INFO  [main-EventThread] zookeeper.ClientCnxn:512 : EventThread shut down
2017-10-18 16:53:46,971 INFO  [Thread-6] zookeeper.ZooKeeper:684 : Session: 0x25ec685f9a60023 closed
2017-10-18 16:53:46,971 INFO  [main-EventThread] zookeeper.ClientCnxn:512 : EventThread shut down
ERROR: Unknown error. Please check full log.

问题解决办法:

 参考文章解决:http://blog.csdn.net/fz1989/article/details/52160827

社区问题的描述:https://issues.apache.org/jira/browse/KYLIN-1089

经过多方排查,发现是由于版本问题导致的,我之前的kylin版本是“apache-kylin-2.1.0-bin”,我的Hbase的版本是“hbase-1.2.0-cdh5.7.0‘’,最后我更换了kylin的版本为‘’apache-kylin-2.1.0-bin-cdh57”后,问题解决。

官方参考:http://kylin.apache.org/development/howto_package.html

默认用户名密码:ADMIN/KYLIN

4.5demo测试

# cd /opt/apache-kylin-2.1.0-bin/bin
# ./sample.sh
System -> Actions -> Reload Metadata

4.6构建cube

选择learn_kylin工程,构建默认的kylin_sales_cube​   Cube构建成功,状态变为READY​

4.7查询

Insight页面执行查询

 

posted @ 2017-10-18 14:18  一醉方休  阅读(5511)  评论(0编辑  收藏  举报