**Apache DolphinScheduler** 是一个分布式、可扩展的开源工作流编排平台,拥有强大的DAG可视化界面。DolphinScheduler 3.2.2 版本于2024年7月23号正式发布,您可以通过查阅官方文档来深入了解 DolphinScheduler 的架构和技术细节。本文重点介绍如何在Amazon Web Services 使用Terraform 脚本一键快速部署DolphinScheduler的**生产可用环境**。您可以联系亚马逊云科技或DolphinScheduler社区,加入 ***海豚调度&AWS用户交流群*** 联系管理员获取免费的AWS Workshop账号,体验完整的部署流程,并快速获取一个Dophinscheduler集群进行测试体验。
#### 部署脚本的核心架构细节:
整体架构:部署基于 EKS 容器化,部署完成后会提供一个公开可访问的 ELB 代理域名进行用户访问。

部署用于DolphinScheduler 的核心服务组件(全部由Terraform脚本进行部署):
- Serverless数据库:采用 [Amazon Aurora Serverless v2](https://aws.amazon.com/cn/rds/aurora/serverless/),支持弹性伸缩范围配置,默认范围为 2-16 ACUs,为系统提供弹性数据库能力。
- 持久化存储:使用[Amazon EFS](https://aws.amazon.com/cn/efs/) 提供[无服务器](https://aws.amazon.com/cn/serverless/?trk=cndc-detail)、弹性的持久化存储。
- 任务日志:默认启用远程任务日志存储,日志保存在 [Amazon S3](https://aws.amazon.com/cn/s3/) 中,支持任务级别日志的审阅。
- 依赖和文件管理:依赖项和文件管理存储在 S3 中。
- 命名空间管理:DolphinScheduler 的命名空间和节点扩展由 [Karpenter ](https://karpenter.sh/)自动管理。
以下详细说明如何快速进行DolphinScheduler部署
基础环境准备
- 获取Amazon Workshop 账户,进入workshop链接后点击OTP 输入个人邮箱进行登陆
.PNG")
.PNG")
.PNG")
##### 创建EC2虚拟机进行部署准备





- 为EC2 关联IAM 权限,为后续创建资源







- 更新EC2 IAM role


##### 进行部署前的环境准备

- 安装terraform
参考: https://developer.hashicorp.com/terraform/install#
```
sudo yum install -y yum-utils shadow-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
sudo yum -y install terraform
```
- 安装helm
参考:https://docs.aws.amazon.com/zh_cn/eks/latest/userguide/helm.html
```
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh
helm version | cut -d + -f 1
```
- 安装kubectl EKS(版本1.30)
参考:https://docs.aws.amazon.com/zh_cn/eks/latest/userguide/install-kubectl.html
```
curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/1.30.0/2024-05-12/bin/linux/amd64/kubectl
chmod +x ./kubectl
mkdir -p \$HOME/bin && cp ./kubectl \$HOME/bin/kubectl && export PATH=\$HOME/bin:\$PATH
kubectl version --client
```
#### 安装部署
- 下载部署源码并执行部署脚本:
```
cd /opt/
# clone source code
git clone https://github.com/SEZ9/terraform-dolphinscheduler.git
# update helm dependency
cd /opt/terraform-dolphinscheduler/helm-values/dolphinscheduler/
helm repo add bitnami https://charts.bitnami.com/bitnami
helm dependency update .
# Execute deployment
cd /opt/terraform-dolphinscheduler/
sh install.sh
```

等待执行完成 大约30-50分钟
#### 即刻体验
执行输出的kubectl 配置命令

获取dolphinscheduler访问地址
```
kubectl get ingress -n dolphinscheduler
NAME CLASS HOSTS ADDRESS PORTS AGE
dolphinscheduler alb * xxx.elb.amazonaws.com 80 89s
访问地址为:xxx.elb.amazonaws.com:12345/dolphinscheduler
```
