0


doris 15 详细docker 编译 以及drois-flink的编译

1. 编译对应的版本

https://doris.apache.org/master/zh-CN/installing/compilation.html

这里选择 docker15 编译

2.docker 拉去镜像

[[email protected]~]# docker pull apache/incubator-doris:build-env-for-0.15.0
build-env-for-0.15.0:Pulling from apache/incubator-doris
61ccbfd87592:Pull complete 
Digest: sha256:adadb9d5bd96182e292d6d770aa46ef5e9c8533136c97b08feba670b79c7240c
Status:Downloaded newer image for apache/incubator-doris:build-env-for-0.15.0
docker.io/apache/incubator-doris:build-env-for-0.15.0[[email protected]~]# 

3. 下载源码

wget https://dlcdn.apache.org/incubator/doris/0.15.0-incubating/apache-doris-0.15.0-incubating-src.tar.gz
[[email protected] doris]# wget https://dlcdn.apache.org/incubator/doris/0.15.0-incubating/apache-doris-0.15.0-incubating-src.tar.gz
--2021-12-3123:15:05--  https://dlcdn.apache.org/incubator/doris/0.15.0-incubating/apache-doris-0.15.0-incubating-src.tar.gz
正在解析主机 dlcdn.apache.org (dlcdn.apache.org)...151.101.2.132,2a04:4e42::644
正在连接 dlcdn.apache.org (dlcdn.apache.org)|151.101.2.132|:443... 已连接。
已发出 HTTP 请求,正在等待回应...200 OK
长度:15927142(15M)[application/x-gzip]
正在保存至: “apache-doris-0.15.0-incubating-src.tar.gz”

100%[=================================================================================================================================>]15,927,14227.7KB/s 用时 11m 6s 

2021-12-3123:26:16(23.4 KB/s)- 已保存 “apache-doris-0.15.0-incubating-src.tar.gz” [15927142/15927142])

jdk 切换

切换到 JDK 8:
$ alternatives --set java java-1.8.0-openjdk.x86_64
$ alternatives --set javac java-1.8.0-openjdk.x86_64
$ export JAVA_HOME=/usr/lib/jvm/java-1.8.0

切换到 JDK 11:

$ alternatives --set java java-11-openjdk.x86_64
$ alternatives --set javac java-11-openjdk.x86_64
$ export JAVA_HOME=/usr/lib/jvm/java-11

4.启动容器

需要做两个目录映射,一个是maven的repository目录,一个是doris源码目录,避免容器挂了之后之前下载或编译的内容丢失。

[[email protected] software]# docker ps
CONTAINER ID   IMAGE                                         COMMAND                  CREATED       STATUS       PORTS                                       NAMES
3c93ac03eb0d   apache/incubator-doris:build-env-for-0.15.0"/bin/bash"2 hours ago   Up2 hours                                               kind_bassi
d9bae370d24e   registry.cn-hangzhou.aliyuncs.com/anoy/yapi   "node server/app.js"8 weeks ago   Up3 hours   0.0.0.0:3001->3000/tcp,:::3001->3000/tcp   yapi
4e24002bbc34   mongo                                         "docker-entrypoint.s…"8 weeks ago   Up3 hours   27017/tcp                                   yapimongo
[[email protected] software]# 

# 启动容器
docker run -it -v /root/.m2:/root/.m2 -v /opt/software/doris/apache-doris-0.15.0-incubating-src:/opt/software/doris/apache-doris-0.15.0-incubating-src apache/incubator-doris:build-env-for-0.15.0

5.进入docker 容器目录,进行编译

cd  /opt/software/doris/apache-doris-0.15.0-incubating-src
sh build.sh

[INFO]ReactorSummary:[INFO][INFO] doris-fe-common 1.0.0.............................. SUCCESS [03:35 min][INFO] spark-dpp 1.0.0.................................... SUCCESS [10:38 min][INFO] fe-core 3.4.0...................................... SUCCESS [04:37 min][INFO]------------------------------------------------------------------------[INFO] BUILD SUCCESS
[INFO]------------------------------------------------------------------------[INFO]Total time:19:01 min
[INFO]Finished at:2021-12-31T16:29:02Z
[INFO]------------------------------------------------------------------------***************************************Successfully build Doris***************************************[[email protected] apache-doris-0.15.0-incubating-src]# 

以上的是doris的整体编译 需要注意的是drois 编译需要的jdk 是 jdk11

6.更改flink 版本 修改成 13.5

<properties><scala.version>2.12</scala.version><flink.version>1.13.5</flink.version><libthrift.version>0.13.0</libthrift.version><arrow.version>5.0.0</arrow.version><maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version><maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version><maven-source-plugin.version>3.2.1</maven-source-plugin.version><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><doris.home>${basedir}/../../</doris.home>

7.要将jdk 切回到1.8(docker容器里面操作)

alternatives --set java java-1.8.0-openjdk.x86_64
alternatives --set javac java-1.8.0-openjdk.x86_64
export JAVA_HOME=/usr/lib/jvm/java-1.8.0

8.编译 :doris-flink

执行命令

sh build.sh 或者mvn clean package

(docker容器里面操作)

[INFO]Building jar:/opt/software/doris/apache-doris-0.15.0-incubating-src/extension/flink-doris-connector/target/doris-flink-1.0-SNAPSHOT-javadoc.jar
[INFO]------------------------------------------------------------------------[INFO] BUILD SUCCESS
[INFO]------------------------------------------------------------------------[INFO]Total time:01:11 min
[INFO]Finished at:2021-12-31T17:27:26Z
[INFO]------------------------------------------------------------------------*****************************************Successfully build Flink-Doris-Connector*****************************************[[email protected] flink-doris-connector]# 

8.目录

映射的目录 的文件夹doris-flink-1.0-SNAPSHOT.jar ((docker容器里面或者外面对应的目录)

[[email protected] target]# ll
总用量 9328
drwxr-xr-x 3 root root    40961月   101:27 apidocs
drwxr-xr-x 5 root root      701月   101:26 classes
-rw-r--r--1 root root       11月   101:26 classes.-522306124.timestamp
-rw-r--r--1 root root 78023991月   101:26 doris-flink-1.0-SNAPSHOT.jar
-rw-r--r--1 root root  9676261月   101:27 doris-flink-1.0-SNAPSHOT-javadoc.jar
-rw-r--r--1 root root  1863121月   101:26 doris-flink-1.0-SNAPSHOT-sources.jar
drwxr-xr-x 4 root root      391月   101:26 generated-sources
drwxr-xr-x 3 root root      301月   101:26 generated-test-sources
-rw-r--r--1 root root   511021月   101:26 jacoco.exec
drwxr-xr-x 2 root root      711月   101:27 javadoc-bundle-options
drwxr-xr-x 2 root root      281月   101:26 maven-archiver
-rw-r--r--1 root root   187071月   101:27 maven-javadoc-plugin-stale-data.txt
drwxr-xr-x 3 root root      351月   101:26 maven-status
-rw-r--r--1 root root  5027051月   101:26 original-doris-flink-1.0-SNAPSHOT.jar
drwxr-xr-x 3 root root      201月   101:26 site
drwxr-xr-x 2 root root     1331月   101:26 surefire-reports
drwxr-xr-x 3 root root      171月   101:26 test-classes
-rw-r--r--1 root root       11月   101:26 test-classes.1885398542.timestamp
[[email protected] target]# pwd
/opt/software/doris/apache-doris-0.15.0-incubating-src/extension/flink-doris-connector/target
[[email protected] target]# 

下载地址:

https://download.csdn.net/download/wudonglianga/72644361
标签: docker flink apache

本文转载自: https://blog.csdn.net/wudonglianga/article/details/122263466
版权归原作者 wudl5566 所有, 如有侵权,请联系我们删除。

“doris 15 详细docker 编译 以及drois-flink的编译”的评论:

还没有评论