Apache Atlas 编译安装记录

Apache Atlas 编译安装记录,第1张

Apache Atlas 编译安装记录 1、环境准备

atlas现在是市场很受欢迎的数据管理工具,但是atlas的下载完是一个源码的项目,无法直接使用,所以要对源码进行编译(就是由源程序到目标程序的过程内含代码生成、代码集成、语法分析、词法分析、依赖下载)后才能安装使用。

linux

但是编译过程中要通过网络下载相应的依赖包,所以内网环境下的服务器暂时用不了,所以我采用的是腾讯云的云服务器。

JDK 8安装
  • 下载地址 https://www.oracle.com/java/technologies/downloads/#java8

  • 下载:jdk-8u311-linux-x64.rpm

  • 将安装文件通过宝塔面板传入云服务器目录

  • 使用root权限

su root 
  • 执行安装语句
rpm -ivh jdk-8u311-linux-x64.rpm
  • 验证
java -version

java version “1.8.0_311”
Java™ SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot™ 64-Bit Server VM (build 25.311-b11, mixed mode)

  • 配置环境变量
vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_311-amd64
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
source /etc/profile

验证

echo $JAVA_HOME

/usr/java/jdk1.8.0_311-amd64

maven 安装
  • 下载 官网地址: http://maven.apache.org/download.cgi
  • 安装包上传云服务器
  • tar -zxvf apache-maven-3.6.3-bin.tar.gz
  • 配置环境变量
vi /etc/profile
export MAVEN_HOME=/tmp/apache-maven-3.6.3
export PATH=$MAVEN_HOME/bin:$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
  • 刷新环境变量
source /etc/profile
  • 检查版本
mvn -v 
2、编译 编译文件通过国外的镜像下载很慢,我们接下来添加国内下载镜像,用来加快编译(下载依赖包)速度
vim /tmp/apache-maven-3.6.3/conf/settings.xml

在mirrors中添加一个国内镜像


    alimaven
    aliyun maven
    http://maven.aliyun.com/nexus/content/groups/public/
    central


  • maven在调配置文件的时候优先调用的是/root/.m2/(隐藏目录)下的内容
  • 创建/root/.m2目录一个然后将配置文件复制过去
[conf]# cp settings.xml /root/.m2/
下载atlas
  • 下载地址 https://atlas.apache.org/#/Downloads
解压
  • tar -zxvf apache-atlas-2.2.0-sources.tar.gz

  • pom.xml 文件中 标签要加配置:

compile 
  • 解决版本冲突的问题,将zookeeper和hbase等依赖的版本修改成自己环境一致(或兼容)的版本。同时考虑到需要使用国内的镜像网站下载镜像文件,hbase和solr版本要在https://mirrors.tuna.tsinghua.edu.cn/apache/中存在。
  • 比如hbase我们现在可以选择2.3.7版本,如果选择2.3.3,则无法找打路径

2.3.7
8.11.1
  • 在distro模块(子工程)中的pom文件修改hbase和solr的下载路径为清华大学的下载网址,下载速度会快很多
http://mirrors.tuna.tsinghua.edu.cn/apache/hbase/${hbase.version}/hbase-${hbase.version}-bin.tar.gz
http://mirrors.tuna.tsinghua.edu.cn/apache/lucene/solr/${solr.version}/solr-${solr.version}.tgz
编译/usr/apps/apache-atlas-sources-2.0.0文件
  • 首先将编译器的初始堆内存调大,在把最大堆内存调大,因为文件比较大,用的内存比较多
[apache-atlas-sources-2.2.0]# export MAVEN_OPTS="-Xms2g -Xmx2g"
  • 用maven清空测试程序的package,编译一个发布版本的包含hbase和solr的程序
[apache-atlas-sources-2.2.0]# mvn clean -DskipTests package -Pdist,embedded-hbase-solr
3、踩坑 3.1异常 No goals have been specified for this build
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy.
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:97)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[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/NoGoalSpecifiedException
解决
pom.xml 文件中  标签要加配置: compile 
3.2 Error creating assembly archive impala-hook
[INFO] Building tar: /tmp/apache-atlas-sources-2.2.0/distro/target/apache-atlas-2.2.0-hive-hook.tar.gz
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  07:42 min
[INFO] Finished at: 2021-12-29T16:08:19+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4.1:single (default) on project atlas-distro: Failed to create assembly: Error creating assembly archive impala-hook: You must set at least one file. -> [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/MojoExecutionException

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5685203.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存