spring - 使用 Spring Boot 纱线连接到带有后缀的资源管理器
问题描述
我正在创建一个 Spring Boot 应用程序,它使用 Yarn 作为资源管理器。我正在使用客户端的下一个 application.yml 配置:
spring:
hadoop:
resources:
- file:/etc/hadoop/conf/core-site.xml
- file:/etc/hadoop/conf/yarn-site.xml
- file:/etc/hadoop/conf/hdfs-site.xml
yarn:
appName: "sby-test"
applicationDir: "/app/sby-test"
client:
files:
- "file:container.jar"
- "file:appmaster.jar"
localizer:
patterns:
- "*.jar"
- "*.yml"
- "*.properties"
launchcontext:
archiveFile: appmaster.jar
它运行良好,当 yarn-site.xml 包含参数时
<property>
<name>yarn.resourcemanager.address</name>
<value>127.0.0.1:8032</value>
</property>
但是当我尝试在具有多个纱线地址的集群上启动此应用程序时,例如
<property>
<name>yarn.resourcemanager.address.yarn1</name>
<value>127.0.0.1:8032</value>
</property>
<property>
<name>yarn.resourcemanager.address.yarn2</name>
<value>127.0.0.2:8032</value>
</property>
它失败了,但有一个例外
Caused by: org.springframework.yarn.YarnSystemException: Call From node1.of.the.cluster/127.0.0.1 to 0.0.0.0:8032 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused;
它没有找到任何资源管理器地址,可能是因为 yarn-site.xml 文件中没有 yarn.resourcemanager.address 属性。
有什么方法可以设置一个后缀(例如,在我的例子中是 yarn1),当它查找资源管理器地址时,它将由 spring boot 应用?
解决方案
推荐阅读
- c# - 为什么可以将 Windows 特定的 Nugets 添加到 ASP.NET Core
- javascript - 将我的 if 条件转换为使用正则表达式选项切换大小写:javascript
- html - 当我使用
,内容消失(菜单和路由器出口) - postgresql - PostgreSQL 在部分索引中使用时间戳差异进行 upsert
- javascript - JSDoc 不显示参数表和返回值/名称/描述
- python - 使用其他行中的非唯一值从 Dataframe 行中提取值
- sql-server - XML 同名但属性不同的多个节点 SQL
- powershell - 具有多个潜在凭据的 PowerShell Connect-VIServer
- android - 编译 LineageOS 17.1 只生成 system.img 不生成 zip 包?
- cmake - CLion 中另一个 CMakeLists.txt 文件中的用户定义函数