centos中安装fastdfs

参考文献:http://dorole.com/tag/fastdfs/

安装编译环境
[html] view plain copy
yum -y groupinstall 'Development Tools'   
yum -y install wget   
下载安装libfastcommon
[html] view plain copy
git clone https://github.com/happyfish100/libfastcommon.git  
cd libfastcommon/  
./make.sh   
./make.sh install  
下载安装fastdfs
[html] view plain copy
https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz  
tar -zxvf V5.05.tar.gz   
cd fastdfs-5.05/  
./make.sh  
./make.sh install  
修改配置文件
创建目录,存储日志和数据,如下
[html] view plain copy
-data  
    -fdfs  
        -tracker  
        -storage  
        -client  
配置tracker

[html] view plain copy
cd /etc/fdfs  
mv tracker.conf.sample tracker.conf  
vi tracker.conf  
//...  
base_path=/data/fdfs/tracker  
//...  
配置storage
[html] view plain copy
cd /etc/fdfs  
mv storage.conf.sample storage.conf  
vi storage.conf  
//...  
base_path=/data/fdfs/storage #指定日志位置  
store_path0=/data/fdfs/storage #指定数据位置  
tracker_server=192.168.153.130:22122  #指定tracker服务器地址  
//...  
配置client
[html] view plain copy
cd /etc/fdfs  
mv client.conf.sample client.conf  
vi client.conf  
//...  
base_path=/data/fdfs/client  
tracker_server=192.168.153.130:22122  
//...  
启动tracker和storage
[html] view plain copy
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf   
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf   

可通过日志查看是否启动成功
[html] view plain copy
tail -f /data/fdfs/storage/logs/storaged.log   
tail -f /data/fdfs/tracker/logs/trackerd.log   
测试
利用dfds自带的测试类进行测试

[html] view plain copy
#上传  
/usr/bin/fdfs_test /etc/fdfs/client.conf  upload /home/lily/a.txt  

#下载  
/usr/bin/fdfs_download_file  /etc/fdfs/client.conf group1/M00/00/00/wKiZglauvkmANC2wAAAAPpWmuhI171.txt  

#删除  
/usr/bin/fdfs_delete_file  /etc/fdfs/client.conf group1/M00/00/00/wKiZglauvkmANC2wAAAAPpWmuhI171.txt  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值