全程實操cdh5.14.4中集成安裝kylin2.4.1與使用測試

在cdh5.14.4安裝完成並排錯完成的狀況下,進行以下kylin安裝操做:html

一、實驗環境

三臺CentOS 7主機,IP地址java

  • 192.168.43.129 cm1
  • 192.168.43.130 cm2
  • 192.168.43.131 cm3

JDK版本:1.8.0_151
CDH版本:5.14.4
Kylin版本:2.4.1mysql

Mysql版本:5.6.34web

mysql-connector版本:mysql-connector-java-5.1.40sql

二、kylin下載shell

https://archive.apache.org/dist/kylin/  apache

從這裏下載須要的kylin版本vim

3. 建立目錄

mkdir /usr/local/apps
cd /usr/local/appsapp

4. 上傳並解壓/usr/local/apps目錄:

[root@cm1 apps]# tar -zxf apache-kylin-2.4.1-cdh57-bin.tar.gzoop

5. 創建軟鏈接

[root@cm1 apps]# ln -s apache-kylin-2.4.1-cdh57-bin kylin

6. 添加環境變量

vim /etc/profile
添加 :export KYLIN_HOME=/usr/local/apps/kylin

7. 環境變量生效

[root@cm1 apps]# source /etc/profile

8. 修改kylin.properties配置文件

cd /usr/local/apps/kylin/conf
vim kylin.properties

修改:
kylin.server.cluster-servers=192.168.43.129:7070

添加配置:
kylin.job.jar=/usr/local/apps/kylin/lib/kylin-job-2.4.1.jar
kylin.coprocessor.local.jar=/usr/local/apps/kylin/lib/kylin-coprocessor-2.4.1.jar
kylin.job.yarn.app.rest.check.status.url=http://192.168.43.129:8088/ws/v1/cluster/apps/${job_id}?anonymous=true

九、修改權限
su hdfs(切換到hdfs用戶)
hadoop fs -chmod 777 / (修改權限)
su (切換到root)

hdfs dfs -ls / (檢查權限)

能夠看到這一行drwxr-xr-x - root supergroup 0 2019-04-16 22:12 /kylin

十、kylin環境檢查

[root@cm1 bin]# cd /usr/local/apps/kylin/bin
[root@cm1 bin]# ./check-env.sh
Retrieving hadoop conf dir...
KYLIN_HOME is set to /usr/local/apps/kylin

[root@cm1 bin]# hdfs dfs -ls /
drwxr-xr-x - root supergroup 0 2017-09-01 10:23 /kylin

[root@cm1 bin]# ./find-hbase-dependency.sh
Retrieving hbase dependency...

[root@cm1 bin]# ./find-hive-dependency.sh
Retrieving hive dependency...

十一、啓動kylin
[root@cm1 kylin]# bin/kylin.sh start

關閉執行:

bin/kylin.sh stop

十二、訪問kylin日誌
[root@cm1 kylin]# tail 200 -f logs/kylin.out

1三、訪問kylin
http://192.168.43.129:7070/kylin/
User: ADMIN
Pass: KYLIN

登陸成功:

至此kylin安裝完成。 

1四、導入官方測試數據進行測試

執行命令

/usr/local/apps/kylin/bin

[root@cdh01 bin]# ./sample.sh

日誌倒數兩行

Sample cube is created successfully in project 'learn_kylin'.

Restart Kylin Server or click Web UI => System Tab => Reload Metadata to take effect

#這句話的意思是  例子cube已成成功建立在了  工程名稱叫'learn_kylin'裏面了

#重啓kylin或者經過webUI => System選項卡=> 從新導入元數據信息

 

查看Hive default庫中的表,多了五張表

hive> show tables;

OK

kylin_account

kylin_cal_dt

kylin_category_groupings

kylin_country

kylin_sales

t1

Time taken: 0.015 seconds, Fetched: 6 row(s)

hive>

1五、加載樣例數據

在System中點擊Reload Metadata從新加載元數據或者重啓kylin,以下圖:

導入成功以後,點擊Model出現下圖:

 

表示導入成功。

1六、Cube 構建

 點擊Cube的Actions現象---->再點擊Build

查看正在構建的cube任務,點擊monitor:

[root@cm1 ~]# hbase shell
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
19/05/24 15:51:13 INFO Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.0-cdh5.14.4, rUnknown, Tue Jun 12 04:00:36 PDT 2018

hbase(main):001:0> list
TABLE                                                                           
KYLIN_IVLJD570IG                                                                
KYLIN_IYHQO0FLT5                                                                
kylin_metadata                                                                  
3 row(s) in 0.4620 seconds

 

 

kylin構建自動轉化成mapreduce任務進行了:

 

1七、查詢構建好的Cube

select sum(KYLIN_SALES.PRICE) 
as price_sum,KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME,KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME 
from KYLIN_SALES inner join KYLIN_CATEGORY_GROUPINGS
on KYLIN_SALES.LEAF_CATEG_ID = KYLIN_CATEGORY_GROUPINGS.LEAF_CATEG_ID and 
KYLIN_SALES.LSTG_SITE_ID = KYLIN_CATEGORY_GROUPINGS.SITE_ID
group by KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME,KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME
order by KYLIN_CATEGORY_GROUPINGS.META_CATEG_NAME asc,KYLIN_CATEGORY_GROUPINGS.CATEG_LVL2_NAME desc

  

 

 

 後續kylin學習參考:

https://blog.csdn.net/a_drjiaoda/article/details/86530332#commentBox

http://www.mamicode.com/info-detail-2332910.html

https://www.cnblogs.com/sh425/p/5778992.html

相關文章
相關標籤/搜索