trackerClient.getConnection()为null

如题,整了个fastDFS文件服务器。但是集成项目spring boot时上传文件失败!

Debug到trackerClient.getConnection()时为null。于是看了服务器上tracker的log

[2019-04-25 12:10:23] INFO - file: tracker_relationship.c, line: 383, selecting leader...
[2019-04-25 12:10:23] ERROR - file: connection_pool.c, line: 110, connect to 124.179.281.198:22122 fail, errno: 113, error info: No route to host

主要做了两点修正:

一、原来的防火墙端口方通错了22122搞成了21222,改成了22122。同时检测安全组和防火墙其他端口,检测 /ect/fdfs下的其他.conf配置文件是否有误!

  然后重启 tracker,satorage,Nginx

二、修改了fdfs_client.conf文件配置,这个不要在网上瞎copy别人的,一定要用官方的。同时确保这个文件能被读取到,读取文件路径一定要正确。

#################### FastDFS-Client Start ####################
#默认值为30s
connect_timeout = 10
#默认值为30s
network_timeout = 30
charset = UTF-8
http.tracker_http_port = 80
# token 防盗链功能
http.anti_steal_token = true
http.secret_key = FastDFS20091234567890
tracker_server = 192.168.1.118:22122
#tracker_server = 192.168.0.119:22122
## Tracker Server, if more than one, separate with ","
# fastdfs.tracker_servers=10.0.11.201:22122,10.0.11.202:22122,10.0.11.203:22122
#fastdfs.tracker_servers=${tracker_server_addr}:22122
#################### FastDFS-Client End ####################

好了,再重新上传就成功啦。

原文地址:https://www.cnblogs.com/zeussbook/p/10768596.html