日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
FastDFS分布式存儲服務器安裝過程詳解

1.安裝FastDFS
(一) 安裝tracker
(二) 安裝storage
(三) 測試上傳

一、安裝FastDFS

下載FastDFS,官方下載地址: https://code.google.com/archive/p/fastdfs/downloads 需要翻墻訪問

(一)安裝tracker

  1. 首先需要安裝libevent

    下載libevent  官方下載地址 http://libevent.org/
    
    tar -zxvf libevent-2.0.22-stable.tar.gz  //解壓
    ./configure  // 配置
    make && make install  //編譯安裝
  1. 安裝tracker

    tar -zxvf FastDFS_v4.06.tar.gz   //解壓
    cd FastDFS/
    ./make.sh           //編譯
    ./make.sh install   //安裝

    安裝完成后 所有的可執(zhí)行文件在/usr/local/bin下,以fdfs開頭,所有配置文件在/etc/fdfs下

vim  /etc/fdfs/tracker.conf 

只需改動以下幾個參數(shù)即可:

disabled=false            #啟用配置文件
bind_addr=192.168.100.110  #綁定tracker 服務器的IP
port=22122                #設置tracker的端口號
base_path=base_path=/home/tracker/fastdfs  #設置tracker的數(shù)據(jù)文件和日志目錄(需預先創(chuàng)建)
http.server_port=8080     #設置http端口號
#最后一行加上 
#include http.conf

修改完成之后保存退出
(注:如需要進行性能調(diào)優(yōu),可以參照附錄的配置文件的詳細說明。)
創(chuàng)建對應文件

mkdir /home/tracker    
mkdir /home/tracker/fastdfs

把防火墻對應的端口打開 這里是22122
因為這里使用的是CentOS 7,防火墻和其他的是不一樣的,這里我們禁用CentOS自帶的Firewalls,下載一個iptables,使用這個

systemctl stop firewalld.service   #停止firewall
systemctl disable firewalld.service  #禁止firewall開機啟動
yum -y install iptables-services
vim /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22122 -j ACCEPT #保存退出 重啟防火墻
systemctl restart iptables.service

4.運行

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

確認是否啟動成功(查看22122端口是否監(jiān)聽)

netstat -unltp | grep fdfs

5 設置開機啟動

vim /etc/rc.d/rc.local

添加運行命令進文件

/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart

到這里tracker就安裝完成了

(二)安裝storage

1、使用剛剛的FastDFS_v4.06.tar.gz 安裝
2、首先需要安裝libevent
下載libevent 官方下載地址 http://libevent.org/

tar -zxvf libevent-2.0.22-stable.tar.gz  #解壓
./configure   #配置
make && make install #編譯安裝

3、安裝

    tar -zxvf FastDFS_v4.06.tar.gz   //解壓
    cd FastDFS/
    ./make.sh           //編譯
    ./make.sh install   //安裝

4、安裝完成 下面是配置的過程

vim /etc/fdfs/storage.conf 

一般需要配置以下項

disabled=false            #啟用配置文件
group_name=group1#組名,根據(jù)實際情況修改
bind_addr=192.168.100.111   #ip 配置storage服務器的ip
port=23000         #設置storage的端口號
base_path=/home/storage/fastdfs      #設置storage的日志目錄(需預先創(chuàng)建)
store_path_count=1          #存儲路徑個數(shù),需要和store_path個數(shù)匹配
store_path0=/home/storage/fastdfs     #存儲路徑
tracker_server=192.168.100.110:22122   #tracker服務器的IP地址和端口號
http.server_port=8080      #設置http端口號
#最后一行加上 
#include http.conf

保存退出 (注:如需要進行性能調(diào)優(yōu),可以參照附錄的配置文件的詳細說明。)
創(chuàng)建對應目錄

mkdir /home/storage     
mkdir /home/storage/fastdfs

5、運行
運行storage之前,先要把防火墻中對應的端口打開(本例中為23000)。

yum -y install iptables-services
vim /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 23000 -j ACCEPT

保存退出 重啟防火墻

systemctl restart iptables.service

啟動storage 查看對應端口是否開始監(jiān)聽

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

看到下面這情況就是啟動成功

確認啟動成功后,可以運行fdfs_monitor查看storage服務器是否已經(jīng)登記到tracker服務器。

 /usr/local/bin/fdfs_monitor /etc/fdfs/storage.conf

12、設置開機自動啟動

vim /etc/rc.d/rc.local

將運行命令行添加進文件:

/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf restart 

到這里 storage 安裝完成

(三)測試上傳

1、我們可以先測試一下上傳的功能,到tracker服務器
2、修改 client.conf 文件

vim client.conf

修改內(nèi)容:

base_path=/home/client/fastdfs          #日志和文件存放路徑
tracker_server=192.168.100.110:22122    #tracker 服務器ip
http.tracker_server_port=8080           #tracker 端口
#include http.conf #最后一行寫成這樣

修改之后保存退出

4、測試上傳

/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload /home/admin/Desktop/test.avi

上傳成功。但是現(xiàn)在使用這個URL 還不能訪問到資源。需要配個nginx 才行。我們可以去storage服務器查看之前對應創(chuàng)建的storage數(shù)據(jù)文件夾下面查看

文件已經(jīng)上傳到storage服務器
由于現(xiàn)在還不能訪問,所以我們需要配 nginx。


網(wǎng)站欄目:FastDFS分布式存儲服務器安裝過程詳解
分享地址:http://m.5511xx.com/article/coisihd.html