apache atlas编译坑
简介
元数据管理是数仓的重要组成部门,一直在寻找一个开源的元数据管理系统,知道遇见apache atlas。
网上碰到的教程让我欣喜若狂,知道自己上手,遇到一堆坑。这篇文章写在上手的第三天,希望能帮到现在以及以后遇到这些坑的同学,对现在网上那些教程的作者致以崇高的鄙视。
apache atlas的编译严重依赖网络速度,或者说网络速度是编译成功的关键。apache atlas的所有依赖的jar包和需要的软件都是外网资源,这两部分都可以换成内网的资源。这边文章也只将怎么替换外网资源。
maven配置
怎么部署maven不在描述,我是在centos7下部署,大家自己在网上找教程解决吧。我贴一下我的mirrors,请修改配置文件,加上我的这部分配置。
// An highlighted block
<mirrors>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
<mirror>
<id>aliyunmaven</id>
<mirrorOf>central</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/central</url>
</mirror>
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>central repo</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<mirror>
<id>maven</id>
<name>central maven</name>
<url>http://central.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>aliyunmaven</id>
<mirrorOf>apache snapshots</mirrorOf>
<name>阿里云阿帕奇仓库</name>
<url>https://maven.aliyun.com/repository/apache-snapshots</url>
</mirror>
<mirror>
<id>maven.mirrorid</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
</mirrors>
frontend-maven-plugin配置
apache atlas配置需要用到node和npm,这两个资源也需要外网下载,多次下载都不成功,也需要改成国内资源。
修改的文件是dashboardv2/pom.xml。修改地方参见下面。
// An highlighted block
var foo = 'bar';<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>${node-for-v2.version}</nodeVersion>
<npmVersion>${npm-for-v2.version}</npmVersion>
<nodeDownloadRoot>https://npm.taobao.org/mirrors/node/</nodeDownloadRoot>
<npmDownloadRoot>https://registry.npm.taobao.org/npm/-/</npmDownloadRoot>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>grunt dist</id>
<goals>
<goal>grunt</goal>
</goals>
<configuration>
<arguments>${project.build.dashboardv2.gruntBuild}</arguments>
</configuration>
</execution>
需要新增下面两行:
// An highlighted block
<nodeDownloadRoot>https://npm.taobao.org/mirrors/node/</nodeDownloadRoot>
<npmDownloadRoot>https://registry.npm.taobao.org/npm/-/</npmDownloadRoot>
这两个地址在你编译的时候是否有效不可知,大家用的时候可以用浏览器打开试试。
maven-site-plugin插件配置
maven site插件需要用到项目目录下pom.xml的配置:
// An highlighted block
<repository>
<id>typesafe</id>
<name>Typesafe Repository</name>
<url>https://repo.typesafe.com/typesafe/releases/</url>
</repository>
可惜这个网址也访问不了,需要找到替换方案,请教同事,改成如下方案:
// An highlighted block
<repository>
<id>typesafe</id>
<name>Typesafe Repository</name>
<url>http://dl.bintray.com/typesafe</url>
</repository>
结语
这篇文章只记录了我编译的时候遇到的一些网络问题,不一定包含大家编译会遇到的网络问题。
希望大家编译顺利。