我们的架构是nginx+tomcat, nginx 有公网和内网ip,tomat只有内网ip地址!
tomcat 和nginx 之间通过内网通讯,上传图片!
web项目的配置文件都是正确的,fastdfs的22122端口也是正常的,为了测试防火墙都关闭了!
可是java项目在上传图片的时候报错!
java.netSocketException: Network is unreachable ##其实这个时候就应该考虑外网的问题,web配置文件里面配置的的是内网的地址,可是它为什么不使用内网地址,而直接使用外网地址?
为了测试tomcat和nginx的防火墙都关闭了,telnet也是正常的,却报错网络不可达!感觉非常奇怪!
于是为了测试在tomcat机器上配置一个公网地址,问题解决了!
显然是通过公网使用的!
tracker.conf中 开始使用的默认的
bind_addr=0.0.0.0
修改为
bind_addr=10.10.11.67 ##内网地址
storage.conf中修改如下配置文件:
bind_addr=10.10.11.67
......
tracker_server=10.10.11.67:22122 ##这里是关键
1:
[2017-06-10 05:33:35] INFO - file: tracker_client_thread.c, line: 1235, tracker server 10.10.11.1*9:22122, set tracker leader: 10.10.11.1*9:22122
[2017-06-10 05:33:35] ERROR - file: connection_pool.c, line: 110, connect to 10.10.11.*7:22122 fail, errno: 111, error info: Connection refused
[2017-06-10 05:33:35] ERROR - file: tracker_client_thread.c, line: 1120, tracker server 10.10.11.*7:22122, recv data fail, errno: 107, error info: Transport endpoint is not connected.
[2017-06-10 05:33:36] ERROR - file: tracker_client_thread.c, line: 277, connect to tracker server 10.10.11.67:22122 fail, errno: 111, error info: Connection refused
[2017-06-10 05:43:06] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 10.10.11.*7:22122, continuous fail count: 19, as a tracker client, my ip is 10.10.11.*7
[2017-06-10 05:43:11] INFO - cleanup task count: 1
[2017-06-10 05:43:11] INFO - cleanup task count: 1
[2017-06-10 05:43:12] INFO - cleanup task count: 1
[2017-06-10 05:43:36] INFO - file: storage_sync.c, line: 2698, successfully connect to storage server 10.10.11.1*9:23000
[2017-06-10 05:44:07] ERROR - file: tracker_client_thread.c, line: 1120, tracker server 10.10.11.1*9:22122, recv data fail, errno: 107, error info: Transport endpoint is not connected.
[2017-06-10 05:44:08] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 10.10.11.1*9:22122, as a tracker client, my ip is 10.10.11.*7
[2017-06-10 05:44:08] INFO - file: tracker_client_thread.c, line: 1235, tracker server 10.10.11.1*9:22122, set tracker leader: 10.10.11.1*9:22122
2:
ERROR - file: tracker_nio.c, line: 213, client ip: 10.10.11.2*8, recv timeout, recv offset: 0, expect length: 0
3:
kernel: fdfs_trackerd[31739]: segfault at 18 ip 00007f5298654687 sp 00007f5298e8edc0 error 6 in libfastcommon.so[7f5298638000+25000]
4:
5:tracker 高可用,其实不需要vip
在client.conf中配置两个tracker地址
[root@localhost ~]# /usr/bin/fdfs_upload_file /etc/fdfs/client.conf /root/88.jpg
[2017-06-30 15:42:18] ERROR - file: connection_pool.c, line: 130, connect to 172.16.2.47:22122 fail, errno: 111, error info: Connection refused
group1/M00/00/00/rBACMFlWANmASBLHAADNkUoQ2gQ864.jpg
client.conf 里面有两个tracker server,我设置了47和48两个tracker server
就算47连接不上,48也可以上传上的! 就算一个tracker挂掉,另外一个只要是可以的,都是可以上传的!
阅读(19731) | 评论(0) | 转发(0) |