跟着Doris官网(官网:doris0.12.0)使用Docker镜像编译Doris0.12.0时遇到一些问题,记录一下~
一、编译Doris
1.下载Docker
选择Doris版本对应的镜像版本,这里我的Doris版本是0.12.0。
docker pull apachedoris/doris-dev:build-env-1.2
查看下载的镜像:
2.运行镜像
docker run -it apachedoris/doris-dev:build-env-1.2
3.下载doris源码
wget https://dist.apache.org/repos/dist/dev/incubator/doris/0.12.0-rc03/apache-doris-0.12.0-incubating-src.tar.gz
下载完成后解压源码包
tar -zxvf apache-doris-0.12.0-incubating-src.tar.gz
进入源码包,准备开始编译。
4.编译doris
sh ./build.sh
正常情况下,编译完成后,产出文件在 output/ 目录中,然而事情并没有那么顺利,在编译了半个小时后,报错了~~
5.报错:[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
编译到fe时报错,报错信息:
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.1.0/maven-clean-plugin-3.1.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.1.0/maven-clean-plugin-3.1.0.jar (30 kB at 31 kB/s)
Downloading from spring-plugins: https://repo.spring.io/plugins-release/net/sourceforge/czt/dev/cup-maven-plugin/1.6-cdh/cup-maven-plugin-1.6-cdh.pom
Downloading from central: https://repo.maven.apache.org/maven2/net/sourceforge/czt/dev/cup-maven-plugin/1.6-cdh/cup-maven-plugin-1.6-cdh.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.241 s
[INFO] Finished at: 2021-03-29T15:16:19Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin net.sourceforge.czt.dev:cup-maven-plugin:1.6-cdh or one of its dependencies could not be resolved: Failed to read artifact descriptor for net.sourceforge.czt.dev:cup-maven-plugin:jar:1.6-cdh: Could not transfer artifact net.sourceforge.czt.dev:cup-maven-plugin:pom:1.6-cdh from/to spring-plugins (https://repo.spring.io/plugins-release/): Authentication failed for https://repo.spring.io/plugins-release/net/sourceforge/czt/dev/cup-maven-plugin/1.6-cdh/cup-maven-plugin-1.6-cdh.pom 401 Unauthorized -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
看着是maven依赖出了问题
查阅github
发现fe/pom.xml 一些参数需要更改
69 <!-- for general repository -->
70 <profile>
71 <id>general-env</id>
72 <activation>
73 <property>
74 <name>!env.CUSTOM_MAVEN_REPO</name>
75 </property>
76 </activation>
77
78 <repositories>
79 <repository>
80 <id>central</id>
81 <name>central maven repo https</name>
82 <url>https://repo.maven.apache.org/maven2</url>
83 </repository>
84 <!-- for java-cup -->
85 <repository>
86 <id>cloudera-thirdparty</id>
87 <url>https://repository.cloudera.com/content/repositories/third-party/</url>
// 将上面两行配置**改为**下面两行**
<id>cloudera-public</id>
<url>https://repository.cloudera.com/artifactory/public/</url>
88 </repository>
89 <!-- for bdb je -->
90 <repository>
91 <id>oracleReleases</id>
92 <url>http://download.oracle.com/maven</url>
93 </repository>
94 </repositories>
95
96 <pluginRepositories>
97 <!-- for cup-maven-plugin -->
98 <pluginRepository>
99 <id>spring-plugins</id>
100 <url>https://repo.spring.io/plugins-release/</url>
// 将上面两行配置**改为**下面两行**
<id>cloudera-public</id>
<url>https://repository.cloudera.com/artifactory/public/</url>
101 </pluginRepository>
102 </pluginRepositories>
103 </profile>
需要修改的地方大致在第86行和第99行,修改完这两处后,再执行 sh ./build.sh 执行就OK了,开心~
进入 output
可以发现,fe和be就编译好了,接下来就可以进行安装了~
二、编译broker
如果有需要跟HDFS进行导入和导出操作时,需要安装broker,具体介绍可以看官网解释,同样broker也是需要编译的。
1.进入fs_brokers目录
运行 sh ./build.sh 编译完成后,同样会在当前目录下产出 output/ 文件夹,里面就是我们要的东西:
到此,所有的编译操作就完成了~
2.将编译好的文件从docker容器中 copy 到宿主机的当前目录上
➜ doris docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ff3714ae36af apachedoris/doris-dev:build-env-1.2 "/bin/bash" 27 hours ago Up 49 minutes suspicious_golick
➜ doris docker cp suspicious_golick:/root/opt/apache-doris-0.12.0 ./
结果: