Twitter storm example running in local mode cannot

2019-02-22 06:24发布

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条回答
Animai°情兽
2楼-- · 2019-02-22 06:56

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

查看更多
登录 后发表回答