1. 程式人生 > >【FastDFS】FastDFS安裝配置

【FastDFS】FastDFS安裝配置

1 FastDFS安裝

1.1 下載FastDFS及相關

進入目錄

cd/usr/local/

下載fastdfs-5.08:

下載libfastcommon-master,1.27:

安裝unzip

yuminstall -y unzip zip

解壓

unzipmaster

unzip master.zip

1.2安裝FastDFS依賴

安裝編譯環境,執行命令:

yum -ygroupinstall 'Development Tools'

安裝libfastcommon,執行命令:

cdlibfastcommon-master

./make.sh

./make.sh install

1.3安裝FastDFS

cdfastdfs-master/

./make.sh

./make.sh install

2 FastDFS配置

建立資料夾

mkdir -p/data/fdfs/

2.1配置tracker伺服器

配置tracker伺服器,只列出修改的內容,未列出內容無需修改。新增配置檔案:

cp/etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf

修改tracker配置檔案:

base_path=/data/fdfs

run_by_group=root

run_by_user=root

2.2啟動tracker

執行啟動命令:

/usr/bin/fdfs_trackerd/etc/fdfs/tracker.conf start

2.3配置storage伺服器

修改storage.conf檔案,只列出修改的內容,未列出內容無需修改。新增storage配置檔案:

cd/etc/fdfs

cp storage.conf.sample storage.conf

修改group1的storage配置檔案

group_name=group1

run_by_group=root

run_by_user=root

base_path=/data/fdfs

tracker_server=192.168.22.208:22122

store_path0=/data/fdfs

2.4啟動storage

在伺服器執行啟動storage命令:

/usr/bin/fdfs_storaged/etc/fdfs/storage.conf start

storage正確啟動後,需要建立連線,執行命令:

ln -s/data/fdfs/data /data/fdfs/data/M00

2.5配置storage的測試客戶端

為storage伺服器新增配置客戶端檔案

cd/etc/fdfs

cp client.conf.sample client.conf

修改client.conf檔案,未列出內容無需修改,修改項如下:

base_path=/data/fdfs

tracker_server=192.168.22.208:22122

3 FastDFS本地上傳測試

執行命令,觀察資訊

/usr/bin/fdfs_test/etc/fdfs/client.conf upload tracker.conf