2 u014755816 u014755816 于 2016.02.18 13:38 提问

FastDFS问题,上传连接超时

java代码报错如下:
java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at net.mikesu.fastdfs.client.StorageClientImpl.getSocket(StorageClientImpl.java:25)
at net.mikesu.fastdfs.client.StorageClientImpl.upload(StorageClientImpl.java:69)
at net.mikesu.fastdfs.FastdfsClientImpl.upload(FastdfsClientImpl.java:71)
at net.mikesu.fastdfs.FastdfsClientImpl.upload(FastdfsClientImpl.java:274)
at net.mikesu.fastdfs.FastdfsClientImpl.upload(FastdfsClientImpl.java:270)
at net.mikesu.fastdfs.FastdfsClientTest.testFastdfsClient(FastdfsClientTest.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)

FastDFS的storage日志文件报错下如:
FastDFS的tracker日志文件和storage的日志文一样的,如下:
[2016-02-18 10:52:51] INFO - local_host_ip_count: 2, 127.0.0.1 192.168.254.136
[2016-02-18 10:53:07] INFO - file: tracker_relationship.c, line: 374, selecting leader...
[2016-02-18 10:53:08] INFO - file: tracker_relationship.c, line: 392, I am the new tracker leader 192.168.254.136:22122
[2016-02-18 10:54:55] ERROR - file: tracker_nio.c, line: 254, client ip: 192.168.254.1, recv failed, errno: 104, error info: Connection reset by peer
[2016-02-18 11:00:01] ERROR - file: tracker_nio.c, line: 254, client ip: 192.168.254.1, recv failed, errno: 104, error info: Connection reset by peer

我想是不是client ip:的问题,因为我的服务器IP为192.168.254.136,但client ip是192.168.254.1,如果是这个问题请大家告诉我一下,在哪里修改。

2个回答

u014755816
u014755816   2016.02.18 17:59

自己找到解决办法了。
执行过程中可能出现防火墙封口:

ERROR - file: tracker_proto.c, line: 420, connect to 192.168.127.11:22122 fail, errno: 113, error info: No route to host

解决:
iptables -L;iptables -F;service iptables stop

Mr_dsw
Mr_dsw   Ds   Rxr 2016.02.18 22:27

iptables -L;iptables -F;service iptables stop

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!