fastdfs的一些错误总结

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Linux_newbie_rookie/article/details/79078393
结合网上查看的资料,总结一下fastdfs文件系统出现的一些错误。结合的地址:http://blog.csdn.net/xiangliangyu/article/details/17115637

1. FastDFS适用的场景以及不适用的场景?
FastDFS是为互联网应用量身定做的一套分布式文件存储系统,非常适合用来存储用户图片、视频、文档等文件。对于互联网应用,和其他分布式文件系统相比,优势非常明显。
FastDFS没有对文件做分块存储,因此不太适合分布式计算场景。

2. 当用fdfs_monitor /etc/fdfs/storage.conf 这个命令进行查看tracker与storage端是否建立连接时,两端始终显示都是offline。
解决:先查看tracker和storage的日志,确认服务是否有问题;如果日志显示正常,则有可能是在操作过程中,删除了tracker或storage某一方的缓存文件,导致缓存不匹配。此时,先关闭tracker和storage服务,
删除tracker.conf和storage.conf中指定的base_path目录下的data文件,再重启服务即可。
注意:如果删除了FastDHT 的base_path目录下的文件,切片集信息将全部丢失。

3. 在上传文件时,出现  ERROR - file: tracker_proto.c, line: 48, server: 101.200.215.232:23000, response status 28 != 0
解决:状态返回28,说明磁盘空间不足,注意FastDFS中有预留空间的概念,在tracker.conf中设置,配置项为:reserved_storage_space,缺省值为4GB,即预留4GB的空间。
请酌情设置reserved_storage_space这个参数,比如可以设置为磁盘总空间的20%左右可以修改/etc/fdfs/tracker.conf文件

4. 执行fdfs_test或fdfs_test1上传文件时,服务器返回错误号2
解决:状态返回2表示没有ACTIVE状态的storage server。可以执行fdfs_monitor查看服务器状态。

5. ERROR - file: /home/nginx/install/fastdfs-nginx-module/src/common.c, line: 561, logic file: M00/00/00/wKgBNU7wRbrcAYGuAALOPrGJ7YQ668.jpg not exists
解决: apache和nginx扩展模块版本v1.06及以上版本,需要在配置文件/etc/fdfs/fastdfs_mod.conf中设置storage server的存储路径信息。
一个示例如下所示:
store_path_count=1
store_path0=/home/yuqing/fastdfs
store_path_count和store_path   #均需要正确设置,必须和storage.conf中的相应配置完全一致

6. nginx和apache扩展模块与FastDFS server版本对应关系
解决:扩展模块1.05: 针对FastDFs server v2.x,要求server版本大于等于v2.09
      扩展模块1.07及以上版本: 针对FastDFs server v3.x

7. nginx扩展模块,不能正常显示图片的问题
解决:在配置文件/etc/fdfs/mod_fastdfs.conf中,缺省的设置是这样的:http.need_find_content_type=false这个参数在nginx中需要设置为true,apache中应该设置为false。

8. 分布式切图时,控制台为什么会提示“No buffer space available (maximum connections reached?):connect”?38error.png
解决:分布式切图过程中,向 FastDFS 存储上传切片时,占用的端口数增多,可能会达到本地操作系统的端口数的上限,所以出现上述问题。可通过如下方式规避:
Windows 系统
运行 “regedit.exe”,打开注册表,找到 “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters”位置,添加“TcpTimedWaitDelay”,类型为DWORD,值为30;
添加“MaxUserPort”,类型为DWORD,值为20000(调大系统可用端口数)。
Linux 系统
运行 “vi /etc/sysctl.conf”,编辑文件,加入以下内容:
net.ipv4.tcp_syncookies  = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle =  1
net.ipv4.tcp_fin_timeout = 30
然后执行“/sbin/sysctl -p”让参数生效即可。

9. 在启动tracker的时候出现此类错误:ERROR - file: ../common/fdfs_http_shared.c, line: 128, param "http.mime_types_filename" not exist or is empty
解决:修改tracker.conf里面,把##include http.conf 改为#include http.conf ,再重启

10. 报错 ERROR - file: tracker_http_check.c, line: 132, http check alive, connect to http server 192.168.1.53:8888 fail, errno: 111, error info: Connection refused
解决:端口不对。要配置storage和nginx端口一致。

11. 报错400 badrequest [2011-12-12 15:24:21] ERROR - file: /tmp/fastdfs-nginx-module/src/common.c, line: 561, logic file: M00/00/00/wKgBNU7lqyjzJZ4mAA4CRXl5SCQ670.jpg not exists
2011/12/12 15:24:21 [error] 14147#0: *1 open() "/home/nginx/nginx/html/favicon.ico" failed (2: No such file or directory), client: 192.168.1.123, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.53:8090"
解决:修改/fastdfs/conf/mod_fastdfs.conf      里面url_have_group_name = true

12. 在tracker的日志里报出此类错误  ERROR - file: tracker_mem.c, line: 1406, the format of the file "/home/bstar/dfs_data/data/storage_sync_timestamp.dat" is invalid, group: group3, row count:1 > server count:0
解决:修改data里面的 storage_sync_timestamp.dat,把group3的信息删掉,然后重启tracker

13. 如何删除无效的storage server?
解决:可以使用fdfs_monitor来删除。命令行如下:
/usr/local/bin/fdfs_monitor delete
例如:/usr/local/bin/fdfs_monitor /etc/fdfs/client.conf delete group1 192.168.0.100
注意:如果被删除的storage server的状态是ACTIVE,也就是该storage server还在线上服务的情况下,是无法删除掉的。

猜你喜欢

转载自blog.csdn.net/Linux_newbie_rookie/article/details/79078393