标签:https add file tps 配置 archive files reader 通过
一、系统安装目录
源代码包目录 /data/wwwroot libevent安装目录 /usr/local/libevent FastDFS安装目录 /data/fastdfs nginx安装目录 /data/nmp/nginx
二、下载FastDFS安装包
https://sourceforge.net/projects/fastdfs/files/
https://sourceforge.net/projects/fastdfs/files/FastDFS%20Nginx%20Module%20Source%20Code/
https://github.com/happyfish100/libfastcommon/archive/master.zip
> uzip libfastcommon-master.zip > cd libfastcommon-master > ./make.sh > ./make.sh install
> yum install uzip zip
> tar zxf FastDFS_v5.08.tar.gz > cd FastDFS
> ./make.sh > ./make.sh install
> ll /usr/bin/fdfs*
> ll /etc/fdfs
> mkdir -m 777 /data/tracker > cd /etc/fdfs > cp tracker.conf.sample tracker.conf > vi tracker.conf
复制一份tracker.conf配置文件,配置。
#启用配置文件 disabled=false #设置tracker的端口号 port=22122 #设置tracker的数据文件和日志目录(需预先创建) base_path=/data/tracker #设置http端口号 http.server_port=8080
> /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
> netstat -unltp | grep fdfs
> vi /etc/rc.d/rc.local
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
> mkdir -m 777 /data/storage > cd /etc/fdfs > cp storage.conf.sample storage.conf > vi storage.conf
#启用配置文件 disabled=false #组名,根据实际情况修改 group_name=group1 #设置storage的端口号 port=23000 #设置storage的日志目录(需预先创建) base_path=/data/storage #存储路径个数,需要和store_path个数匹配 store_path_count=1 #存储路径 store_path0=/data/storage #tracker服务器的IP地址和端口号 tracker_server=192.168.9.10:22122 #设置http端口号 http.server_port=8080
> /usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
> netstat -unltp | grep fdfs
> /usr/bin/fdfs_monitor /etc/fdfs/storage.conf
> /data/nmp/nginx/sbin/nginx -V
configure arguments: --prefix=/data/nmp/nginx --with-pcre=/usr/src/pcre-8.38
> tar -zxf fastdfs-nginx-module_v1.16.tar.gz > cp -R fastdfs-nginx-module /data/nmp/
> tar -zxf nginx-1.8.1.tar.gz > cd nginx-1.8.1 > ./configure --prefix=/data/nmp/nginx --with-pcre=/usr/src/pcre-8.38 --add-module=/data/nmp/fastdfs-nginx-module/src > make
make[1]: *** [objs/addon/src/ngx_http_fastdfs_module.o] 错误 1
> make && make install
> vi /data/nmp/fastdfs-nginx-module/src/config CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
> cp objs/nginx /data/nmp/nginx/sbin/nginx
> cp /data/nmp/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
修改配置文件 #存放log目录 base_path=/data/storage #tracker服务器IP和端口(可写多个) tracker_server=192.168.9.10:22122 #storage所属的服务器组名 group_name=group1 #url中是否包含group名称 url_have_group_name = true #放置文件目录(可写多个) store_path0=/data/storage
[2016-04-15 01:31:46] ERROR - file: ini_file_reader.c, line: 394, include file "http.conf" not exists, line: "#include http.conf" [2016-04-15 01:31:46] ERROR - file: /data/nmp/fastdfs-nginx-module/src/common.c, line: 155, load conf file "/etc/fdfs/mod_fastdfs.conf" fail, ret code: 2
> cp /data/wwwroot/FastDFS/conf/http.conf /etc/fdfs/ > cp /data/wwwroot/FastDFS/conf/mime.types /etc/fdfs/
server { #监听的端口号 listen 8080; #虚拟主机名 server_name www.site.com; location ~ /group[0-9]/M00 { #路径 root /data/storage/data; ngx_fastdfs_module; } }
> ln -s /data/storage/data /data/storage/data/M00
> cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
base_path=/data/storage tracker_server=192.168.9.10:22122 http.tracker_server_port=8080
> echo "test..." > test.html > /usr/bin/fdfs_test /etc/fdfs/client.conf upload test.html
This is FastDFS client test program v5.08 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-04-15 05:56:03] DEBUG - base_path=/data/storage, 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.9.10, port=23000 group_name=group1, ip_addr=192.168.9.10, port=23000 storage_upload_by_filename group_name=group1, remote_filename=M00/00/00/wKgJClcQEfSAAELFAAAACMHelJo22.html source ip address: 192.168.9.10 file timestamp=2016-04-15 05:56:04 file size=8 file crc32=3252589722 example file url: http://192.168.9.10:8080/group1/M00/00/00/wKgJClcQEfSAAELFAAAACMHelJo22.html storage_upload_slave_by_filename group_name=group1, remote_filename=M00/00/00/wKgJClcQEfSAAELFAAAACMHelJo22_big.html source ip address: 192.168.9.10 file timestamp=2016-04-15 05:56:04 file size=8 file crc32=3252589722 example file url: http://192.168.9.10:8080/group1/M00/00/00/wKgJClcQEfSAAELFAAAACMHelJo22_big.html
http://192.168.9.10:8080/group1/M00/00/00/wKgJClcQEfSAAELFAAAACMHelJo22_big.html
http://www.site.com:8080/group1/M00/00/00/wKgJClcQEfSAAELFAAAACMHelJo22_big.html
Linux 下 FastDFS v5.08 分布式文件系统的安装
标签:https add file tps 配置 archive files reader 通过
原文地址:http://www.cnblogs.com/jkko123/p/6351730.html