centos7下安裝fastdfs
阿新 • • 發佈:2019-01-29
參考文獻:http://dorole.com/tag/fastdfs/
可通過日誌檢視是否啟動成功
注:路徑中的M00是基路徑。fastdfs支援多個磁碟(base_path),如果base_path只有一個,那麼就是M00,如果有兩個,第二個是M01(Mxx中xx是十六進位制
轉載自:http://blog.csdn.net/xll233xx/article/details/50619170
- 安裝編譯環境
- 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
- 測試
- #上傳
- /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是十六進位制
轉載自:http://blog.csdn.net/xll233xx/article/details/50619170