导航

fastdfs

Posted on 2018-08-22 22:48  Simon1020  阅读(208)  评论(0编辑  收藏  举报

1.

yum -y install libevent

2.

libfastcommon-1.0.7.tar.gz

tar -zxvf libfastcommon-1.0.7.tar.gz

cd libfastcommon-1.0.7

./make.sh

./make.sh install

cd /usr/lib64/

cp libfastcommon.so /usr/lib

3.

FastDFS_v5.05.tar.gz

tar -zxvf FastDFS_v5.05.tar.gz

cd FastDFS

./make.sh

./make.sh install

cd /usr/bin

ll fdfs*

cd /etc/fdfs/

ll

cd /root/FastDFS/conf

cp /root/FastDFS/conf/* /etc/fdfs/

cd /etc/fdfs/

vim /etc/fdfs/tracker.conf

------------------------------

/base_path

base_path=/home/fastdfs/tracker

 

----------------------------------------------

mkdir /home/fastdfs/tracker -p

mkdir /home/fastdfs/storage -p

mkdir /home/fastdfs/client -p

启动track

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

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

 

4.

vim /etc/fdfs/storage.conf

-----------------------------

group_name=group1

base_path=/home/fastdfs/storage

store_path0=/home/fastdfs/storage

tracker_server=xxx.xx.xx.xx:22122

 

------------------------------

启动storage

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

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

 

5 .

查看进程

ps aux|grep storage

ps aux|grep track

 

6.

测试

 vim /etc/fdfs/client.conf

base_path=/home/fastdfs/client

tracker_server=xx.xx.xxx.xx:22122

/usr/bin/fdfs_test /etc/fdfs/client.conf upload /root/cat.jpg

**************************************************************************************

This 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.

[2018-08-22 22:46:24] DEBUG - base_path=/home/yuqing/fastdfs/client, 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=172.31.161.117, port=23000

group_name=group1, ip_addr=172.31.161.117, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/rB-hdVt9d0CAOYnSAABr5S_Msgo125.jpg
source ip address: 172.31.161.117
file timestamp=2018-08-22 22:46:24
file size=27621
file crc32=801944074
example file url: http://172.31.161.117/group1/M00/00/00/rB-hdVt9d0CAOYnSAABr5S_Msgo125.jpg
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/rB-hdVt9d0CAOYnSAABr5S_Msgo125_big.jpg
source ip address: 172.31.161.117
file timestamp=2018-08-22 22:46:24
file size=27621
file crc32=801944074
example file url: http://172.31.161.117/group1/M00/00/00/rB-hdVt9d0CAOYnSAABr5S_Msgo125_big.jpg

**************************************************************************************************************************************************

 7.

fastdfs-nginx-module_v1.16.tar.gz

vim src/config

根据情况删除三个 local/

8.

yum install gcc-c++

yum install pcre pcre-devel

yum install zlib zlib-devel

yum install openssl openssl-devel

nginx-1.14.0.tar.gz

tar -zxvf nginx-1.14.0.tar.gz

 

-----------------------------------

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--add-module=/home/tar/fastdfs-nginx-module/src

---------------------------------------------------------------

make

make install

cd /usr/local/nginx/

 

9.

cp /home/tar/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/

vim /etc/fdfs/mod_fastdfs.conf 

---------------------------------------------

 base_path=/home/fastdfs/tmp

tracker_server=xxx:22122

group_name=group1

url_have_group_name = true

store_path0=/home/fastdfs/storage

----------------------------------------------

 

mkdir /home/fastdfs/tmp -p

 

10.

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

 

 server {
  listen 88;
  server_name xxxxx;

  location /group1/M00 {
    ngx_fastdfs_mo:dule;
  }
}

 

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

mkdir /var/temp/nginx/client -p

./nginx 

11.

/etc/init.d/iptables status

/etc/init.d/iptables stop

 

13 

重启命令

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

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

/usr/local/nginx/sbin/nginx -s reload

 

ps aux|grep storage

ps aux|grep track

 ps aux|grep nginx

阿里云防火墙资料: https://www.cnblogs.com/yanghongfei/p/7168725.html