<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 1.2 fastDFS安裝和使用 ##1.2.1 libevent >老版本的fastDFS是基于libevent寫的,但是最新版的fastDFS最終網絡IO這部分重新用epoll實現了。 >所以如果是fastDFS是2.0之前,請先安裝好libevent環境。 之后就不用了。 ##1.2.2 libfastcommon git下載地址: https://github.com/happyfish100/libfastcommon.git ```bash ./make.sh sudo ./make.sh install ``` 確認make沒有錯誤后,執行安裝,64位系統默認會復制到/usr/lib64下。 這時候需要設置環境變量或者創建軟鏈接 ```bash export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/ ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so ``` ##1.2.3 安裝fastDFS 下載 FastDFS 源程序,下載地址 http://code.google.com/p/fastdfs/downloads/list , 也可以用github下載。 https://github.com/happyfish100/fastdfs.git 這里我們下的是V5.05版本。 ```bash tar -zxvf fastdfs-5.05.tar.gz ``` ```bash ./make.sh sudo ./make.sh install ``` 確認make沒有錯誤后,執行安裝,默認會安裝到/usr/bin中,并在/etc/fdfs中添加三個配置文件。 ##1.2.4 修改配置文件 首先將三個文件的名字去掉sample,暫時只修改以下幾點,先讓fastdfs跑起來,其余參數調優的時候再考慮。 也可以考慮將三個文件備份一下。 **tracker.conf 中修改** ```bash base_path=/usr/fastdfs/tracker #用于存放日志。 ``` >注意 確保/usr/fastdfs/tracker 目錄存在 **storage.conf 中修改** ```bash base_path=/usr/fastdfs/storage #用于存放日志。 store_path0=/usr/fastdfs/fastdfs0 #存放數據,若不設置默認為前面那個。 tracker_server=192.168.2.105:22122 #指定tracker服務器地址。不能是127.0.0.1 ``` >注意 確保/usr/fastdfs/storage、 /usr/fastdfs/fastdfs0目錄存在 **client.conf 中同樣要修改** ```bash base_path=/usr/fastdfs/client #用于存放日志。 tracker_server=192.168.2.105:22122 #指定tracker服務器地址。 ``` >注意 確保/usr/fastdfs/client 目錄存在 ##1.2.5 啟動tracker和storage ```bash /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf /usr/bin/fdfs_storaged /etc/fdfs/storage.conf ``` 檢查進程 ```bash root@ubuntu:~# ps -ef |grep fdfs root 7819 1 0 15:24 ? 00:00:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf root 8046 1 0 15:36 ? 00:00:01 fdfs_storaged /etc/fdfs/storage.conf start ``` 表示啟動ok了,若有錯誤,可以在/usr/fastdfs/tracker/logs 目錄下檢查日志。 ##1.2.6 上傳、刪除測試 **上傳文件:** 使用自帶的fdfs_test來測試,使用格式如下: ```bash fdfs_test /etc/fdfs/client.conf upload abcd.txt ``` ```bash his is FastDFS client test program v5.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. [2016-07-25 13:03:09] DEBUG - base_path=/usr/fastdfs, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0 tracker_query_storage_store_list_without_group: server 1. group_name=, ip_addr=192.168.2.105, port=23000 group_name=group1, ip_addr=192.168.2.105, port=23000 storage_upload_by_filename group_name=group1, remote_filename=M00/00/00/wKgCaVeVnY2AcveAAAAAFDGtH6s805.txt source ip address: 192.168.2.105 file timestamp=2016-07-25 13:03:09 file size=20 file crc32=833429419 example file url: http://192.168.2.105/group1/M00/00/00/wKgCaVeVnY2AcveAAAAAFDGtH6s805.txt storage_upload_slave_by_filename group_name=group1, remote_filename=M00/00/00/wKgCaVeVnY2AcveAAAAAFDGtH6s805_big.txt source ip address: 192.168.2.105 file timestamp=2016-07-25 13:03:09 file size=20 file crc32=833429419 example file url: http://192.168.2.105/group1/M00/00/00/wKgCaVeVnY2AcveAAAAAFDGtH6s805_big.txt ``` **刪除文件** ```bash fdfs_delete_file /etc/fdfs/client.conf group1/M00/00/00/wKgCaVeVnY2AcveAAAAAFDGtH6s805_big.txt ``` 可以看到,上傳ok了,這里會生成兩個文件,這是fastdfs的主/從文件特性,以后再介紹。example file url是不能在瀏覽器中直接打開的,除非配合nginx使用,這里我不需要了。刪除文件需要完整的group_name和remote_filename。 一些其他的指令均在fastdfs/client目錄中。 包括指令: ```bash fdfs_appender_test fdfs_append_file fdfs_delete_file fdfs_file_info fdfs_storaged fdfs_test1 fdfs_upload_appender fdfs_appender_test1 fdfs_crc32 fdfs_download_file fdfs_monitor fdfs_test fdfs_trackerd fdfs_upload_file ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看