Twitter storm example running in local mode cannot delete file

夙愿已清 提交于 2019-12-01 17:08:43

问题


I am running the storm starter project (https://github.com/nathanmarz/storm-starter) and it throws the following error after running for a little while.

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)

I have tried changing the permissions of the "AppData" directory but this appears to not affect it. This error comes up running it on the command line as well as from within eclipse.


回答1:


Per this File delete problem on Windows, this problem still exists in storm version 0.8.2. As of now, the below workaround worked for me. You may need to comment out the cluster.killTopology() and cluster.shutdown() methods, as shown below, to avoid the file deletion error.

 LocalCluster cluster = new LocalCluster();
        cluster.submitTopology("test", conf, builder.createTopology());
        Utils.sleep(10000);
       // cluster.killTopology("test");
       // cluster.shutdown();  

Hope, this helps



来源:https://stackoverflow.com/questions/16658779/twitter-storm-example-running-in-local-mode-cannot-delete-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!