溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Linux系統(tǒng)如何安裝FastDFS

發(fā)布時(shí)間:2022-01-24 11:48:22 來(lái)源:億速云 閱讀:415 作者:小新 欄目:開發(fā)技術(shù)

這篇文章主要介紹Linux系統(tǒng)如何安裝FastDFS,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

FastDFS是一個(gè)開源的分布式文件系統(tǒng),她對(duì)文件進(jìn)行管理,功能包括:文件存儲(chǔ)、文件同步、文件訪問(wèn)(文件上傳、文件下載)等,解決了大容量存儲(chǔ)和負(fù)載均衡的問(wèn)題。

Linux系統(tǒng)安裝fastdfs具體步驟

環(huán)境:CentOS 7.4.1708 FastDFS版本: 6.04

安裝依賴

  • yum -y install gcc gcc+ gcc-c++ openssl openssl-devel pcre pcre-devel

安裝 libfastcommon

  1. 下載libfastcommon https://github.com/happyfish200/libfastcommon/releases

  2. 解壓并安裝libfastcommon:

tar zxvf libfastcommon-1.0.42.tar.gz
cd libfastcommon-1.0.42
./make.sh
./make.sh install

安裝 FastDFS

  1. 下載FastDFS https://github.com/happyfish200/fastdfs/releases

  2. 解壓并安裝FastDFS:

tar zxvf fastdfs-6.04.tar.gz
cd fastdfs-6.04
./make.sh
./make.sh install

配置

進(jìn)入fastdfs配置文件夾 cd /etc/fdfs

配置tracker服務(wù)
  1. 拷貝:cp tracker.conf.sample tracker.conf

  2. 編輯tracker.conf:vim tracker.conf

#tracker數(shù)據(jù)文件和日志存儲(chǔ)路徑,若不存在請(qǐng)自行創(chuàng)建
base_path=/data/fastdfs/tracker
#tracker服務(wù)端口,默認(rèn)22122
port=22122
# HTTP 服務(wù)端口
http.server_port=8080
  1. 啟動(dòng): /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start

配置storage服務(wù)
  1. 拷貝: cp storage.conf.sample storage.conf

  2. 編輯storage.conf: vim storage.conf

#storage所在組名稱
group_name=group1
#storage數(shù)據(jù)文件和日志目錄,若不存在請(qǐng)自行創(chuàng)建
base_path=/data/fastdfs/storage
#storage服務(wù)的存儲(chǔ)路徑個(gè)數(shù),需要和store_path個(gè)數(shù)匹配
store_path_count=1
#storage服務(wù)的實(shí)際文件存儲(chǔ)路徑
store_path0=/data/fastdfs/storage_data
#tracker服務(wù)的ip和端口,不要使用127.0.0.1
tracker_server=192.168.1.168:22122
  1. 啟動(dòng):/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start

  2. 查看:/usr/bin/fdfs_monitor /etc/fdfs/storage.conf

FastDFS測(cè)試
  1. 拷貝:cp client.conf.sample client.conf

  2. 編輯client.conf:vim client.conf

#tracker服務(wù)中配置的路徑
base_path=/data/fastdfs/tracker
#tracker服務(wù)的ip 端口
tracker_server=192.168.1.168:22122
#storage服務(wù)的實(shí)際文件存儲(chǔ)路徑
store_path0=/data/fastdfs/storage_data
  1. 測(cè)試上傳文件123.log:/usr/bin/fdfs_upload_file /etc/fdfs/client.conf 123.log Linux系統(tǒng)如何安裝FastDFS

以上是“Linux系統(tǒng)如何安裝FastDFS”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI