FastDFS:com.github.tobato.fastdfs.exception.FdfsIOException

在测试类中使用fastDFS上传图片时发生异常:

com.github.tobato.fastdfs.exception.FdfsIOException: 客户端连接服务端出现了io异常。

网上的解决方案一种是tracker要用外网ip,但是众所周知fastDFS设置及其麻烦。
二是是ip端口未开启,防火墙关闭了都不行,必须手动打开22122,23000。

# 查看打开的端口
/etc/init.d/iptables status
# 手动打开指定的端口(以23000为例)
/sbin/iptables -I INPUT -p tcp --dport 23000 -j ACCEPT
# 保存
/etc/rc.d/init.d/iptables save

 

PS: 这个方案并没有解决我的问题,我的FastDFS安装在CentOS7上面,故上面的命令完全无效,因为CentOS7默认的防火墙不是iptables,而是firewalle.

 

posted @ 2020-05-07 17:11  古语云  阅读(4121)  评论(0编辑  收藏  举报