fastdfs-nginx-module icon indicating copy to clipboard operation
fastdfs-nginx-module copied to clipboard

关于请求本地服务器不存在的图片时自动请求源服务器的实现

Open birlyjer opened this issue 3 years ago • 2 comments

简单描述如下: 局域网有两台服务器s1 s2 都已完成fastdfs+nginx+ngx_fastdfs_module搭建,并且可以正常使用,场景如下 s1上有图片p1.jpg ,但可以用s2的ip加图片url能访问,按作者的实现是在s2启用配置storage_ids.conf并设置s1的ip,这样就可以实现访问s2+图片url即使s2上没有,会自动请求s1,找到后响应给请求端,问题是我并没有启用这个配置更没有在配置中设置s1 但还是实现了上面的场景,想知道他是怎么实现的,是否有自动扫描局域网所有ip的某个端口找到s1的逻辑???

birlyjer avatar Jun 30 '21 02:06 birlyjer

文件id中包含了源头存储服务器的id或ip地址。

happyfish100 avatar Jul 01 '21 00:07 happyfish100

感谢您的回复。目前遇到一个奇怪的问题:前置条件: server-A(192.168.7.16)和server-B(192.168.8.245)在局域网,相互通信正常,各自搭建了一套fastDfs(fastdfs+fastdht),A和B从配置上都是独立的有且只有一个tracker就是它自己的内网ip:22122,都只用了group1,conf文件见附件 步骤: 1、将server-A 关机 或断网 或 杀掉一切与fd有关的进程 2、server-B 上传一张图片在本机 /usr/bin/fdfs_upload_file  /etc/fdfs/client.conf /tmp/fastdfs/996.jpg 返回 group1/M00/00/00/wKgI9WDcOKGAcrgMAACh3ifiUA4312.jpg 3、将server -A 开机  或 保持断网 或 保持不开启任何与fd相关的进程,执行 fdfs_file_info  /etc/fdfs/client.conf /M00/00/00/wKgI9WDcOKGAcrgMAACh3ifiUA4312.jpg 返回: GET FROM SERVER: false

file type: normal source storage id: 0 source ip address: 192.168.8.245 file create timestamp: 2021-06-30 05:25:53 file size: 41438 file crc32: 669143054 (0x27e2500e)  

 发生了什么呢?server-A是如何获取到file_info的呢?server-B广播了吗??困扰了好久,恳请您一定指点指点!!!!!

补充:用     fdfs_monitor /etc/fdfs/client.conf     fdfs_monitor /etc/fdfs/storage.conf    fdfs_monitor /etc/fdfs/tracker.conf 在server-A  server-B上执行,并没有显示集群,

------------------ 原始邮件 ------------------ 发件人: "happyfish100/fastdfs-nginx-module" @.>; 发送时间: 2021年7月1日(星期四) 上午8:15 @.>; @.@.>; 主题: Re: [happyfish100/fastdfs-nginx-module] 关于请求本地服务器不存在的图片时自动请求源服务器的实现 (#87)

文件id中包含了源头存储服务器的id或ip地址。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

birlyjer avatar Jul 01 '21 00:07 birlyjer