【发布时间】:2023-03-06 07:49:01
【问题描述】:
通常通过 emrfs-site.xml 启用 emrfs 一致性 http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emrfs-configure-consistent-view.html
有谁知道这些设置是否可以通过 SDK 访问?
【问题讨论】:
标签: amazon-web-services aws-sdk emr
通常通过 emrfs-site.xml 启用 emrfs 一致性 http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emrfs-configure-consistent-view.html
有谁知道这些设置是否可以通过 SDK 访问?
【问题讨论】:
标签: amazon-web-services aws-sdk emr
要使用 Java SDK 启用 EMRFS,需要将“emrfs-site”配置添加到 RunJobFlowRequest,并且必须将 fs.s3.consistent 属性设置为 true强>。像这样:
Map<String, String> emrfsProperties = new HashMap<>();
emrfsProperties.put("fs.s3.consistent", "true");
RunJobFlowRequest request = new RunJobFlowRequest()
....
.withServiceRole(SERVICE_ROLE)
.withJobFlowRole(JOB_FLOW_ROLE)
.withConfigurations(
new Configuration().withClassification("yarn-site").withProperties(yarnProperties),
new Configuration().withClassification("emrfs-site").withProperties(emrfsProperties)
)
.withInstances(new JobFlowInstancesConfig()
.withEc2KeyName(EC2_KEYPAIR)
....
EMRFS 配置参数的完整列表可以在here找到
【讨论】:
是的,您在这里有完整的文档: http://docs.aws.amazon.com/ElasticMapReduce/latest/API/Welcome.html
您需要先授权与 AWS 的连接,然后才能使用 API 根据需要配置应用程序。 也看这里: http://docs.aws.amazon.com/ElasticMapReduce/latest/API/CommonParameters.html http://docs.aws.amazon.com/ElasticMapReduce/latest/API/EmrConfigurations.html
【讨论】: