远程服务器FastDFS搭建及踩坑记

远程服务器搭建FastDFS

FastDFS安装及部署参考:

https://www.cnblogs.com/chiangchou/p/fastdfs.html


问题:ERROR - file: tracker_proto.c, line: 48, server: 127.0.0.1:22122, response status 2 != 0

参考:https://blog.csdn.net/qq_31772441/article/details/82562205

问题:Linux服务器上安装好的FastDFS之后,在服务器上测试上传是没问题的,本地使用代码上传文件时报错:

java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:75)
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.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at org.csource.fastdfs.TrackerGroup.getConnection(TrackerGroup.java:47)
at org.csource.fastdfs.TrackerGroup.getConnection(TrackerGroup.java:72)
at com.eric.core.resource.fastdfs.FastDFS.uploadFile(FastDFS.java:107)
at com.eric.core.resource.fastdfs.FastDFS.main(FastDFS.java:257)

参考:https://blog.csdn.net/tjcyjd/article/details/50808740

解决的办法:
storage的tracker_server地址必须是外网地址,重启FastDFS就好了。
(client.conf中使用内网地址,tracker.conf中使用内网地址,storage.conf中使用外网地址)


你可能感兴趣的:(【云上的日子】)