关于storm 搭建的文章很多了,这里就不写了。
搭建好storm后运行第一个例子,发现报错了,错误如下:
Exception in thread "main" java.lang.RuntimeException: org.apache.thrift7.transport.TTransportException: java.net.ConnectException: Connection refused
at backtype.storm.utils.NimbusClient.getConfiguredClient(NimbusClient.java:38)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:116)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:70)
at cn.storm.topology.TopoMain.main(TopoMain.java:29)
Caused by: org.apache.thrift7.transport.TTransportException: java.net.ConnectException: Connection refused
at org.apache.thrift7.transport.TSocket.open(TSocket.java:183)
at org.apache.thrift7.transport.TFramedTransport.open(TFramedTransport.java:81)
at backtype.storm.security.auth.SimpleTransportPlugin.connect(SimpleTransportPlugin.java:83)
at backtype.storm.security.auth.ThriftClient.<init>(ThriftClient.java:63)
at backtype.storm.utils.NimbusClient.<init>(NimbusClient.java:47)
at backtype.storm.utils.NimbusClient.<init>(NimbusClient.java:43)
at backtype.storm.utils.NimbusClient.getConfiguredClient(NimbusClient.java:36)
... 3 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.thrift7.transport.TSocket.open(TSocket.java:178)
... 9 more
原因是,主节点或从节点没有启动成功。
解决办法:
是配置文件中storm.yaml配置中存在错误。错误地方是子节点ip/主机名配置存在问题。
另外一种情况也可能是用root用户和普通用户同时启动Nimbus的问题,使用一个用户重新启动就好,supervisor节点也要重启。
2. 刚开始入门strom,运行第一个例子遇到了这样一个问题:
java.lang.RuntimeException: java.io.FileNotFoundException: /home/cn.storm.bolt.WriterBolt@75e41d53 (Permission denied) at cn.itcast.storm.bolt.WriterBolt.prepare(WriterBolt.java:40) at backty
程序设置存放数据的位置是/home下但出现了(Permission denied),这是Linux文件权限问题
用触chmod +w 或者chmod 755 给数据存放目标目录相应的文件权限即可。
搭建好storm后运行第一个例子,发现报错了,错误如下:
Exception in thread "main" java.lang.RuntimeException: org.apache.thrift7.transport.TTransportException: java.net.ConnectException: Connection refused
at backtype.storm.utils.NimbusClient.getConfiguredClient(NimbusClient.java:38)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:116)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:70)
at cn.storm.topology.TopoMain.main(TopoMain.java:29)
Caused by: org.apache.thrift7.transport.TTransportException: java.net.ConnectException: Connection refused
at org.apache.thrift7.transport.TSocket.open(TSocket.java:183)
at org.apache.thrift7.transport.TFramedTransport.open(TFramedTransport.java:81)
at backtype.storm.security.auth.SimpleTransportPlugin.connect(SimpleTransportPlugin.java:83)
at backtype.storm.security.auth.ThriftClient.<init>(ThriftClient.java:63)
at backtype.storm.utils.NimbusClient.<init>(NimbusClient.java:47)
at backtype.storm.utils.NimbusClient.<init>(NimbusClient.java:43)
at backtype.storm.utils.NimbusClient.getConfiguredClient(NimbusClient.java:36)
... 3 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.thrift7.transport.TSocket.open(TSocket.java:178)
... 9 more
原因是,主节点或从节点没有启动成功。
解决办法:
是配置文件中storm.yaml配置中存在错误。错误地方是子节点ip/主机名配置存在问题。
另外一种情况也可能是用root用户和普通用户同时启动Nimbus的问题,使用一个用户重新启动就好,supervisor节点也要重启。
2. 刚开始入门strom,运行第一个例子遇到了这样一个问题:
java.lang.RuntimeException: java.io.FileNotFoundException: /home/cn.storm.bolt.WriterBolt@75e41d53 (Permission denied) at cn.itcast.storm.bolt.WriterBolt.prepare(WriterBolt.java:40) at backty
程序设置存放数据的位置是/home下但出现了(Permission denied),这是Linux文件权限问题
用触chmod +w 或者chmod 755 给数据存放目标目录相应的文件权限即可。