我在名为 Heron 的示例拓扑中修改了 RAM 要求,并使用命令WordCountTopology.java
重建了文件。mvn assembly:assembly
当我将修改后的 WordCountTopology 提交到 Heron 集群时,我发现 Heron Instance 的 RAM 需求没有改变。
构建过程.jar
是成功的。WordCountTopology 的默认 RAM 要求如下:
// configure component resources
conf.setComponentRam("word",
ByteAmount.fromMegabytes(ExampleResources.COMPONENT_RAM_MB * 2));
conf.setComponentRam("consumer",
ByteAmount.fromMegabytes(ExampleResources.COMPONENT_RAM_MB * 2));
// configure container resources
conf.setContainerDiskRequested(
ExampleResources.getContainerDisk(2 * parallelism, parallelism));
conf.setContainerRamRequested(
ExampleResources.getContainerRam(2 * parallelism, parallelism));
conf.setContainerCpuRequested(2);
在上面的代码中。ExampleResources.COMPONENT_RAM_MB = 512mb
. parallelism
的默认值为1
。
ExampleResources 的内容如下:
static ByteAmount getContainerDisk(int components, int containers) {
return ByteAmount.fromGigabytes(Math.max(components / containers, 1));
}
static ByteAmount getContainerRam(int components, int containers) {
final int componentsPerContainer = Math.max(components / containers, 1);
return ByteAmount.fromMegabytes(COMPONENT_RAM_MB * componentsPerContainer);
}
我将 的值更改ExampleResources.COMPONENT_RAM_MB=512mb
为256mb
。
但是,拓扑的需求显示Aurora scheduler
如下:
并且极光中的所有实例都失败了:
我的问题:我应该怎么做才能有效地改变拓扑中的RAM需求?我不知道为什么任务运行失败金币和极光。谢谢你的帮助。