happyfish100 / fastdfs

FastDFS is an open source high performance distributed file system (DFS). It's major functions include: file storing, file syncing and file accessing, and design for high capacity and load balance. Wechat/Weixin public account (Chinese Language): fastdfs
GNU General Public License v3.0
9.02k stars 1.99k forks source link

file_info是如何同步的? #510

Open birlyjer opened 3 years ago

birlyjer commented 3 years ago

前置条件: server-A(192.168.7.16)和server-B(192.168.8.245)在局域网,相互通信正常,各自搭建了一套fastDfs(fastdfs+fastdht),A和B从配置上都是独立的(从配置上两台没有任何关联)有且只有一个tracker就是它自己的内网ip:22122,都只用了group1。两台都开firewall 禁掉所有端口 步骤: 1、将server-A 关机 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 开机 执行 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上执行,并没有显示集群或多台server,只有本机

file_info 到底存在哪儿?是怎么通信的,怎么让局域网其他机器获取到的?

linfangrong commented 2 years ago

看代码是在fileid里解析出来的。 可以看下 fdfs_get_file_info_ex1