FastDFS 搭建

#FastDFS安装方式
安装必要插件:libevent  (此次搭建方案采用libevent 1.4.13)
 
wget http://fastdfs.googlecode.com/files/FastDFS_v4.06.tar.gz
tar zxvf FastDFS_v4.06.tar.gz
cd FastDFS
./make.sh
./make.sh install
 
#运行Tracker
/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
#运行Storage
/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
 
#停止fastDFS服务
直接kill即可让server进程正常退出,可以使用killall命令,如:
killall fdfs_trackerd
killall fdfs_storaged

 

FastDFS 测试
 
FastDFS 安装包中,自带客户端程序,通过程序可以进行文件上传。使用客户端前先需要配置client.conf,然后在进行文件的上传及下载。
 
修改编辑文件client.conf
vim /etc/fdfs/client.conf
检查client.conf中 tracker_server,base_path,http.tracker_server_port
去除##include http.conf 改成 #include http.conf 用以支持http
 

#测试上传文件

创建test 文件 vim test 
 
/usr/local/bin/fdfs_test <config_file> <file_name>
 
/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload test   ---最后的test为文件名
 
上传成功终端会显示上传信息
 
/usr/local/bin/fdfs_monitor /etc/fdfs/client.conf
使用监视器查看fastDFS 文件系统相关信息
 
#下载文件测试
/usr/local/bin/fdfs_download_file <config_file> <file_id>
 
#删除文件测试
/usr/local/bin/fdfs_delete_file <config_file> <file_id>

 

posted @ 2014-04-01 18:23  Nopcn  阅读(681)  评论(1编辑  收藏  举报