打包日期:20190702
打包版本:master
操作系统:centos7 最小安装,内存建议4G以上
依赖软件:JDK8(版本不能太低,建议使用较新版本,本次使用jdk-8u211)
MAVEN3.6.1
- 系统换源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo #curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum clean all yum makecache
- 关闭防火墙
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
- 安装JDK
将jdk-8u211-linux-x64.tar.gz放到/opt/jdk目录下
cd /opt/jdk tar -zxvf jdk-8u211-linux-x64.tar.gz
配置环境变量 vi /etc/profile,在文件最后添加
export JAVA_HOME=/opt/myjdk/jdk1.8.0_211 export PATH=.:$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source /etc/profile
- 安装MAVEN
将apache-maven-3.6.1-bin.tar.gz放到/opt/maven目录下
cd /opt/maven tar -zxvf apache-maven-3.6.1-bin.tar.gz
配置环境变量 vi /etc/profile,在文件最后添加
export M2_HOME=/opt/maven/apache-maven-3.6.1 export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
source /etc/profile
修改MAVEN的配置 vi /opt/maven/apache-maven-3.6.1/conf/settings.xml
修改本地仓库位置
<localRepository>/opt/maven/localRepo</localRepository>
添加阿里源,<mirrors>标签下
<mirror> <id>nexus-aliyun</id> <mirrorOf>central</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror>
设置运行内存
vi /opt/maven/apache-maven-3.6.1/bin/mvn
MAVEN_OPTS="$MAVEN_OPTS -Xms512m -Xmx4096m"
- 安装系统依赖软件
yum -y install wget git
- 获取atlas源代码
通过git下载源代码
mkdir /opt/atlas cd /opt/atlas/ git clone https://github.com/apache/atlas.git # 根据需要切换想编译的分支或tag git checkout <branch> git checkout <tag>
- 切换工程内的源配置
为工程添加阿里
vi /opt/atlas/atlas/pom.xml
<repositories>
<repository>
<id>nexus-aliyun</id>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
配置npm下载路径,因为国内下载npm会有问题,所以需要配置成阿里源
dashboardv2/pom.xml
<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> <npmRegistryURL>https://registry.npm.taobao.org</npmRegistryURL> </configuration> </execution> <execution> <id>grunt dist</id> <goals> <goal>grunt</goal> </goals> <configuration> <arguments>${project.build.dashboardv2.gruntBuild}</arguments> </configuration> </execution> </executions> </plugin>
使用内置的hbase时,可能下载不到对应的版本。自己准备hbase安全包到对应目录。
修改下载脚本 distro/pom.xml
<configuration>
<target name="Download HBase">
<mkdir dir="${hbase.dir}" />
<mkdir dir="${project.basedir}/hbase" />
<!--get src="${hbase.tar}" dest="${project.basedir}/hbase/${hbase.folder}.tar.gz" usetimestamp="true" verbose="true" skipexisting="true" /-->
<untar src="${project.basedir}/hbase/${hbase.folder}.tar.gz" dest="${project.build.directory}/hbase.temp" compression="gzip" />
<copy todir="${hbase.dir}">
<fileset dir="${project.build.directory}/hbase.temp/${hbase.folder}">
<include name="**/*" />
</fileset>
</copy>
</target>
</configuration>
<target name="Download SOLR"> <mkdir dir="${solr.dir}" /> <mkdir dir="${project.basedir}/solr" /> <!--get src="${solr.tar}" dest="${project.basedir}/solr/${solr.folder}.tgz" usetimestamp="true" verbose="true" skipexisting="true" /--> <untar src="${project.basedir}/solr/${solr.folder}.tgz" dest="${project.build.directory}/solr.temp" compression="gzip" /> <copy todir="${solr.dir}"> <fileset dir="${project.build.directory}/solr.temp/${solr.folder}"> <include name="**/*" /> </fileset> </copy> </target>
- 编译atlas
选择内置的hbase和solr简化配置过程
cd /opt/atlas/atlas
mvn clean -DskipTests package -Pdist,embedded-hbase-solr
- 启动atlas
cd distro/target/apache-atlas-1.2.0-bin/apache-atlas-1.2.0/bin ./atlas_start.py
启动后访问http://ip:21000.启动时间会比较长,多等一会。
浙公网安备 33010602011771号