1. 程式人生 > >Kylin1.6在CDH下安裝部署

Kylin1.6在CDH下安裝部署

一、下載kylin
訪問URL:http://kylin.apache.org/cn/
下載檔案apache-kylin-1.6.0-cdh5.7-bin.tar.gz並上傳到opt目錄解壓
tar -zxvf apache-kylin-1.6.0-cdh5.7-bin.tar.gz
如果是5.5、5.7版本,也是下載for CDH 5.5/5.7/5.8 - apache-kylin-1.6.0-cdh5.7-bin.tar.gz

如果是HDP(ambari)的,下載:
for HBase 0.98 (includes HDP 2.2, CDH 5.2/5.3) - apache-kylin-1.6.0-bin.tar.gz
for HBase 1.x (includes HDP 2.3/2.4, EMR 5.0) - apache-kylin-1.6.0-hbase1.x-bin.tar.gz

以下是CDH環境操作,HDP類似。

二、配置Kylin
root使用者操作
vi /opt/apache-kylin-1.6.0-cdh5.7-bin/conf/kylin.properties

在檔案結尾新增如下內容:
kylin.rest.servers=IP:7070
kylin.job.jar=/tmp/kylin/kylin-job-latest.jar
kylin.coprocessor.local.jar=/tmp/kylin/kylin-coprocessor-latest.jar

三、新增環境變數
export JAVA_HOME=/usr/java/jdk1.8.0_65
exportCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
exportCATALINA_HOME=/opt/apache-tomcat-7.0.69
exportHADOOP_HOME=/opt/cloudera/parcels/CDH-5.7.5-1.cdh5.7.5.p0.3/lib/hadoop
export HBASE_HOME=/opt/cloudera/parcels/CDH-5.7.5-1.cdh5.7.5.p0.3/lib/hbase
exportHIVE_HOME=/opt/cloudera/parcels/CDH-5.7.5-1.cdh5.7.5.p0.3/lib/hive
exportKYLIN_HOME=/opt/apache-kylin-1.6.0-cdh5.7-bin
exportPATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$HBASE_HOME/bin:HIVE_HOME/bin:$PATH

提前安裝JDK和tomcat,這裡不敘述了。

source /etc/profile 生效

拷貝jar到/tmp/kylin目錄下(如果沒有對應的目錄則手工建立)

cp /opt/apache-kylin-1.6.0-cdh5.7-bin/lib/kylin-coprocessor-1.6.0.jar /tmp/kylin/kylin-coprocessor-latest.jar
cp /opt/apache-kylin-1.6.0-cdh5.7-bin/lib/kylin-job-1.6.0.jar /tmp/kylin/kylin-job-latest.jar

四、啟動及訪問kylin
./kylin.sh start  (啟動的時候可能會發生後面的問題)

最後輸出,表示啟動成功:
A new Kylin instance is started by root, stop it using "kylin.sh stop"
Please visit http://<ip>:7070/kylin
You can check the log at /opt/apache-kylin-1.6.0-cdh5.7-bin/logs/kylin.log

訪問kylin介面
http://ip:7070/kylin  使用者名稱密碼:ADMIN/KYLIN (大寫)

問題處理:
當執行 ./check_env.sh 或./kylin.sh start時遇到 mkdir: Permission denied: user=root, access=WRITE, inode="/":hdfs:supergroup:drwxr-xr-x
failed to create /kylin, Please make sure the user has right to access /kylin

解決方法:
預設會在HDFS上建立/kylin目錄,需要hdfs許可權
可以在check-env.sh中 將hadoop fs -mkdir -p $WORKING_DIR 變成 sudo -u hdfs hadoop fs -mkdir -p $WORKING_DIR,得以解決