欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

FastDFS配置過(guò)程

系統(tǒng) 1974 0

在我的生產(chǎn)環(huán)境中利用FastDFS實(shí)現(xiàn)動(dòng)靜分離的方案

?

配置過(guò)程

1.? 系統(tǒng)環(huán)境

CentOS 5.5

Tracker server: 192.168.204.135

Storage server: 192.168.204.136

?

2. 環(huán)境配置

為了速度,配置使用sohu的源

      cd /etc/
      
        yum
      
      .repo.d/


      
        wget
      
       http:
      
        //
      
      
        mirrors.sohu.com/help/CentOS-Base-sohu.repo
      
    

裝開(kāi)發(fā)工具和編譯nginx所需的開(kāi)發(fā)包

      
        yum
      
       groupinstall 
      
        "
      
      
        Development Tools
      
      
        "
      
      
        yum
      
      
        install
      
       libevent-devel pcre-devel  zlib-devel
    

?

3.安裝trackerserver

      
        # wget
      
       http:
      
        //
      
      
        fastdfs.googlecode.com/files/FastDFS_v3.05.tar.gz
      
      

# 
      
        tar
      
       xvzf FastDFS_v3.
      
        05
      
      .
      
        tar
      
      
        .gz

# cd FastDFS

# 
      
      
        vi
      
      
        make
      
      .
      
        sh
      
      
        

    將如下兩行前邊的
      
      
        "
      
      
        #
      
      
        "
      
      
        刪除

    WITH_HTTPD
      
      =
      
        1
      
      
        

    WITH_LINUX_SERVICE
      
      =
      
        1
      
      
        

# .
      
      /
      
        make
      
      .
      
        sh
      
      
        

# .
      
      /
      
        make
      
      .
      
        sh
      
      
        install
      
    

修改/etc/fdfs/tracker.conf,主要修改以下兩處,如有其他調(diào)整,可參考文檔自行調(diào)整,默認(rèn)的配置也可以工作。

      
        # vi
      
       /etc/fdfs/
      
        tracker.conf

    # the base path to store data and log files

    base_path
      
      =/fastdfs/tracker     ====>
      
         放置data和log的目錄

  ##include http.conf   
      
      ====>   #include http.conf    這里一定要注意!是 #include,不是include!!!
      
        

# 
      
      
        mkdir
      
       -p /fastdfs/
      
        tracker

# 
      
      /etc/init.d/
      
        fdfs_trackerd start

# netstat –ntplu 
      
      |
      
        grep
      
       -E ‘
      
        8080
      
      |
      
        22122
      
      
        ’

tcp        
      
      
        0
      
      
        0
      
      
        0.0
      
      .
      
        0.0
      
      :
      
        22122
      
      
        0.0
      
      .
      
        0.0
      
      :*                   LISTEN      
      
        5149
      
      /
      
        fdfs_trackerd

tcp        
      
      
        0
      
      
        0
      
      
        0.0
      
      .
      
        0.0
      
      :
      
        8080
      
      
        0.0
      
      .
      
        0.0
      
      :*                   LISTEN      
      
        5149
      
      /fdfs_trackerd
    

?

4. 在storage上的操作

      # 
      
        wget
      
       http:
      
        //
      
      
        fastdfs.googlecode.com/files/FastDFS_v3.05.tar.gz
      
      

# 
      
        wget
      
       http:
      
        //
      
      
        fastdfs.googlecode.com/files/fastdfs-nginx-module_v1.10.tar.gz
      
      

# 
      
        wget
      
       http:
      
        //
      
      
        nginx.org/download/nginx-1.0.11.tar.gz
      
      

# 
      
        tar
      
       xvzf FastDFS_v3.
      
        05
      
      .
      
        tar
      
      
        .gz

# cd FastDFS

# 
      
      
        vi
      
      
        make
      
      .
      
        sh
      
      
        

    將如下兩行前邊的
      
      
        "
      
      
        #
      
      
        "
      
      
        刪除

    WITH_HTTPD
      
      =
      
        1
      
      
        

    WITH_LINUX_SERVICE
      
      =
      
        1
      
      
        

# .
      
      /
      
        make
      
      .
      
        sh
      
      
        

# .
      
      /
      
        make
      
      .
      
        sh
      
      
        install
      
      
        

# 
      
      
        tar
      
       xvzf nginx-
      
        1.0
      
      .
      
        11
      
      .
      
        tar
      
      
        .gz

# 
      
      
        tar
      
       xvzf fastdfs-nginx-module_v1.
      
        10
      
      .
      
        tar
      
      
        .gz

# cd nginx
      
      -
      
        1.0
      
      .
      
        11
      
      
        

# .
      
      /configure --prefix=/soft/nginx --add-module=/root/fastdfs-nginx-module/
      
        src

# 
      
      
        make
      
      
        

# 
      
      
        make
      
      
        install
      
    

修改/etc/fdfs/storage.conf,主要修改以下幾處,如有其他調(diào)整,可參考文檔自行調(diào)整,默認(rèn)的配置也可以工作。

      # 
      
        vi
      
       /etc/fdfs/
      
        storage.conf

   # the name of the group this storage server belongs to

    group_name
      
      =group1 ====>
      
         此臺(tái)storage server所屬的服務(wù)器組名

    # the base path to store data and log files

    base_path
      
      =/home/storage ====>
      
         放置data和log的目錄

   

    # store_path#, based 
      
      
        0
      
      , 
      
        if
      
       store_path0 not exists, it
      
        '
      
      
        s value is base_path
      
      
            # the paths must be exist

    store_path0
      
      =/fastdfs/storage             ====>
      
         放置文件的目錄

    # tracker_server can ocur 
      
      
        more
      
      
         than once, and tracker_server format is

    #  
      
      
        "
      
      
        host:port
      
      
        "
      
      , host can be 
      
        hostname
      
      
         or ip address

    tracker_server
      
      =
      
        192.168
      
      .
      
        204.135
      
      :
      
        22122
      
               ====>
      
         tracker server的ip和端口,此處可以寫多個(gè)tracker server,每行一個(gè)

    #HTTP settings

    http.disabled
      
      =
      
        true
      
                          ====>
      
         關(guān)閉內(nèi)置的web server

    # the port of the web server on this storage server

    http.server_port
      
      =
      
        80
      
                          ====>
      
         web server的端口改成80

# 
      
      
        cp
      
       /root/fastdfs-nginx-module/mod_fastdfs.conf /etc/fdfs/
      
        

# 
      
      
        vi
      
       /etc/fdfs/
      
        mod_fastdfs.conf

    # the base path to store log files

    base_path
      
      =/fasdfs/storage                 ====>
      
         放置log的目錄

    # FastDFS tracker_server can ocur 
      
      
        more
      
      
         than once, and tracker_server format is

    #  
      
      
        "
      
      
        host:port
      
      
        "
      
      , host can be 
      
        hostname
      
      
         or ip address

    tracker_server
      
      =
      
        192.168
      
      .
      
        204.135
      
      :
      
        22122
      
               ====>
      
         tracker server的ip和端口,此處可以寫多個(gè)tracker server,每行一個(gè)

    # the group name of storage server

    group_name
      
      =group1                     ====>
      
         此臺(tái)storage server所屬的服務(wù)器組名

    # 
      
      
        if
      
      
         uri including group name

    # default value is 
      
      
        false
      
      
        

    url_have_group_name 
      
      = 
      
        true
      
                   ====>
      
         在URL中包含group名稱

    # store_path#, based 
      
      
        0
      
      , 
      
        if
      
       store_path0 not exists, it
      
        '
      
      
        s value is base_path
      
      
            # the paths must be exist

    store_path0
      
      =/fastdfs/storage             ====>
      
         放置文件的目錄

response_mode
      
      =redirect                ====>
      
         對(duì)文件同步延遲的處理方式,通過(guò)redirect跳轉(zhuǎn)和proxy代理兩種方式解決

# 
      
      
        mkdir
      
       -p /fastdfs/storage
    

啟動(dòng)storage服務(wù)

      #  /etc/init.d/fdfs_storaged start
    

啟動(dòng)nginx

      #  /usr/local/nginx/sbin/nginx
    

確認(rèn)8080,22122端口已經(jīng)監(jiān)聽(tīng)

      # netstat -ntplu|
      
        grep
      
       -E 
      
        '
      
      
        80|23000
      
      
        '
      
      
        

tcp        
      
      
        0
      
      
        0
      
      
        0.0
      
      .
      
        0.0
      
      :
      
        80
      
      
        0.0
      
      .
      
        0.0
      
      :*                   LISTEN      
      
        2797
      
      /
      
        nginx

tcp        
      
      
        0
      
      
        0
      
      
        0.0
      
      .
      
        0.0
      
      :
      
        23000
      
      
        0.0
      
      .
      
        0.0
      
      :*                   LISTEN      
      
        6524
      
      /fdfs_storaged
    

?

5. 在tracker上的操作[作為client測(cè)試]

修改/etc/fdfs/client.conf文件,主要修改以下幾處,如有其他調(diào)整,可參考文檔自行調(diào)整,默認(rèn)的配置也可以工作。

      
            # the base path to store log files

    base_path
      
      =/
      
        tmp

 

    # tracker_server can ocur 
      
      
        more
      
      
         than once, and tracker_server format is

    #  
      
      
        "
      
      
        host:port
      
      
        "
      
      , host can be 
      
        hostname
      
      
         or ip address

    tracker_server
      
      =
      
        192.168
      
      .
      
        204.135
      
      :
      
        22122
      
    

創(chuàng)建一個(gè)用于測(cè)試的文件demofile.txt

      [root@tracker]# 
      
        vi
      
      
         demofile.txt

    內(nèi)容就一行字:  dddddddddd
      
    

使用自帶的fdfs_test上傳文件測(cè)試。

      [root@tracker]# /usr/local/bin/fdfs_test /etc/fdfs/
      
        client.conf upload demofile.txt

This is FastDFS client test program v3.
      
      
        05
      
      
        

 

Copyright (C) 
      
      
        2008
      
      , Happy Fish /
      
         YuQing

 

FastDFS may be copied only under the terms of the GNU General

Public License V3, 
      
      
        which
      
       may be found 
      
        in
      
      
         the FastDFS source kit.

Please visit the FastDFS Home Page http:
      
      
        //
      
      
        www.csource.org/
      
      
        for
      
      
        more
      
      
         detail.

 

[
      
      
        2012
      
      -
      
        01
      
      -
      
        20
      
      
        14
      
      :
      
        36
      
      :
      
        04
      
      ] INFO - base_path=/tmp, connect_timeout=
      
        30
      
      , network_timeout=
      
        60
      
      , tracker_server_count=
      
        1
      
      , anti_steal_token=
      
        0
      
      , anti_steal_secret_key length=
      
        0
      
      
        

 

tracker_query_storage_store_list_without_group:

        server 
      
      
        1
      
      . group_name=group1, ip_addr=
      
        192.168
      
      .
      
        204.136
      
      , port=
      
        23000
      
      
        

 

group_name
      
      =group1, ip_addr=
      
        192.168
      
      .
      
        204.136
      
      , port=
      
        23000
      
      
        

storage_upload_by_filename

group_name
      
      =group1, remote_filename=M00/
      
        00
      
      /
      
        00
      
      /wKgD4k8ZC1SNK-
      
        NYAAAAC3lx3Rk484.txt

source ip address: 
      
      
        192.168
      
      .
      
        204.136
      
      
        file
      
       timestamp=
      
        2012
      
      -
      
        01
      
      -
      
        20
      
      
        14
      
      :
      
        36
      
      :
      
        04
      
      
        file
      
       size=
      
        11
      
      
        file
      
       crc32=
      
        2037505305
      
      
        file
      
       url: http:
      
        //
      
      
        192.168.204.135:8080/group1/M00/00/00/wKgD4k8ZC1SNK-NYAAAAC3lx3Rk484.txt
      
      
        storage_upload_slave_by_filename

group_name
      
      =group1, remote_filename=M00/
      
        00
      
      /
      
        00
      
      /wKgD4k8ZC1SNK-
      
        NYAAAAC3lx3Rk484_big.txt

source ip address: 
      
      
        192.168
      
      .
      
        204.136
      
      
        file
      
       timestamp=
      
        2012
      
      -
      
        01
      
      -
      
        20
      
      
        14
      
      :
      
        36
      
      :
      
        04
      
      
        file
      
       size=
      
        11
      
      
        file
      
       crc32=
      
        2037505305
      
      
        file
      
       url: http:
      
        //
      
      
        192.168.204.135:8080/group1/M00/00/00/wKgD4k8ZC1SNK-NYAAAAC3lx3Rk484_big.txt
      
    

?

通過(guò)http://192.168.204.136/group1/M00/00/00/wKgD4k8ZC1SNK-NYAAAAC3lx3Rk484_big.txt 址可以直接訪問(wèn)storage地址。

FastDFS配置過(guò)程


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 久久久久国产成人精品亚洲午夜 | 91蝌蚪在线播放 | 天堂在线观看中文字幕 | 欧美黑人玩白人巨大极品 | 国产高清第一页 | 成人深夜福利 | 国产在亚洲线视频观看 | 久久99精品久久久久久琪琪 | 欧美vide| 夜操| 日韩欧美精品在线 | 青青草91| 日韩欧美二区 | 成人爽a毛片在线视频网站 婷婷色在线观看 | 久久中文字幕美谷朱里 | 日韩伦理免费在线观看 | 国产精品免费视频网站 | 青草草在线观看免费视频 | 国产一区二区三区在线电影 | 亚洲欧美一区二区三区在线 | 国产乱妇无码大黄AA片 | 国产一起色一起爱 | 99草在线| 久久美女精品国产精品亚洲 | 久久久网| 午夜影院在线免费观看视频 | 色狠狠成人综合色 | 午夜视频免费 | 午夜色大片在线观看 | av影音资源| 99久久久国产精品露出 | 九九热免费视频在线观看 | 久久精品伊人 | 一区二区三区亚洲 | 久在线观看视频 | 亚洲呦呦系列视频 | 一区二区三区毛A片特级 | 天天摸天天揉天天碰天天弄 | 欧美日日射 | 6月婷婷 | 欧美日韩一区在线 |