我正在运行风暴启动项目(https://github.com/nathanmarz/storm-starter),并在运行一段时间后抛出以下错误。
23135 [main] ERROR org.apache.zookeeper.server.NIOServerCnxn - Thread Thread[main,5,main] died
java.io.IOException: Unable to delete file: C:\Users\[user directory]\AppData\Local\Temp\a0894222-6a8a-4f80-8655-3ad6a0c10021\version-2\log.1
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1390)
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:977)
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1381)
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1044)
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:977)
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1381)
at backtype.storm.util$rmr.invoke(util.clj:413)
at backtype.storm.testing$kill_local_storm_cluster.invoke(testing.clj:164)
at backtype.storm.LocalCluster$_shutdown.invoke(LocalCluster.clj:32)
at backtype.storm.LocalCluster.shutdown(Unknown Source)
at storm.starter.ExclamationTopology.main(ExclamationTopology.java:82)
我尝试更改“AppData”目录的权限,但这似乎不会影响它。这个错误会在命令行以及eclipse中运行。
答案 0 :(得分:10)
根据此File delete problem on Windows,此问题仍存在于风暴版本0.8.2中。截至目前,以下解决方案对我有用。您可能需要注释掉cluster.killTopology() and cluster.shutdown()
方法,如下所示,以避免文件删除错误。
LocalCluster cluster = new LocalCluster();
cluster.submitTopology("test", conf, builder.createTopology());
Utils.sleep(10000);
// cluster.killTopology("test");
// cluster.shutdown();
希望,这有帮助