【发布时间】:2016-04-14 12:05:48
【问题描述】:
我正在尝试使用HdfsBolt 将 Storm 拓扑的输出写入启用 HA 的 HDFS。拓扑定义如下:
// Use pipe as record boundary
RecordFormat format = new DelimitedRecordFormat().withFieldDelimiter("|");
//Synchronize data buffer with the filesystem every 1000 tuples
SyncPolicy syncPolicy = new CountSyncPolicy(1000);
// Rotate data files when they reach five MB
FileRotationPolicy rotationPolicy = new FileSizeRotationPolicy(5.0f, FileSizeRotationPolicy.Units.MB);
// Use default, Storm-generated file names
FileNameFormat fileNameFormat = new DefaultFileNameFormat().withPath("/foo");
HdfsBolt hdfsBolt = new HdfsBolt()
.withFsUrl("hdfs://devhdfs")
.withFileNameFormat(fileNameFormat)
.withRecordFormat(format)
.withRotationPolicy(rotationPolicy)
.withSyncPolicy(syncPolicy);
问题是HdfsBolt 不知道hdfs://devhdfs 的值并触发java.net.UnknownHostException:
Caused by: java.lang.IllegalArgumentException: java.net.UnknownHostException: prehdfs
我有原始的core-site.xml,其中存在该定义,但我不知道如何将其传递给HdfsBolt。有什么提示吗?
【问题讨论】:
标签: hdfs apache-storm