日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

1Nginx+fastdfs分布式文件存储

發(fā)布時間:2024/9/27 Nginx 70 豆豆
生活随笔 收集整理的這篇文章主要介紹了 1Nginx+fastdfs分布式文件存储 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.


準備,將所需的軟件傳到服務器上,服務器的列表如下:

fastdfs-nginx-module_v1.15.tar.gz

FastDFS_v4.06.tar.gz

libevent-2.0.21-stable.tar.gz

nginx-1.5.6.tar.gz

openssl-1.0.1c.tar.gz

pcre-8.36.tar.gz

zlib-1.2.7.tar.gz

  • 首先切換到root用戶,命令是:

  • su root

  • 刪除系統(tǒng)自帶的低版本的libevent , 注意:這里的trackerstorage端都做相同的操作。

  • 查看系統(tǒng)上是否安裝了libevent

    rpm -qa | grep libevent

    libevent-1.4.13-4.el6.x86_64

    刪除已經(jīng)安裝過的libevent

    yum remove libevent-1.4.13-4.el6.x86_64

    3?安裝libevent2.0.21,可以通過.wget的方式進行下來所需要的tar

    1>.wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz

    2> tar -zxvf libevent-2.0.21-stable.tar.gz

    3> cd libevent-2.0.21-stable

    4> ./configure --prefix=/usr/local/libevent

    5> make && make install

    6>libevent創(chuàng)建軟鏈接到/lib庫下,64位系統(tǒng)對應/lib64?(注意下面的的只選擇其一)

    ?????ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5

    ?????ln -s /usr/local/libevent/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5

    4安裝Fastdfs

    1>下載Fastdfs,需要翻墻來。

    ????????wget http://fastdfs.googlecode.com/files/FastDFS_v4.06.tar.gz

    2> tar -zxvf FastDFS_v4.06.tar.gz

    3> cd FastDFS

    4>由于定義/usr/local/fastdfsfastdfs安裝目錄,所以需要修改make.sh

    ??vim make.sh

    ??#內(nèi)容更改如下

    ??TARGET_PREFIX=/usr/local 修改為 /usr/local/fastdfs

    ??/etc/fdfs全部替換為 /usr/local/fastdfs/conf

    vim替換命令,進入末行模式(ESC?再按shift :)

    %s/\/etc\/fdfs/\/usr\/local\/fastdfs\/conf/g?(注意,這里”\/”表示轉(zhuǎn)義’/’ ,g表示全部替換)

    5>安裝

    ./make.sh C_INCLUDE_PATH=/usr/local/libevent/include LIBRARY_PATH=/usr/local/libevent/lib

    ./make.sh install

    ===================以上是TrackerStorage都需要安裝的部分======================

    5配置Tracker(它是單獨一臺電腦上的,并且在使用storage服務器的時候,此端要先啟動)

    注意Tracker服務器IP地址不能是127.0.0.1Tacker不能和Storage在一臺電腦上。

    1>創(chuàng)建tracker目錄保存運行日志

    ????????mkdir -m 777 -p /home/fastdfs/tracker

    2>修改tracker.conf配置

    ????????vim /usr/local/fastdfs/conf/tracker.conf

    3>修改內(nèi)容如下所示

    ????????# the tracker server port

    ????????port=22122

    ????????# the base path to store data and log files

    ????????base_path=/home/yuqing/fastdfs -> base_path=/home/fastdfs/tracker #日志目錄

    ????????#開啟自定義server ID取代ip形式,方便內(nèi)部網(wǎng)絡服務器更換ip#**此方式要重點理解,4.0以后新特性

    ????????use_storage_id = true #使用server ID作為storage server標識

    ????????storage_ids_filename = storage_ids.conf #<id> <group_name> <ip_or_hostname>

    ????????id_type_in_filename = id #文件名反解析中包含server ID,以前是ip

    復制代碼

    ?

    4>移動storage_ids.conf文件

    ????????cp? <FastDFS源碼目錄>/conf/storage_ids.conf /usr/local/fastdfs/conf/

    ?

    5>編輯storage服務器IDIP地址的對應關(guān)系

    ????????vim /usr/local/fastdfs/conf/storage_ids.conf

    ?????????? 修改內(nèi)容如下所示

    ????????#<id> <group_name> <ip_or_hostname>

    ?????????100001????????? group1??????????192.168.1.12

    ????????#100002????????? group2?????????? 192.168.1.13

    ????????#100003????????? group2?????????? 192.168.1.14

    ?

    6>編輯tracker服務器啟動腳本

    ????????vim /etc/init.d/fdfs_trackerd

    ????????#啟動腳本內(nèi)容如下

    ?

    ????????#!/bin/bash

    ????????#

    ????????# fdfs_trackerd Starts fdfs_trackerd

    ????????#

    ????????#

    ????????# chkconfig: 2345 99 01

    ????????# description: FastDFS tracker server

    ????????### BEGIN INIT INFO

    ????????# Provides: $fdfs_trackerd

    ????????### END INIT INFO

    ????????# Source function library.

    ????????. /etc/init.d/functions

    ????????FastDfs='/usr/local/fastdfs'

    ????????CONF="$FastDfs/conf/tracker.conf"

    ????????if [ ! -f $CONF ]; then

    ????????? echo "file $CONF does not exist!"

    ????????? exit 2

    ????????fi

    ????????PRG="$FastDfs/bin/fdfs_trackerd"

    ????????if [ ! -f $PRG ]; then

    ????????? echo "file $PRG does not exist!"

    ????????? exit 2

    ????????fi

    ????????Stop="$FastDfs/bin/stop.sh"

    ????????if [ ! -f $Stop ]; then

    ????????? echo "file $Stop does not exist!"

    ????????? exit 2

    ????????fi

    ????????Restart="$FastDfs/bin/restart.sh"

    ????????if [ ! -f $Restart ]; then

    ????????? echo "file $Restart does not exist!"

    ????????? exit 2

    ????????fi

    ????????RETVAL=0

    ????????start() {

    ??????????? echo -n $"Starting FastDFS tracker server: "

    ??????????? $PRG $CONF &

    ??????????? RETVAL=$?

    ??????????? echo

    ??????????? return $RETVAL

    ????????}

    ????????stop() {

    ??????????? echo -n $"Stop FastDFS tracker server: "

    ??????????? $Stop $PRG $CONF

    ??????????? RETVAL=$?

    ??????????? return $RETVAL

    ????????}

    ????????rhstatus() {

    ??????????? status fdfs_trackerd

    ????????}

    ????????restart() {

    ??????????????????$Restart $PRG $CONF &

    ????????}

    ????????case "$1" in

    ????????? start)

    ??????????? start

    ??????????? ;;

    ????????? stop)

    ??????????? stop

    ??????????? ;;

    ????????? status)

    ??????????? rhstatus

    ??????????? ;;

    ????????? restart|reload)

    ??????????? restart

    ??????????? ;;

    ????????? condrestart)

    ??????????? restart

    ??????????? ;;

    ????????? *)

    ??????????? echo $"Usage: $0 {start|stop|status|restart|condrestart}"

    ??????????? exit 1

    ????????esac

    ????????exit $?

    7>給啟動腳本增加權(quán)限

    ????????chmod 777 /etc/init.d/fdfs_trackerd

    ?

    8>啟動tracker

    ????????service fdfs_trackerd restart

    9>啟動成功,加入開機啟動

    ????????vim /etc/rc.d/rc.local

    ????????#加入內(nèi)容如下

    ????????service fdfs_trackerd start

    10>防火墻開啟tracker端口22122

    ????????vim /etc/sysconfig/iptables

    ????????#加入內(nèi)容如下

    ????????-A INPUT -m state --state NEW -m tcp -p tcp --dport 22122 -j ACCEPT

    11>重啟防火墻

    ????????service iptables restart

    注意的時候,最后運行Tracker的時候,要關(guān)閉防火墻,也就是說要執(zhí)行service iptables stop

    ===============================================================================

    6.配置storage服務器,注意的是storageNginx是在另外一臺電腦上的。

    1>創(chuàng)建Storage目錄保存運行日志及其data數(shù)據(jù)

    ????????mkdir-m 777 -p /home/fastdfs/storage

    2>修改storage.conf配置

    ????????vim/usr/local/fastdfs/conf/storage.conf

    ????????#修改內(nèi)容如下所示

    ?

    ????????#the name of the group this storage server belongs to

    ????????group_name=group1#設(shè)置組名

    ????????#the name of the group this storage server belongs to

    ????????#the storage server port #the storage server port

    ????????port=23000

    ????????#the base path to store data and log files #日志目錄

    ????????base_path=/home/yuqing/fastdfs-> /home/fastdfs/storage

    ????????#store_path#, based 0, if store_path0 not exists, it's value is base_path #data數(shù)據(jù)存儲目錄

    ????????#the paths must be exist

    ????????store_path0=/home/fastdfs/storage

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

    ????????#? "host:port", host can be hostnameor ip address

    ????????tracker_server=192.168.209.121:22122->192.168.1.11:22122? 這里192.168.1.11:22122表示的是tracker所在電腦的ip地址

    ?

    ?3>編輯啟動腳本

    ????????vim/etc/init.d/fdfs_storaged

    ????????#啟動腳本內(nèi)容如下

    ?

    ????????#!/bin/bash

    ????????#

    ????????#fdfs_storaged Starts fdfs_storaged

    ????????#

    ????????#

    ????????#chkconfig: 2345 99 01

    ????????#description: FastDFS storage server

    ????????###BEGIN INIT INFO

    ????????#Provides: $fdfs_storaged

    ????????###END INIT INFO

    ????????#Source function library.

    ????????./etc/init.d/functions

    ????????FastDfs='/usr/local/fastdfs'

    ????????CONF="$FastDfs/conf/storage.conf"

    ????????if[ ! -f $CONF ]; then

    ????????? echo "file $CONF does not exist!"

    ????????? exit 2

    ????????fi

    ????????PRG="$FastDfs/bin/fdfs_storaged"

    ????????if[ ! -f $PRG ]; then

    ????????? echo "file $PRG does not exist!"

    ????????? exit 2

    ????????fi

    ????????Stop="$FastDfs/bin/stop.sh"

    ????????if[ ! -f $Stop ]; then

    ????????? echo "file $Stop does not exist!"

    ????????? exit 2

    ????????fi

    ????????Restart="$FastDfs/bin/restart.sh"

    ????????if[ ! -f $Restart ]; then

    ????????? echo "file $Restart does notexist!"

    ????????? exit 2

    ????????fi

    ????????RETVAL=0

    ????????start(){

    ??????????? echo -n $"Starting FastDFS storageserver: "

    ??????????? $PRG $CONF &

    ??????????? RETVAL=$?

    ??????????? echo

    ??????????? return $RETVAL

    ????????}

    ????????stop(){

    ??????????? echo -n $"Stop FastDFS storage server:"

    ??????????? $Stop $PRG $CONF

    ??????????? RETVAL=$?

    ??????????? return $RETVAL

    ????????}

    ????????rhstatus(){

    ??????????? status fdfs_storaged

    ????????}

    ????????restart(){

    ??????????????????$Restart$PRG $CONF &

    ????????}

    ????????case"$1" in

    ????????? start)

    ??????????? start

    ??????????? ;;

    ????????? stop)

    ??????????? stop

    ??????????? ;;

    ????????? status)

    ??????????? rhstatus

    ??????????? ;;

    ????????? restart|reload)

    ??????????? restart

    ??????????? ;;

    ????????? condrestart)

    ??????????? restart

    ??????????? ;;

    ????????? *)

    ??????????? echo $"Usage: $0{start|stop|status|restart|condrestart}"

    ??????????? exit 1

    ????????esac

    ????????exit$?

    ?

    4>給啟動腳本增加權(quán)限

    ????????chmod777 /etc/init.d/fdfs_storaged

    5>啟動storage?(注意的是,啟動storage的時候要先啟動storage

    ????????servicefdfs_storaged restart

    ????????#正常情況,接下來會出現(xiàn)很多mkdirdata path,這是系統(tǒng)在創(chuàng)建數(shù)據(jù)目錄

    ?

    6>啟動成功,加入開機啟動

    ????????vim/etc/rc.d/rc.local

    ????????#加入內(nèi)容如下

    ????????servicefdfs_storaged start

    ?

    7.安裝nginx(僅正在有Storage的電腦上安裝)

    ?

    1>創(chuàng)建nginx日志目錄

    ????????mkdir-m 777 -p /home/www/logs

    ?

    2>安裝nginx必需的庫:zlib-developenssl-devel pcre

    ?????yum -y install zlib-devel openssl-devel

    ?

    3>手動安裝pcre

    ?????1> wgetftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz

    ?????2> tar -zxvf pcre-8.36.tar.gz

    ?????3> cd pcre-8.36

    ?????4> ./configure

    ?????5> make && make install

    ?????6> ln -s /usr/local/lib/libpcre.so.1 /lib

    ?

    4>安裝nginx

    ?????1> wget http://nginx.org/download/nginx-1.5.6.tar.gz

    ?????2> tar -zxvf nginx-1.5.6.tar.gz

    ?????3> cd nginx-1.5.6

    ?????4> ./configure --prefix=/usr/local/nginx --with-http_stub_status_module--with-http_ssl_module??(注意:這里的--with-http_ssl_module可以不加)

    ?????5> make && make install

    5>檢查nginx配置是否正確

    ??????/usr/local/nginx/sbin/nginx -t

    ?????

    6>查看nginx編譯選項

    ??????/usr/local/nginx/sbin/nginx -V

    ?

    7>編輯啟動腳本

    ??????vim /etc/init.d/nginxd

    ??????#啟動腳本內(nèi)容如下

    ?

    ????????#!/bin/sh

    ????????#

    ????????#nginx - this script starts and stops the nginx daemin

    ????????#

    ????????#description:? Nginx is an HTTP(S) server,HTTP(S) reverse \

    ????????#?????????????? proxy and IMAP/POP3 proxy server

    ????????#processname: nginx

    ????????#config:?????/usr/local/nginx/conf/nginx.conf

    ????????#pidfile:???? /usr/local/nginx/nginx.pid

    ?

    ????????#Source function library.

    ????????./etc/rc.d/init.d/functions

    ?

    ????????#Source networking configuration.

    ????????./etc/sysconfig/network

    ?

    ????????#Check that networking is up.

    ????????["$NETWORKING" = "no" ] && exit 0

    ?

    ????????#必填

    ????????nginx="/usr/local/nginx/sbin/nginx"

    ????????prog=$(basename$nginx)

    ????????#必填

    ????????NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"

    ?

    ????????[-f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx

    ?

    ????????lockfile=/var/lock/subsys/nginx

    ?

    ????????start(){

    ??????????? [ -x $nginx ] || exit 5

    ??????????? [ -f $NGINX_CONF_FILE ] || exit 6

    ??????????? echo -n $"Starting $prog: "

    ??????????? daemon $nginx -c $NGINX_CONF_FILE

    ??????????? retval=$?

    ??????????? echo

    ??????????? #service php-fpm start

    ??????????? [ $retval -eq 0 ] && touch$lockfile

    ??????????? return $retval

    ????????}

    ????????stop(){

    ??????????? echo -n $"Stopping $prog: "

    ??????????? $nginx -s stop

    ??????????? echo_success

    ??????????? retval=$?

    ??????????? echo

    ??????????? #service php-fpm stop

    ??????????? [ $retval -eq 0 ] && rm -f$lockfile

    ??????????? return $retval

    ????????}

    ????????restart(){

    ??????????? stop

    ??????????? start

    ????????}

    ????????reload(){

    ??????????? configtest || return $?

    ??????????? echo -n $"Reloading $prog: "

    ??????????? $nginx -s reload

    ??????????? RETVAL=$?

    ??????????? echo

    ????????}

    ????????force_reload(){

    ??????????? restart

    ????????}

    ????????configtest(){

    ????????? $nginx -t -c $NGINX_CONF_FILE

    ????????}

    ????????version(){

    ????????? $nginx -V

    ????????}

    ????????rh_status(){

    ??????????? status $prog

    ????????}

    ????????rh_status_q(){

    ?????????? ?rh_status >/dev/null 2>&1

    ????????}

    ?

    ????????case"$1" in

    ??????????? start)

    ??????????????????rh_status_q&& exit 0

    ??????????????????$1

    ??????????????????;;

    ??????????? stop)

    ??????????????????rh_status_q|| exit 0

    ??????????????????$1

    ??????????????????;;

    ??????????? restart|configtest|version)

    ??????????????????$1

    ??????????????????;;

    ??????????? reload)

    ??????????????????rh_status_q|| exit 7

    ??????????????????$1

    ??????????????????;;

    ??????????? force-reload)

    ??????????????????force_reload

    ??????????????????;;

    ??????????? status)

    ??????????????????rh_status

    ??????????????????;;

    ??????????? condrestart|try-restart)

    ??????????????????rh_status_q|| exit 0

    ????????????????????? ;;

    ??????????? *)

    ??????????????????echo$"Usage: $0{start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest|version}"

    ??????????????????exit2

    ????????esac

    ?

    8>給啟動腳本增加權(quán)限

    ????????chmod777 /etc/init.d/nginxd

    ?

    9>啟動nginx

    ????????servicenginxd restart

    ????????如果啟動失敗提示找不到庫,ldconfig更新庫路徑

    ?

    10>啟動成功,加入開機啟動

    ????????vim/etc/rc.d/rc.local

    ????????#加入內(nèi)容如下

    ????????servicenginxd start

    ?

    ?

    ?

    ?

    8.安裝nginx-module模塊(僅在有Storage的電腦上)

    ?

    1>下載fastdfs-nginx-modulegoogle被禁了,需要翻墻

    ????????wgethttp://fastdfs.googlecode.com/files/fastdfs-nginx-module_v1.15.tar.gz

    2> tar -zxvffastdfs-nginx-module_v1.15.tar.gz;

    3>修改插件配置文件,主要是跟安裝fastdfs目錄相關(guān)

    ????????vim<fastdfs-nginx-module源碼目錄>/src/config

    ????????#修改內(nèi)容如下

    ?

    ????????ngx_addon_name=ngx_http_fastdfs_module

    ????????HTTP_MODULES="$HTTP_MODULESngx_http_fastdfs_module"

    ????????NGX_ADDON_SRCS="$NGX_ADDON_SRCS$ngx_addon_dir/ngx_http_fastdfs_module.c"

    ????????CORE_INCS="$CORE_INCS/usr/local/fastdfs/include/fastdfs /usr/local/fastdfs/include/fastcommon/"

    ????????CORE_LIBS="$CORE_LIBS-L/usr/local/fastdfs/lib -lfastcommon -lfdfsclient"

    ????????CFLAGS="$CFLAGS-D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024'-DFDFS_MOD_CONF_FILENAME='\"/usr/local/fastdfs/conf/mod_fastdfs.conf\"'"

    ?

    ?

    4>復制mod_fastdfs.conf/usr/local/fastdfs/conf/目錄下

    ????????cp<fastdfs-nginx-module源碼目錄>/src/mod_fastdfs.conf /usr/local/fastdfs/conf/

    ?

    5>/usr/local/fastdfs/lib加入系統(tǒng)文件/etc/ld.so.conf中(編譯時使用的動態(tài)鏈接庫)

    ????????vim/etc/ld.so.conf

    ????????#修改內(nèi)容如下

    ????????/usr/local/fastdfs/lib

    ?

    6>更新庫文件緩存ld.so.cache

    ????????ldconfig

    7>編譯fastdfs-nginx-module模塊

    ?????1> cd nginx-1.5.6/

    ?????2> ./configure此處加上nginx之前的編譯參數(shù)(使用 /usr/local/nginx/sbin/nginx -V命令查看)--add-module=<fastdfs-nginx-module源碼目錄>/src

    ?????3> make && make install

    8>修改mod_fastdfs.conf配置

    ????????vim/usr/local/fastdfs/conf/mod_fastdfs.conf

    ????????#修改內(nèi)容如下

    ????????#if load FastDFS parameters from tracker server

    ????????#since V1.12

    ????????#default value is false

    ????????load_fdfs_parameters_from_tracker=true

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

    ????????#? "host:port", host can be hostnameor ip address

    ????????#valid only when load_fdfs_parameters_from_tracker is true

    ????????tracker_server=192.168.25.11:22122

    ????????#the port of the local storage server

    ????????#the default value is 23000

    ????????storage_server_port=23000

    ????????#the group name of the local storage server

    ????????group_name=group1#當前storage機器組名

    ????????#if the url / uri including the group name

    ????????#set to false when uri like /M00/00/00/xxx

    ????????#set to true when uri like ${group_name}/M00/00/00/xxx, such as group1/M00/xxx

    ????????#default value is false

    ????????url_have_group_name= true

    ????????#path(disk or mount point) count, default value is 1

    ????????#must same as storage.conf

    ????????store_path_count=1

    ????????#store_path#, based 0, if store_path0 not exists, it's value is base_path

    ????????#the paths must be exist

    ????????#must same as storage.conf

    ????????store_path0=/home/fastdfs/storage

    ????????#set the log filename, such as /usr/local/apache2/logs/mod_fastdfs.log

    ????????#empty for output to stderr (apache and nginx error_log file)

    ????????log_filename=/home/www/logs/mod_fastdfs.log

    ?

    ?

    ?9.修改nginx.conf配置

    ?????vim /usr/local/nginx/conf/nginx.conf

    ?????#修改內(nèi)容如下(下面的可以替換原來文件中的所有內(nèi)容)

    ?

    ????????worker_processes? 2;

    ????????error_log? /home/www/logs/error.log? notice;

    ????????pid??????? /home/www/logs/nginx.pid;

    ?

    ????????worker_rlimit_nofile5120;

    ????????events{

    ??????????? use epoll;

    ??????????? worker_connections? 5120;

    ????????}

    ?

    ????????http{

    ??????????? include?????? mime.types;

    ??????????? default_type? application/octet-stream;

    ?

    ??????????? sendfile??????? on;

    ??????????? tcp_nopush???? on;

    ??????????? keepalive_timeout? 60;

    ??????????? tcp_nodelay on;

    ?

    ??????????? server {

    ??????????????????listen?????? 80;

    ??????????????????server_name? localhost;

    ??????????????????location/group1/M00 {

    ????????????????????? alias /home/fastdfs/storage/data;

    ????????????????????? ngx_fastdfs_module;

    ??????????????????}

    ??????????? }

    ????????}

    ?

    ?

    10.測試(注意:如果不成功,還要修改client.config中的內(nèi)容)

    1.創(chuàng)建測試文件

    echo "hello nginx fastdfs" >test.html

    2.查看fastdfs自帶測試命令使用方法

    /usr/local/fastdfs/bin/fdfs_test -?

    3.上傳測試文件,通過tracker轉(zhuǎn)存到storage服務器里

    /usr/local/fastdfs/bin/fdfs_test/usr/local/fastdfs/conf/client.conf upload test.html

    ?

    得到以下信息

    ?

    tracker_query_storage_store_list_without_group:

    ????????server1. group_name=, ip_addr=172.16.63.13, port=23000

    ?

    group_name=group1, ip_addr=172.16.63.13,port=23000

    storage_upload_by_filename

    group_name=group1,remote_filename=M00/00/00/oYYBAFSSxiuABDlLAAAABncc3SA45.html

    source ip address: 172.16.63.13

    file timestamp=2014-12-18 20:18:51

    file size=6

    file crc32=1998380320

    file url:http://172.16.63.12:8080/group1/M00/00/00/oYYBAFSSxiuABDlLAAAABncc3SA45.html

    storage_upload_slave_by_filename

    group_name=group1, remote_filename=M00/00/00/oYYBAFSSxiuABDlLAAAABncc3SA45_big.html

    source ip address: 172.16.63.13

    file timestamp=2014-12-18 20:18:51

    file size=6

    file crc32=1998380320

    file url:http://172.16.63.12:8080/group1/M00/00/00/oYYBAFSSxiuABDlLAAAABncc3SA45_big.html

    ?

    4.打開瀏覽器,查看上傳文件

    ????????http://172.16.63.13/group1/M00/00/00/oYYBAFSSwuKAO89DAAAABncc3SA04.html

    ?

    看到"hello nginx fastdfs"則成功

    備注:

    1>由于沒有設(shè)置好防火墻,同組groupstorage之間備份數(shù)據(jù)失敗,關(guān)閉防火墻:service iptables stop

    2>至少有一個storage到主機安裝nginx

    3> mod_fastdfs.conf此配置文件安裝路徑

    4> tracker服務器ip不能是127.0.0.1

    ?

    ?

    總結(jié)

    以上是生活随笔為你收集整理的1Nginx+fastdfs分布式文件存储的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。