测试上传 fdfs_test /etc/fdfs/client.conf upload /etc/fstab(将etc下的fstab文件作为上传的测试文件)
得到信息如下:
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. [2012-12-27 14:27:01] DEBUG - base_path=/www/geebook_client, connect_timeout=30,
network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0 tracker_query_storage_store_list_without_group:
server 1. group_name=group1, ip_addr=127.0.0.1, port=23000 group_name=group1, ip_addr=127.0.0.1, port=23000 storage_upload_by_filename group_name=group1, remote_filename=M00/00/00/OlPQG1Db6jWAFmbTAAADqdgNsks5096460 source ip address: 58.83.208.27 file timestamp=2012-12-27 14:27:01 file size=937 file crc32=3624776267 file url: http://127.0.0.1:8090/group1/M00/00/00/OlPQG1Db6jWAFmbTAAADqdgNsks5096460 storage_upload_slave_by_filename group_name=group1, remote_filename=M00/00/00/OlPQG1Db6jWAFmbTAAADqdgNsks5096460_big source ip address: 58.83.208.27 file timestamp=2012-12-27 14:27:01 file size=937 file crc32=3624776267 fileurl:http://127.0.0.1:8090/group1/M00/00/00/OlPQG1Db6jWAFmbTAAADqdgNsks5096460_big
/etc/fdfs/client.conf delete group1 M00/00/00/OlPQG1Db6jWAFmbTAAADqdgNsks5096460_big
This is FastDFS client test program v4.04 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. [2012-12-27 14:31:42] DEBUG - base_path=/www/geebook_client, connect_timeout=30,
network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0 storage=58.83.208.27:23000
delete file success
显示删除成功
到此测试结束 FastDFS和apache/nginx整合
因为FastDFS默认自带的http服务器性能不好, 所以一般建议用外置的apache或者nginx 来解决http下载,以应付大并发的情况 注意nginx扩展模块只支持GET和HEAD模式获取文件,需要开发那边配合修改程序 获取nginx和FastDFS的nginx扩展插件
wget http://fastdfs-nginx-module.googlecode.com/files/fastdfs-nginx-module_v1.13.tar.gz
wget http://nginx.org/download/nginx-1.2.6.tar.gz 解压并编译安装
备注:如果之前机器上安装了nginx,可以单独安装fastdfs-nginx-module模块,具体方法请参考:如何单独添加NGINX自定义模块
apt-get install libssl-dev zlib1g-dev libpcre3-dev
tar zvxf nginx-1.2.6.tar.gz
tar zvxf fastdfs-nginx-module_v1.13.tar.gz
cd nginx-1.2.6
./configure --prefix=/usr/local/nginx --with-http_gzip_static_module --add-module=/www/soft/fastdfs-nginx-module/src/
make
make install