Atlas 开发环境部署

Atlas 官方编译文档:https://atlas.apache.org/#/BuildInstallation
Atlas 官方部署文档:https://atlas.apache.org/#/Installation

前提环境准备

组件 版本 国内镜像下载地址(华为)
Apache Atlas 2.2.0 Atlas 2.2.0
Maven 3.8.6 Maven 3.8.6
CentOS 7.9 CentOS 7.9

Atlas依赖组件版本表

依赖组件 版本 部署参考
JDK 8
Apache ZooKeeper 3.8.0
Apache Hadoop 3.3.4
Apache HBase 2.4.14
Kafka 3.2.1
ElasticSearch 6.8.15
Apache Hive 3.1.3

构建Apache Atlas

下载 Atlas 2.2.0 源码,并编译

mkdir -p /opt/software/atlas && mkdir -p /opt/module/
export ATLAS_VERSION=2.2.0
export ATLAS_HOME=/opt/module/atlas
cd /opt/software
wget https://repo.huaweicloud.com/apache/atlas/"${ATLAS_VERSION}"/apache-atlas-"${ATLAS_VERSION}"-sources.tar.gz
tar -xzvf apache-atlas-"${ATLAS_VERSION}"-server.tar.gz -C ./

# 创建软连接
ln -s apache-atlas-"${ATLAS_VERSION}" atlas
cd atlas

打包 Apache Atlas

使用嵌入式 Apache HBase 和 Apache Solr 打包 Apache Atlas

说明:使用嵌入的方式打包,可以很方便测试编译好的包是否可以正常运行。之后更换集群的Hbase、Solr、ES 只需要改动相关的配置就行。

修改版本信息,编译

mvn clean -DskipTests package -Pdist,embedded-hbase-solr -T 2C

Apache Atlas 包

Build 将创建以下文件,这些文件用于安装 Apache Atlas。

distro/target/apache-atlas-"${ATLAS_VERSION}"-bin.tar.gz
distro/target/apache-atlas-"${ATLAS_VERSION}"-hbase-hook.tar.gz
distro/target/apache-atlas-"${ATLAS_VERSION}"-hive-hook.gz
distro/target/apache-atlas-"${ATLAS_VERSION}"-kafka-hook.gz
distro/target/apache-atlas-"${ATLAS_VERSION}"-sources.tar.gz
# 解压这个包
distro/target/apache-atlas-"${ATLAS_VERSION}"-server.tar.gz
distro/target/apache-atlas-"${ATLAS_VERSION}"-sqoop-hook.tar.gz
distro/target/apache-atlas-"${ATLAS_VERSION}"-storm-hook.tar.gz

安装 & 启动 Apache Atlas

配置用户免密及权限

创建部署用户,并且一定要配置 sudo 免密。以创建 atlas 用户为例

# 创建用户需使用 root 登录
useradd atlas

# 添加密码
echo "atlas" | passwd --stdin atlas

# 配置 sudo 免密
sed -i '$aatlas  ALL=(ALL)  NOPASSWD: NOPASSWD: ALL' /etc/sudoers
sed -i 's/Defaults    requirett/#Defaults    requirett/g' /etc/sudoers


tar -xzvf apache-atlas-"${ATLAS_VERSION}"-server.tar.gz
cd apache-atlas-{project.version}
# 修改目录权限,使得部署用户对二进制包解压后的 apache-atlas-"${ATLAS_VERSION}" 目录有操作权限
chown -R atlas:atlas apache-atlas-"${ATLAS_VERSION}"

注意:

  • 因为任务执行服务是以 sudo -u {linux-user} 切换不同 linux 用户的方式来实现多租户运行作业,所以部署用户需要有 sudo 权限,而且是免密的。初学习者不理解的话,完全可以暂时忽略这一点
  • 如果发现 /etc/sudoers 文件中有 “Defaults requirett” 这行,也请注释掉

配置机器SSH免密登陆

由于安装的时候需要向不同机器发送资源,所以要求各台机器间能实现SSH免密登陆。配置免密登陆的步骤如下

su atlas

ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

启动Atlas

su atlas
# 内置模式必须使用 atlas用户启动
bin/atlas_start.py

创建数据和日志目录

修改 Atlas 配置脚本

创建 Atlas 的 Systemd Unit 文件

启动服务

systemctl daemon-reload  && systemctl enable consul && systemctl start consul

查看运行状态

systemctl status consul
  • 确保状态为Active: active (running) ,如果启动报错,使用 journalctl -u consul 查看日志
  • 重启 systemctl daemon-reload && systemctl restart consul

验证

  • 要验证 Apache Atlas 服务器是否已启动并正在运行,请运行 curl 命令,如下所示:
curl -u username:password http://localhost:21000/api/atlas/admin/version
    {"Description":"Metadata Management and Data Governance Platform over Hadoop","Version":"2.2.0","Name":"apache-atlas"}
  • 运行快速启动以加载示例模型和数据
bin/quick_start.py
Enter username for atlas :-
Enter password for atlas :-

基本操作

常见问题 Q&A:

编译Atlas 2.2.0 源码遇到的问题

一: 修改组件依赖 1.0 为2.2.0

<dependency>
    <groupId>org.apache.atlas</groupId>
    <artifactId>atlas-buildtools</artifactId>
    <version>2.2.0</version>
</dependency>
Logo

昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链

更多推荐