- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想创建一个通过 Amazon EMR 上的 Airflow 触发的 emr 集群。 emr 集群显示在 Amazon EMR 的 UI 中,但有一条错误消息:“VPC/子网配置无效:需要子网:指定的实例类型 m5.xlarge 只能在 VPC 中使用”
下面是 Airflow 脚本中使用的此任务的代码片段和 json
格式的配置详细信息。
我的问题是如何将有关 VPC 和子网的信息(id 代码)合并到 json 中(如果可能的话)?那里没有明确的例子。
提示:网络和 EC2 子网已经创建
JOB_FLOW_OVERRIDES = {
"Name": "sentiment_analysis",
"ReleaseLabel": "emr-5.33.0",
"Applications": [{"Name": "Hadoop"}, {"Name": "Spark"}], # We want our EMR cluster to have HDFS and Spark
"Configurations": [
{
"Classification": "spark-env",
"Configurations": [
{
"Classification": "export",
"Properties": {"PYSPARK_PYTHON": "/usr/bin/python3"}, # by default EMR uses py2, change it to py3
}
],
}
],
"Instances": {
"InstanceGroups": [
{
"Name": "Master node",
"Market": "SPOT",
"InstanceRole": "MASTER",
"InstanceType": "m5.xlarge",
"InstanceCount": 1,
},
{
"Name": "Core - 2",
"Market": "SPOT", # Spot instances are a "use as available" instances
"InstanceRole": "CORE",
"InstanceType": "m5.xlarge",
"InstanceCount": 2,
},
],
"KeepJobFlowAliveWhenNoSteps": True,
"TerminationProtected": False, # this lets us programmatically terminate the cluster
},
"JobFlowRole": "EMR_EC2_DefaultRole",
"ServiceRole": "EMR_DefaultRole",
}
create_emr_cluster = EmrCreateJobFlowOperator(
task_id="create_emr_cluster",
job_flow_overrides=JOB_FLOW_OVERRIDES,
aws_conn_id="aws_default",
emr_conn_id="emr_default",
dag=dag,
)
最佳答案
EmrCreateJobFlowOperator 从 emr.py 调用 create_job_flow
与 boto3 emr client 中的相同 api 匹配.
因此,您可以将带有子网 ID 的项目 "Ec2SubnetId"
作为 "Instances"
字典中的值。
这对我适用于 Apache Airflow 2.0.2
关于python - Airflow/Amazon EMR : The VPC/subnet configuration was invalid: Subnet is required : The specified instance type m5. xlarge 只能在VPC中使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67229386/
我在 dev vpc 中有一个 aws eks 集群,现在我在 test-vpc 中有几个 ec2 实例,所以现在我需要将 add test-vpc 实例添加到现有的现有集群中。我们可以吗? ? 仅供
我正在尝试使用 GCP 在我的项目网络和另一个项目之间配置 VPC 对等互连,但是我做不到,因为我没有在另一个项目上列出网络的权限。 resource "google_compute_network"
我想删除一个我不知道它是如何存在的 AWS VPC。当我尝试在 AWS 控制台中删除它时,它说: We could not delete the following VPC (vpc-0a72ac71
我正在为相应的 VPC 服务端点设置 VPC 端点。 我们的应用程序使用非区域或 特定于区域的名称(路由到 VPCe)。 我们在 VPCe 上设置了 3 个应用子网(对应 3 个 可用区 us-wes
在谷歌云上,我设置了三个新项目——开发、研究和生产。因此,然后创建了一个共享 VPC 主机和上面列出的三个服务项目。还打算为这些服务项目中的每一个提供单独的 VPC(以添加更多安全层),因此也打算现在
当尝试将服务项目中的 VPC 连接器与另一个项目(来自同一组织)中的共享 VPC 子网关联时,会出现以下错误: Unknown error. Original error message: Opera
我应该使用 AWS 默认 VPC,还是应该创建一个新 VPC? 创建一个新的有什么区别和优势? 或者,在女巫的情况下,我应该在两者之间进行选择吗? 最佳答案 默认 VPC 是公共(public) VP
创建 VPC 后,我如何通过 aws ec2 describe-vpcs 从特定 VPC 中 grep 只有 1 个 VPC-ID,以便 VPC ID 可以在下一步的脚本中传递,我知道我可以从该命令手
假设我有三个环境——开发、测试和生产。我相信我有两个关于如何在 AWS 中设置它们的选项: 每个环境创建一个 VPC,因此总共三个 VPC。然后在每个 VPC 中添加不同可用性区域中的子网以实现可用性
如何在现有 VPC 和子网之间执行 VPC 对等互连? 我有两个 VPC CIDR。第一个是 192.168.0.0/16,第二个是 10.0.0.0/16,现有子网 CIDR 192.168.1.0
我有一个组织帐户,其下有多个托管帐户。每个管理账户中都有多个 VPC。每个托管帐户中的一个 VPC 将具有“ServiceName”:“True”标签,而该帐户中的其他 VPC 将具有“Service
我对 AWS 很陌生,我正在尝试从云形成中启动一个安全组:我的参数中有这个 NetworkStackName: Description: "Network Stack Name which
我正在将我的 CDK 堆栈从 0.30.0 移植到 0.39.0。我的 AWS 账户有一个预定义的 VPC,我只是将它导入到堆栈中。相同的子网在 0.30.0 中工作正常,但我在 0.39.0 中收到
我正在尝试获取 PIV4_CIDR 对于给定的 VPC,首先使用 aws_vpcs 数据源识别 VPC 并从 ID 获取 CIDR - 是否可能? 只是一点背景知识,出于某种设计原因,我们在不同的 V
我正在使用数据资源 (Terraform .12) 在 vpc 中查找子网 ID 并最终创建 ec2 实例。 VPC 已成功创建,但出现以下错误: 错误:未找到 ID 为 vpc-03a7196723
如果我们在两端都有相同的 vpc cidr(不同的 aws 帐户)并且我们想要 VPC 对等,是否有任何解决方法?或者任何其他机制可以帮助我连接两个相同的 VPC CIDR 但在不同的 aws 帐户中
我在我的环境中遇到了一个问题。我有两个 VPC (A - B): - 一个 ec2 实例基于第一个 (VPC A)。- RDS基于第二个(VPC B)。 我有两个问题: 如何通过不同 VPC 中的 E
我有一个在 VPC 中运行的 lambda 函数。 我需要使用我拥有的服务名称在此 VPC 中创建一个终端节点。我已经创建了一个并通过控制台执行所有操作来测试 lambda 与服务的连接。但现在我需要
我一直致力于创建一个 VPC 对等连接,该连接可以使用 cloudformation 从 eu-west-1 与 us-east-1 进行对等。这是目前的云信息: AWSTemplateFormatV
我有一个具有 VPC 访问权限的 Elasticsearch 域(即没有公共(public)访问权限)。我想从另一个 VPC 中的实例访问终端节点。我已经在两个 VPC 之间创建了对等连接,但是由于无
我是一名优秀的程序员,十分优秀!