溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Kylin, Mondrian, Saiku系統(tǒng)的整合

發(fā)布時間:2020-06-10 05:31:23 來源:網(wǎng)絡(luò) 閱讀:3513 作者:choulanlan 欄目:大數(shù)據(jù)

公司的olap用的cubes+mysql,性能有點落后了,所以最近研究一下kylin
參考有贊的這篇文章:
https://tech.youzan.com/kylin-mondrian-saiku/
原理看一下上面的文章,主要記錄一下整合的步驟

搭建

首先部署好kylin,具體步驟后續(xù)補充。
下載saiku最新版,解壓。
github上已經(jīng)有一個整合Kylin,Mondrian以及Saiku的項目(作者mustangore):
https://github.com/mustangore/kylin-mondrian-interaction
項目中有步驟,不過是英文的,解釋一下:

1.  進(jìn)入saiku下目錄: $SAIKU_HOME/tomcat/webapps/saiku/WEB-INF/lib/
2.  在當(dāng)前目錄加入kylin-jdbc.jar(在kylin的路徑下,/lib里面),
加入Mondrian 4.4 jar with Kylin dialect(在剛才github項目中/mondrian下),
加入新的Commons HTTPClient jar(在剛才的github項目中/saiku/commons-httpclient-3.1.jar),
刪除舊的Mondrian jar和Commons HTTPClient jar 
3.  啟動Saiku (_sh start-saiku.sh_)
4.  訪問 http://saiku-server:8080/
* 用戶名: admin
* 密碼: admin
5.   第一次登錄之前需要license認(rèn)證,認(rèn)證具體過程:
                    1、https://licensing.meteorite.bi/login 注冊賬號登錄。
                    2、創(chuàng)建公司記錄。
                    3、創(chuàng)建license。
                    4、將license下載到本地。
                    5、 http://saiku-server:8080/upload.html 將 下載的license文件上傳。上傳完畢之后即可登錄。
                    如圖:

Kylin, Mondrian, Saiku系統(tǒng)的整合

使用:

STEP1:編寫Mondrian Schema文件

<?xml version="1.0"?>
<Schema name="ad_schema">  
<Cube name="lxw1234_ad_cube2">  
    <!-- 事實表(fact table) -->  
    <Table name="AD_REPORT" />  
    <Dimension name="地域">  
        <Hierarchy hasAll="false">  
            <Table name="AD_REPORT"></Table>  
            <Level name="省份" column="PROVINCE" table="AD_REPORT"></Level>
            <Level name="城市" column="CITY" table="AD_REPORT"/>
        </Hierarchy> 
    </Dimension>  
    <Measure name="曝光數(shù)" column="IMP_PV" aggregator="sum" datatype="Integer" />
    <Measure name="唯一曝光數(shù)" column="COOKIEID_IMP" aggregator="distinct-count" datatype="Integer" />
    <Measure name="點擊數(shù)" column="CLK_PV" aggregator="sum" datatype="Integer" />
    <Measure name="唯一點擊數(shù)" column="COOKIEID_CLK" aggregator="distinct-count" datatype="Integer" />
</Cube>  
</Schema>

STEP2:添加Kylin數(shù)據(jù)源

Kylin, Mondrian, Saiku系統(tǒng)的整合

進(jìn)入Saiku管理控制臺,點擊”Add Schema”,將編寫好Schema文件上傳。
接著點擊”Add Data Source”,添加數(shù)據(jù)源:

  • Name: Kylin Data Source
  • Connection Type: Mondrian
  • URL: jdbc:kylin://{your_kylin_url}:7070/{your_project_name}
  • Schema: {your_mondrian_schema}
  • JDBC:org.apache.kylin.jdbc.Driver
  • Username: {your_kylin_username} (缺省: admin)
  • Password: {your_kylin_password} (缺省: KYLIN)

Kylin, Mondrian, Saiku系統(tǒng)的整合

STEP3:創(chuàng)建查詢

回到Saiku Home主頁,點擊”Create a new query”,創(chuàng)建查詢:

Kylin, Mondrian, Saiku系統(tǒng)的整合

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI