可以尝试创建如下目录 [mw_shl_code=bash,true]~/.flume[/mw_shl_code]
不行的话,可以打个补丁
把下面内容存为FLUME-2773.patch
[mw_shl_code=java,true]diff --git a/flume-ng-sources/flume-taildir-source/src/main/java/org/apache/flume/source/taildir/TaildirSource.java b/flume-ng-sources/flume-taildir-source/src/main/java/org/apache/flume/source/taildir/TaildirSource.java
index 97ca43b..8816327 100644
--- a/flume-ng-sources/flume-taildir-source/src/main/java/org/apache/flume/source/taildir/TaildirSource.java
+++ b/flume-ng-sources/flume-taildir-source/src/main/java/org/apache/flume/source/taildir/TaildirSource.java
@@ -22,6 +22,9 @@ import static org.apache.flume.source.taildir.TaildirSourceConfigurationConstant
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -151,6 +154,12 @@ public class TaildirSource extends AbstractSource implements
String homePath = System.getProperty("user.home").replace('\\', '/');
positionFilePath = context.getString(POSITION_FILE, homePath + DEFAULT_POSITION_FILE);
+ Path positionFile = Paths.get(positionFilePath);
+ try {
+ Files.createDirectories(positionFile.getParent());
+ } catch (IOException e) {
+ throw new FlumeException("Error creating positionFile parent directories", e);
+ }
headerTable = getTable(context, HEADERS_PREFIX);
batchSize = context.getInteger(BATCH_SIZE, DEFAULT_BATCH_SIZE);
skipToEnd = context.getBoolean(SKIP_TO_END, DEFAULT_SKIP_TO_END);[/mw_shl_code]
|