自定義CDH版本編譯apache kylin

因kylin官網(wǎng)發(fā)布的2.6.0版本中cdh版本為5.7.0 ,而我們測(cè)試環(huán)境和生產(chǎn)環(huán)境都是cdh5.16.1,所以需要自己調(diào)整cdh版本自己編譯。本文主要記錄編譯過(guò)程以及編譯過(guò)程中遇到的報(bào)錯(cuò),并記錄一些編譯技巧。

這里提供編譯過(guò)程中需要的一些安裝包,以及編譯后的一個(gè)maven本地倉(cāng)庫(kù)

鏈接:https://pan.baidu.com/s/1Jv5nQNpsk3yplxekVemYvQ

提取碼:zsr6

一、編譯環(huán)境

Vmware 虛擬機(jī) centos7.5

maven3.3.9

node-v12.16.3-linux-x64

bower

git

其中maven配置阿里云maven倉(cāng)庫(kù)

bower通過(guò)?npm install -g bower 來(lái)安裝

二、開始編譯

(2.1)解壓源碼

https://archive.apache.org/dist/kylin/apache-kylin-2.6.0/?上下載源碼包?apache-kylin-2.6.0-source-release.zip

上傳到服務(wù)器并解壓

(2.2)修改pom文件

(2.2.1)修改父工程pom文件中的cdh版本

修改pom文件中cdh的版本,因源碼中是cdh5.7.0版本的,而本次我們要編譯的是cdh5.16.1版本

(2.2.2)修改父pom文件中跳過(guò)doclint編譯

在pom文件中,properties標(biāo)簽中添加跳過(guò)doclint的配置:?<additionalparam>-Xdoclint:none</additionalparam>

(2.3)正式開始編譯

進(jìn)入源碼目錄:cd?/home/hadoop/sourcecode/apache-kylin-2.6.0

編譯命令:build/script/package.sh -Dmaven.test.skip -Pcdh5.16

(2.4)編譯過(guò)程中遇到的問(wèn)題

編譯過(guò)程中遇到幾類問(wèn)題:

第一類:pom文件中插件版本原因?qū)е戮幾g失敗

第二類:一些jar包因網(wǎng)絡(luò)原因下載不下來(lái)導(dǎo)致編譯失敗

第三類:服務(wù)器環(huán)境缺少相應(yīng)的包導(dǎo)致編譯失敗

(2.4.1)第一類問(wèn)題

在編譯module?engine-spark時(shí),出現(xiàn)以下錯(cuò)誤:

[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:4.4.0:compile (scala-compile-first) on project kylin-engine-spark: Execution scala-compile-first of goal net.alchim31.maven:scala-maven-plugin:4.4.0:compile failed.: CompileFailed -> [Help 1]

原因:這個(gè)是 scala-maven-plugin 這個(gè)插件版本不對(duì)導(dǎo)致的。因pom文件中沒(méi)有顯式指定插件的版本,這里就顯式指定一下,增加:<version>3.2.0</version>


(2.4.2)第二類問(wèn)題

因網(wǎng)絡(luò)原因下載不下來(lái)jar包,導(dǎo)致編譯失敗,這種問(wèn)題只能手動(dòng)將jar包下載下來(lái)后,安裝到maven本地倉(cāng)庫(kù)

[ERROR] Failed to execute goal on project kylin: Could not resolve dependencies for project org.apache.kylin:kylin:pom:2.6.0: Failed to collect dependencies at org.apache.hadoop:hadoop-common:jar:2.6.0-cdh5.16.1: Failed to read artifact descriptor for org.apache.hadoop:hadoop-common:jar:2.6.0-cdh5.16.1: Could not transfer artifact org.apache.hadoop:hadoop-common:pom:2.6.0-cdh5.16.1 from/to cloudera (https://repository.cloudera.com/artifactory/cloudera-repos/): GET request of: org/apache/hadoop/hadoop-common/2.6.0-cdh5.16.1/hadoop-common-2.6.0-cdh5.16.1.pom from cloudera failed: Read timed out -> [Help 1]

原因:缺少jar包 org.apache.hadoop:hadoop-common:jar:2.6.0-cdh5.16.1

[ERROR] Failed to execute goal on project kylin-engine-spark: Could not resolve dependencies for project org.apache.kylin:kylin-engine-spark:jar:2.6.0: Failed to collect dependencies at org.apache.hbase:hbase-server:jar:1.2.0-cdh5.16.1: Failed to read artifact descriptor for org.apache.hbase:hbase-server:jar:1.2.0-cdh5.16.1: Could not transfer artifact org.apache.hbase:hbase-server:pom:1.2.0-cdh5.16.1 from/to cloudera (https://repository.cloudera.com/artifactory/cloudera-repos/): Connection reset -> [Help 1]

原因:缺少jar包 org.apache.hbase:hbase-server:jar:1.2.0-cdh5.16.1

[ERROR] Failed to execute goal on project kylin-server-base: Could not resolve dependencies for project org.apache.kylin:kylin-server-base:jar:2.6.0: Failed to collect dependencies at org.springframework.security.extensions:spring-security-saml2-core:jar:1.0.2.RELEASE -> org.opensaml:opensaml:jar:2.6.6: Failed to read artifact descriptor for org.opensaml:opensaml:jar:2.6.6: Could not transfer artifact org.opensaml:opensaml:pom:2.6.6 from/to spring-snapshots (http://repo.spring.io/libs-snapshot): Access denied to: http://repo.spring.io/libs-snapshot/org/opensaml/opensaml/2.6.6/opensaml-2.6.6.pom , ReasonPhrase:Forbidden. -> [Help 1]

原因:缺少jar包 org.opensaml:opensaml:jar:2.6.6

[ERROR] Failed to execute goal on project kylin-server-base: Could not resolve dependencies for project org.apache.kylin:kylin-server-base:jar:2.6.0: Failed to collect dependencies at org.springframework.security.extensions:spring-security-saml2-core:jar:1.0.2.RELEASE -> org.opensaml:opensaml:jar:2.6.6: Failed to read artifact descriptor for org.opensaml:opensaml:jar:2.6.6: Could not transfer artifact net.shibboleth:parent-v2:pom:4 from/to spring-snapshots (http://repo.spring.io/libs-snapshot): Access denied to: http://repo.spring.io/libs-snapshot/net/shibboleth/parent-v2/4/parent-v2-4.pom , ReasonPhrase:Forbidden. -> [Help 1]

原因:缺少父pom net.shibboleth:parent-v2:pom:4

[ERROR] Failed to execute goal on project kylin-server-base: Could not resolve dependencies for project org.apache.kylin:kylin-server-base:jar:2.6.0: Failed to collect dependencies at org.springframework.security.extensions:spring-security-saml2-core:jar:1.0.2.RELEASE -> org.opensaml:opensaml:jar:2.6.6 -> org.opensaml:openws:jar:1.5.6: Failed to read artifact descriptor for org.opensaml:openws:jar:1.5.6: Could not transfer artifact org.opensaml:openws:pom:1.5.6 from/to spring-snapshots (http://repo.spring.io/libs-snapshot): Access denied to: http://repo.spring.io/libs-snapshot/org/opensaml/openws/1.5.6/openws-1.5.6.pom , ReasonPhrase:Forbidden. -> [Help 1]

原因:缺少jar包 org.opensaml:openws:jar:1.5.6

[ERROR] Failed to execute goal on project kylin-server-base: Could not resolve dependencies for project org.apache.kylin:kylin-server-base:jar:2.6.0: Failed to collect dependencies at org.springframework.security.extensions:spring-security-saml2-core:jar:1.0.2.RELEASE -> org.opensaml:opensaml:jar:2.6.6 -> org.opensaml:openws:jar:1.5.6 -> org.opensaml:xmltooling:jar:1.4.6: Failed to read artifact descriptor for org.opensaml:xmltooling:jar:1.4.6: Could not transfer artifact org.opensaml:xmltooling:pom:1.4.6 from/to spring-snapshots (http://repo.spring.io/libs-snapshot): Access denied to: http://repo.spring.io/libs-snapshot/org/opensaml/xmltooling/1.4.6/xmltooling-1.4.6.pom , ReasonPhrase:Forbidden. -> [Help 1]

原因:缺少jar包 org.opensaml:xmltooling:jar:1.4.6

bower angular-underscore#~0.5.0 resolved https://github.com/floydsoft/angular-underscore.git#0.5.0

bower sweetalert#>=0.3.0? ? ? ? ? ? ? ? ? ? ECONNREFUSED Request to https://registry.bower.io/packages/sweetalert failed: connect ECONNREFUSED 104.31.72.212:443

原因:ping 104.31.72.212 能ping通? ? ? ? ? ?telnet 104.31.72.212 443 也能連上? ? 估計(jì)是網(wǎng)絡(luò)問(wèn)題? 重試即可

(2.4.3)第三類問(wèn)題

服務(wù)器環(huán)境缺少相應(yīng)的包導(dǎo)致編譯失敗

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 /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2

Receiving...

? [========================================] 100%

Received 12854K total.

Extracting tar contents (via spawned process)

Error extracting archive

Phantom installation failed Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2

tar (child): bzip2:無(wú)法 exec: 沒(méi)有那個(gè)文件或目錄

tar (child): Error is not recoverable: exiting now

tar: Child returned status 2

tar: Error is not recoverable: exiting now

? ? at ChildProcess.exithandler (child_process.js:303:12)

? ? at ChildProcess.emit (events.js:310:20)

? ? at maybeClose (internal/child_process.js:1021:16)

? ? at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {

? killed: false,

? code: 2,

? signal: null,

? cmd: 'tar jxf /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2'

} Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2

tar (child): bzip2:無(wú)法 exec: 沒(méi)有那個(gè)文件或目錄

tar (child): Error is not recoverable: exiting now

tar: Child returned status 2

tar: Error is not recoverable: exiting now

? ? at ChildProcess.exithandler (child_process.js:303:12)

? ? at ChildProcess.emit (events.js:310:20)

? ? at maybeClose (internal/child_process.js:1021:16)

? ? at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

原因:看日志里面是通過(guò)命令:tar jxf /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2來(lái)去解壓的

這個(gè)是我的服務(wù)器上沒(méi)有安裝bzip2的包,用 yum install -y bzip2 安裝一下即可

備注:日志中出現(xiàn)下載https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2,網(wǎng)絡(luò)還算給力,能夠下下來(lái),如果出現(xiàn)下載失敗的情況,可以手動(dòng)下載后上傳到對(duì)應(yīng)的目錄


Done, without errors.

no binary file found

build/script/download-tomcat.sh:行36: wget: 未找到命令

Download tomcat failed

tar (child): build/apache-tomcat-7.0.91.tar.gz:無(wú)法 open: 沒(méi)有那個(gè)文件或目錄

tar (child): Error is not recoverable: exiting now

tar: Child returned status 2

tar: Error is not recoverable: exiting now

mv: 無(wú)法獲取"build/apache-tomcat-7.0.91" 的文件狀態(tài)(stat): 沒(méi)有那個(gè)文件或目錄

mv: 無(wú)法獲取"build/tomcat/conf/server.xml" 的文件狀態(tài)(stat): 沒(méi)有那個(gè)文件或目錄

cp: 無(wú)法創(chuàng)建普通文件"build/tomcat/conf/server.xml": 沒(méi)有那個(gè)文件或目錄

cp: 無(wú)法創(chuàng)建普通文件"build/tomcat/conf/server.xml.init": 沒(méi)有那個(gè)文件或目錄

server.xml overwritten...

mv: 無(wú)法獲取"build/tomcat/conf/context.xml" 的文件狀態(tài)(stat): 沒(méi)有那個(gè)文件或目錄

cp: 無(wú)法創(chuàng)建普通文件"build/tomcat/conf/context.xml": 沒(méi)有那個(gè)文件或目錄

context.xml overwritten...

cp: 無(wú)法獲取"build/tomcat/conf/catalina.properties" 的文件狀態(tài)(stat): 沒(méi)有那個(gè)文件或目錄

sed:無(wú)法讀取 build/tomcat/conf/catalina.properties:沒(méi)有那個(gè)文件或目錄

sed:無(wú)法讀取 build/tomcat/conf/catalina.properties:沒(méi)有那個(gè)文件或目錄

catalina.properties overwritten...

version 2.6.0

cp: 無(wú)法創(chuàng)建普通文件"build/tomcat/lib/kylin-tomcat-ext-2.6.0.jar": 沒(méi)有那個(gè)文件或目錄

chmod: 無(wú)法訪問(wèn)"build/tomcat/lib/kylin-tomcat-ext-2.6.0.jar": 沒(méi)有那個(gè)文件或目錄

原因:wget命令未找到 導(dǎo)致無(wú)法下載tomcat 需要安裝一下 yum install -y wget

三、編譯技巧

在apache-kylin-2.6.0/build/script包下有2個(gè)download的shell腳本

從download-spark.sh中可以看出會(huì)去下載spark包:http://archive.apache.org/dist/spark/spark-2.3.2/spark-2.3.2-bin-hadoop2.7.tgz到?apache-kylin-2.6.0/build目錄下

從download-tomcat.sh中可以看出會(huì)去下載tomcat包:http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.91/bin/apache-tomcat-7.0.91.tar.gz到apache-kylin-2.6.0/build目錄下

這種可以提前下載好上傳到對(duì)應(yīng)目錄下,可以避免編譯時(shí)間過(guò)長(zhǎng),或者因網(wǎng)絡(luò)原因?qū)е率?/p>

四、編譯成功

當(dāng)看到日志:Package ready: dist/apache-kylin-2.6.0-bin.tar.gz就表示編譯成功了

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容