开发过程使用fastdfs,第一次接触,使用时遇到的问题整理如下
问题1:
在centos上安装 ./make.sh 时报错如下:
在包含自 tracker_service.c:34 的文件中:
tracker_nio.h:17:19: 错误:event.h:没有那个文件或目录
In file included from tracker_nio.h:18,
from tracker_service.c:34:
fast_task_queue.h:29: 错误:字段‘ev_read’的类型不完全
fast_task_queue.h:30: 错误:字段‘ev_write’的类型不完全
tracker_service.c: 在函数‘tracker_service_init’中:
tracker_service.c:99: 警告:隐式声明函数‘event_base_new’
tracker_service.c:99: 警告:赋值时将整数赋给指针,未作类型转换
tracker_service.c: 在函数‘work_thread_entrance’中:
tracker_service.c:253: 错误:‘ev_notify’的存储大小未知
tracker_service.c:258: 警告:隐式声明函数‘event_set’
tracker_service.c:259: 错误:‘EV_READ’未声明(在此函数内第一次使用)
tracker_service.c:259: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
tracker_service.c:259: 错误:所在的函数内也只报告一次。)
tracker_service.c:259: 错误:‘EV_PERSIST’未声明(在此函数内第一次使用)
tracker_service.c:260: 警告:隐式声明函数‘event_base_set’
tracker_service.c:266: 警告:隐式声明函数‘event_add’
tracker_service.c:275: 警告:隐式声明函数‘event_base_loop’
tracker_service.c:279: 警告:隐式声明函数‘event_base_free’
tracker_service.c:253: 警告:未使用的变量‘ev_notify’
make: *** [tracker_service.o] 错误 1
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -c -o ../common/fast_mblock.o ../common/fast_mblock.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -c -o ../common/avl_tree.o ../common/avl_tree.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -c -o ../tracker/fdfs_shared_func.o ../tracker/fdfs_shared_func.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -c -o ../tracker/fast_task_queue.o ../tracker/fast_task_queue.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/local/include
在包含自 ../tracker/fast_task_queue.c:6 的文件中:
../tracker/fast_task_queue.h:18:19: 错误:event.h:没有那个文件或目录
In file included from ../tracker/fast_task_queue.c:6:
../tracker/fast_task_queue.h:29: 错误:字段‘ev_read’的类型不完全
../tracker/fast_task_queue.h:30: 错误:字段‘ev_write’的类型不完全
make: *** [../tracker/fast_task_queue.o] 错误 1
查看资料说是缺少libevent
安装yum install libevent-devel.x86_64 后,再次./make.sh, 没看到报错信息了
问题2:
在ubuntu上安装时,运行./make.sh 出错如下
make: 没有什么可以做的为 `all'。
make: 没有什么可以做的为 `all'。
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -DOS_LINUX -o fdfs_monitor fdfs_monitor.c ../common/hash.o ../common/chain.o ../common/shared_func.o ../common/ini_file_reader.o ../common/logger.o ../common/sockopt.o ../common/base64.o ../common/sched_thread.o ../common/http_func.o ../common/md5.o ../common/pthread_func.o ../common/local_ip_func.o ../common/avl_tree.o ../common/connection_pool.o ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -ldl -rdynamic -I../common -I../tracker -I/usr/local/include
../common/sched_thread.o: In function `sched_start':
/opt/FastDFS/tracker/../common/sched_thread.c:495: undefined reference to `pthread_create'
../common/pthread_func.o: In function `kill_work_threads':
/opt/FastDFS/tracker/../common/pthread_func.c:182: undefined reference to `pthread_kill'
../common/pthread_func.o: In function `init_pthread_attr':
/opt/FastDFS/tracker/../common/pthread_func.c:84: undefined reference to `pthread_attr_getstacksize'
/opt/FastDFS/tracker/../common/pthread_func.c:115: undefined reference to `pthread_attr_setstacksize'
../common/pthread_func.o: In function `create_work_threads':
/opt/FastDFS/tracker/../common/pthread_func.c:156: undefined reference to `pthread_create'
../common/pthread_func.o: In function `init_pthread_lock':
/opt/FastDFS/tracker/../common/pthread_func.c:32: undefined reference to `pthread_mutexattr_init'
/opt/FastDFS/tracker/../common/pthread_func.c:40: undefined reference to `pthread_mutexattr_settype'
/opt/FastDFS/tracker/../common/pthread_func.c:57: undefined reference to `pthread_mutexattr_destroy'
collect2: ld 返回 1
make: *** [fdfs_monitor] 错误 1
网上查看资料是说在make.sh 文件中没有指定libpthread.so 和 libpthread.a的正确路径,所以打开make.sh找到如下代码
if [ -f /usr/lib/libpthread.so ] || [ -f /usr/local/lib/libpthread.so ] || [ -f /lib64/libpthread.so ] || [ -f /usr/lib64/libpthread.so ]
|| [ -f /usr/lib/libpthread.a ] || [ -f /usr/local/lib/libpthread.a ] || [ -f /lib64/libpthread.a ] || [ -f /usr/lib64/libpthread.a ];
在我机器上找了下,确实在以上代码中指定的路径中没有找到libpthread.so 和 libpthread.a; 随后我在/usr/lib32中找到了libpthread.so 和 libpthread.a,
所以增加软连接
ln -s /usr/lib32/libpthread.so /usr/lib/libpthread.so
ln -s /usr/lib32/libpthread.a /usr/lib/libpthread.a
再次运行./make.sh 问题解决
问题3:
./make.sh install 时 报错如下:
mkdir -p /usr/local/bin
mkdir -p /etc/fdfs
cp -f fdfs_trackerd /usr/local/bin
if [ ! -f /etc/fdfs/tracker.conf ]; then cp -f ../conf/tracker.conf ../conf/mime.types ../conf/http.conf /etc/fdfs; fi
mkdir -p /usr/local/bin
mkdir -p /etc/fdfs
cp -f fdfs_storaged /usr/local/bin
if [ ! -f /etc/fdfs/storage.conf ]; then cp -f ../conf/storage.conf ../conf/mime.types ../conf/http.conf /etc/fdfs; fi
mkdir -p /usr/local/bin
mkdir -p /etc/fdfs
mkdir -p /usr/local/lib
cp -f fdfs_monitor fdfs_test fdfs_test1 fdfs_crc32 fdfs_upload_file fdfs_download_file fdfs_delete_file fdfs_file_info fdfs_appender_test fdfs_appender_test1 fdfs_append_file fdfs_upload_appender /usr/local/bin
if [ 0 -eq 1 ]; then cp -f libfastcommon.a libfdfsclient.a /usr/local/lib; fi
if [ 1 -eq 1 ]; then cp -f libfastcommon.so.1 libfdfsclient.so.1 /usr/local/lib; fi
if [ 1 -eq 1 ]; then ln -fs /usr/local/lib/libfastcommon.so.1 /usr/local/lib/libfastcommon.so; fi
if [ 1 -eq 1 ]; then ln -fs /usr/local/lib/libfdfsclient.so.1 /usr/local/lib/libfdfsclient.so; fi
if [ ! -f /etc/fdfs/client.conf ]; then cp -f ../conf/client.conf ../conf/http.conf /etc/fdfs; fi
mkdir -p /usr/local/include
mkdir -p /usr/local/include/fastcommon
mkdir -p /usr/local/include/fastdfs
cp -f ../common/common_define.h ../common/hash.h ../common/chain.h ../common/logger.h ../common/base64.h ../common/shared_func.h ../common/pthread_func.h ../common/ini_file_reader.h ../common/sockopt.h ../common/sched_thread.h ../common/http_func.h ../common/md5.h ../common/_os_bits.h ../common/local_ip_func.h ../common/avl_tree.h ../common/connection_pool.h /usr/local/include/fastcommon
cp -f ../common/fdfs_define.h ../common/fdfs_global.h ../common/mime_file_parser.h ../common/fdfs_http_shared.h ../tracker/tracker_types.h ../tracker/tracker_proto.h ../tracker/fdfs_shared_func.h ../storage/trunk_mgr/trunk_shared.h tracker_client.h storage_client.h storage_client1.h client_func.h client_global.h fdfs_client.h /usr/local/include/fastdfs
if [ 1 -eq 1 -a /usr/local/lib = "/usr/local/lib" ]; then sh ./fdfs_link_library.sh; fi
ln: 创建符号链接 "/usr/lib64/libfastcommon.so": 没有那个文件或目录
ln: 创建符号链接 "/usr/lib64/libfdfsclient.so": 没有那个文件或目录
make: *** [install] 错误 1
这个问题只需要 创建 lib64目录即可:mkdir -p /usr/lib64
问题4:
测试上传时遇到的一个错误
测试命令 ./fdfs_upload /etc/fdfs/storage.conf upload /home/test.txt
出错如下:
This is FastDFS client test program v4.06
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.csource.org/
for more detail.
[2014-03-20 18:47:13] DEBUG - base_path=/data/fastdfs/storage, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0
[2014-03-20 18:47:13] DEBUG - file: tracker_proto.c, line: 48, server: 192.168.88.202:22122, response status 2 != 0
[2014-03-20 18:47:13] DEBUG - file: tracker_proto.c, line: 48, server: 192.168.88.202:22122, response status 28 != 0
tracker_query_storage fail, error no: 28, error info: No space left on device
错误说是磁盘空间不够了,但是这时查看了一下tracker的日志:
[2014-03-20 18:47:12] ERROR - file: tracker_service.c, line: 2371, client ip: 192.168.88.202, invalid group name: group1
我尝试修改 tracker.conf 文件中的 reserved_storage_space = 1%, 随后测试通过,但是不知道tracker的日志为何报出上述错误。
分享到:
相关推荐
centos 7 安装fastdfs5.0.9,里面含有FDFS的搭建,测试,以及对fastdfs-nginx-module的支持。最后还有 SpringMVC整合fastdfs-client-java实现web文件上传下载。
DFS算法
在图1,3*3的方格棋盘上,摆放着1到8这八个数码,有1个方格是空。 如图1所示,要求对空格执行空格左移、空格右移、空格上移和空格下移这四个操作使得棋盘从初始状态(图1左)到目标状态(图1右)。...
八皇后问题 最简单dfs模板代码八皇后问题 最简单dfs模板代码八皇后问题 最简单dfs模板代码八皇后问题 最简单dfs模板代码八皇后问题 最简单dfs模板代码八皇后问题 最简单dfs模板代码八皇后问题 最简单dfs模板代码八...
使用DFS实现IIS负载均衡中双机文件同步
基于DFS算法的迷宫问题实现,有详细的注释,可以自己设定迷宫,也可由程序随机生成
本文档中给出车间调度问题的基于DFS和贪心的可随机化求解算法, 并给出了算法正确性的详细论证和时间复杂度分析, 具体的算法使用C++实现
dfs实现迷宫问题
本资源包含“基于蛮力法(DFS)解决TSP问题”的相关代码以及TSP的城市数据。
linux 7.4 新机器离线安装所有依赖跟教程5.05
dfs,c++实现的源代码,帮助小白学习使用c++进行编写
DFS CDMA Tool多功能的DFS文件固件下载到设备或做一些诸如reflesh的ESN/ MEID修复操作或解锁硬盘。 DMF文件可以帮助你做: 硬盘解锁 固件更新或修复 更改语言包 ESN/ MEID/ IMEI修复 拨号面板*#7284#,USB改成...
3. DFS命名空间+DFS复制 17 3.1. 简介 17 3.2. 策略 17 3.3. 注意事项 18 3.4. 安装步骤 18 3.5. 新建命名空间 19 3.6. 新建共享文件 23 3.7. 新建复制组 30 4. 总结 34 5. 疑难杂症 35 5.1. DFS服务在 AD初始化完毕...
深度优先搜索城堡问题给定一个城堡,求其中最大连通的房间数
1.文件系统 2.分布式文件系统 3.典型分布式文件系统介绍 1.应用场景 2.用户量 3.易于修改 1.动态负载均衡 2.去中心化 1.动态负载均衡的解决方案
DFS_CDMA_Tool3.3.0.7
DFS暴力求解TSP问题
该服务会记录文件的基本信息。其中服务器信息获取,上传上报都由dfs-app-api自动完成, 第三方应用不需要关心。http下载会一些参数,文档后面中有详细描述。 - **dfs-app-api(应用sdk)** 第三方java应用可以集成...
很详细的介绍了如何使用DFS向域内其它用户发布共享文件夹,以及域内其它用户如何使用DFS发布的文件夹。
二、DFS的特点 分布式文件系统,大文件,如何拆分?大部分写操作是insert,最忌讳随机update。大部分情况是insert后,文件只读 三、DB与DFS的结合 比如Hadoop、Greenplum,相对普通的DB更加灵活。 四、DFS在SDG的应用