FastDfs工作筆記001---Centos下安裝FastDfs進行檔案儲存
我按照下面這個就安裝成功了,也沒有碰到什麼問題
參考文獻:http://dorole.com/tag/fastdfs/
安裝編譯環境
yum -y groupinstall 'Development Tools'
yum -y install wget
下載安裝libfastcommon
git clone https://github.com/happyfish100/libfastcommon.git
cd libfastcommon/
./make.sh
./make.sh install
下載安裝fastdfs
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
修改配置檔案
建立目錄,儲存日誌和資料,如下
-data
-fdfs
-tracker
-storage
-client
配置tracker
cd /etc/fdfs
mv tracker.conf.sample tracker.conf
vi tracker.conf
//...
base_path=/data/fdfs/tracker
//...
配置storage
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
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
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
可通過日誌檢視是否啟動成功
tail -f /data/fdfs/storage/logs/storaged.log
tail -f /data/fdfs/tracker/logs/trackerd.log
測試
利用dfds自帶的測試類進行測試
#上傳
/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
注:路徑中的M00是基路徑。fastdfs支援多個磁碟(base_path),如果base_path只有一個,那麼就是M00,如果有兩個,第二個是M01(Mxx中xx是十六進位制
最後,祝你好運,有些東西只是遠看才會覺得是龐然大物,近看其實就是隻貓
libfastcommonV1.0.7.tar.gz
---------------------
作者:Stella201603
來源:CSDN
原文:https://blog.csdn.net/xll233xx/article/details/50619170
版權宣告:本文為博主原創文章,轉載請附上博文連結!