|
FastDFS介绍[编辑]
fastdfs是一个开源的,高性能的的分布式文件系统,他主要的功能包括:文件存储,同步和访问,设计基于高可用和负载均衡,fastfd非常适用于基于文件服务的站点,例如图片分享和视频分享网站。
fastfds有两个角色:跟踪服务(tracker)和存储服务(storage),跟踪服务控制,调度文件以负载均衡的方式访问;存储服务包括:文件存储,文件同步,提供文件访问接口,同时以key value的方式管理文件的元数据。
跟踪和存储服务可以由1台或者多台服务器组成,同时可以动态的添加,删除跟踪和存储服务而不会对在线的服务产生影响,在集群中,tracker服务是对等的。 存储系统由一个或多个卷(group)组成,卷与卷之间的文件是相互独立的,所有卷的文件容量累加就是整个存储系统中的文件容量。一个卷可以由一台或多台存储服务器组成,一个卷下的存储服务器中的文件都是相同的,卷中的多台存储服务器起到了冗余备份和负载均衡的作用。在卷中增加服务器时,同步已有的文件由系统自动完成,同步完成后,系统自动将新增服务器切换到线上提供服务。当存储空间不足或即将耗尽时,可以动态添加卷。只需要增加一台或多台服务器,并将它们配置为一个新的卷,这样就扩大了存储系统的容量。

FastDFS文件上传及下载过程[编辑]
文件上传过程[编辑]

1. Client询问Tracker server上传到的Storage server;
2. Tracker server返回一台可用的Storage server,返回的数据为该Storage server的IP地址和端口;
3. Client直接和该Storage server建立连接,进行文件上传,Storage server返回新生成的文件ID,文件上传结束。
文件下载过程[编辑]

1. Client询问Tracker server可以下载指定文件的Storage server,参数为文件ID(包含组名和文件名);
2. Tracker server返回一台可用的Storage server;
3. Client直接和该Storage server建立连接,完成文件下载。
基础环境[编辑]
VMware虚拟机 中 CentOS 6.5 32位 最小化安装
# yum install gcc-c gcc-c++ perl下载FastDFS[编辑]
FastDFS5.03下载地址:http://jaist.dl.sourceforge.net/project/fastdfs/FastDFS Server Source Code/FastDFS Server with PHP Extension Source Code V5.03
安装FastDFS[编辑]
# tar zxvf FastDFS_v5.03.tar.gz
# mv FastDFS /usr/local/
# cd /usr/local/FastDFS/
# vi make.sh
修改如下:
TARGET_PREFIX=/usr/local/FastDFS
TARGET_CONF_PATH=/etc/fdfs
WITH_LINUX_SERVICE=1
# ./make.sh
# ./make.sh install本台服务器作为TrackerA来配置
配置TrackerA[编辑]
本机IP:192.168.3.75
# cd /etc/fdfs/
# ls
client.conf http.conf mime.types storage.conf tracker.conf
# vi tracker.conf
bind_addr=192.168.3.75
base_path=/home/data/fastdfs
# mkdir -p /home/data/fastdfs
启动Tracker进程:
# /usr/local/FastDFS/tracker/fdfs_trackerd /etc/fdfs/tracker.conf
查看Tracker进程:
# netstat -ntpl|grep fdfs
tcp 0 0 192.168.3.75:22122 0.0.0.0:* LISTEN 1668/fdfs_trackerd开启防火墙端口:[编辑]
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22122 -j ACCEPT
# service iptables restart配置TrackerA上的nginx + ngx_fastdfs_module[编辑]
# tar zxvf fastdfs-nginx-module_v1.16.tar.gz
# mv fastdfs-nginx-module /usr/local/
# cp /usr/local/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
配置mod_fastdfs.conf:
# vi /etc/fdfs/mod_fastdfs.conf
tracker_server=192.168.3.75:22122
tracker_server=192.168.3.74:22122
url_have_group_name = true
group_count = 2
[group1]
group_name=group1
storage_server_port=23000
store_path_count=1
store_path0=/home/data/fastdfs
[group2]
group_name=group2
storage_server_port=23000
store_path_count=1
store_path0=/home/data/fastdfs
安装nginx:
# vi /usr/local/fastdfs-nginx-module/src/config
ngx_addon_name=ngx_http_fastdfs_module
HTTP_MODULES="$HTTP_MODULES ngx_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='\"/etc/fdfs/mod_fastdfs.conf\"'"
# yum install pcre-devel zlib-devel
# tar zxvf nginx-1.6.1.tar.gz
# ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx --add-module=/usr/local/fastdfs-nginx-module/src/
# make
# make install
修改nginx配置:
# vi /usr/local/nginx/conf/nginx.conf
listen 8080;
location ~ /group([0-9])/M00 {
ngx_fastdfs_module;
}
# ln -s /usr/local/FastDFS/lib/libfdfsclient.so /usr/lib/libfdfsclient.so
# ln -s /usr/local/FastDFS/lib/libfastcommon.so /usr/lib/libfastcommon.so
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
# service iptables restart至此完成了FastDSF TrackerA服务器的配置 将虚拟机再复制三份 分别为TrackerB(192.168.3.74)、StorageA(192.168.3.77)、StorageB(192.168.3.76)
配置TrackerB[编辑]
# cd /etc/fdfs/
# ls
client.conf http.conf mime.types storage.conf tracker.conf
# vi tracker.conf
bind_addr=192.168.3.74
# /usr/local/FastDFS/tracker/fdfs_trackerd /etc/fdfs/tracker.conf
# netstat -ntpl|grep fdfs
tcp 0 0 192.168.3.74:22122 0.0.0.0:* LISTEN 1440/fdfs_trackerd配置StorageA[编辑]
# cd /etc/fdfs/
# ls
client.conf http.conf mime.types storage.conf tracker.conf
# vi storage.conf
group_name=group1
bind_addr=192.168.3.77
base_path=/home/data/fastdfs
store_path0=/home/data/fastdfs
tracker_server=192.168.3.75:22122
tracker_server=192.168.3.74:22122
# /usr/local/FastDFS/storage/fdfs_storaged /etc/fdfs/storage.conf
# netstat -ntpl|grep fdfs
tcp 0 0 192.168.3.77:23000 0.0.0.0:* LISTEN 1595/fdfs_storaged开启防火墙[编辑]
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 23000 -j ACCEPT
# service iptables restart配置StorageB[编辑]
# cd /etc/fdfs/
# ls
client.conf http.conf mime.types storage.conf tracker.conf
# vi storage.conf
group_name=group2
bind_addr=192.168.3.76
base_path=/home/data/fastdfs
store_path0=/home/data/fastdfs
tracker_server=192.168.3.75:22122
tracker_server=192.168.3.74:22122
# /usr/local/FastDFS/storage/fdfs_storaged /etc/fdfs/storage.conf
# netstat -ntpl|grep fdfs
tcp 0 0 192.168.3.76:23000 0.0.0.0:* LISTEN 1558/fdfs_storaged开启防火墙[编辑]
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 23000 -j ACCEPT
# service iptables restart到此4台服务器配置完成
测试文件上传及下载[编辑]
四台服务器启动nginx进程:
以在TrackerA服务器上传为例。 修改client.conf配置
# vi /etc/fdfs/client.conf
base_path=/home/data/fastdfs
tracker_server=192.168.3.75:22122
http.tracker_server_port=8080TrackerA上第一次上传:
# /usr/local/FastDFS/client/fdfs_test /etc/fdfs/client.conf upload /home/abel/upload/nginx-1.6.1.tar.gz
This is FastDFS client test program v5.03
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.
[2014-09-05 19:32:44] DEBUG - base_path=/home/data/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.3.76, port=23000
group_name=group2, ip_addr=192.168.3.76, port=23000
storage_upload_by_filename
group_name=group2, remote_filename=M00/00/00/wKgDTFQJn1uACkjfAAxB5Q0Pr6s.tar.gz
source ip address: 192.168.3.76
file timestamp=2014-09-05 19:32:43
file size=803301
file crc32=219131819
example file url: http://192.168.3.76:8080/group2/M00/00/00/wKgDTFQJn1uACkjfAAxB5Q0Pr6s.tar.gz
storage_upload_slave_by_filename
group_name=group2, remote_filename=M00/00/00/wKgDTFQJn1uACkjfAAxB5Q0Pr6s_big.tar.gz
source ip address: 192.168.3.76
file timestamp=2014-09-05 19:32:44
file size=803301
file crc32=219131819
example file url: http://192.168.3.76:8080/group2/M00/00/00/wKgDTFQJn1uACkjfAAxB5Q0Pr6s_big.tar.gz
在浏览器中打开以下网址均可下载刚上传的文件:
http://192.168.3.74:8080/group2/M00/00/00/wKgDTFQJn1uACkjfAAxB5Q0Pr6s_big.tar.gz
http://192.168.3.75:8080/group2/M00/00/00/wKgDTFQJn1uACkjfAAxB5Q0Pr6s_big.tar.gz
http://192.168.3.76:8080/group2/M00/00/00/wKgDTFQJn1uACkjfAAxB5Q0Pr6s_big.tar.gz
http://192.168.3.77:8080/group2/M00/00/00/wKgDTFQJn1uACkjfAAxB5Q0Pr6s_big.tar.gz过一会儿TrackerA上第二次:
# /usr/local/FastDFS/client/fdfs_test /etc/fdfs/client.conf upload /home/abel/upload/nginx-1.6.1.tar.gz
This is FastDFS client test program v5.03
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.
[2014-09-05 19:36:15] DEBUG - base_path=/home/data/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.3.77, port=23000
group_name=group1, ip_addr=192.168.3.77, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKgDTVQJoC6AcaHrAAxB5Q0Pr6s.tar.gz
source ip address: 192.168.3.77
file timestamp=2014-09-05 19:36:14
file size=803301
file crc32=219131819
example file url: http://192.168.3.77:8080/group1/M00/00/00/wKgDTVQJoC6AcaHrAAxB5Q0Pr6s.tar.gz
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKgDTVQJoC6AcaHrAAxB5Q0Pr6s_big.tar.gz
source ip address: 192.168.3.77
file timestamp=2014-09-05 19:36:14
file size=803301
file crc32=219131819
example file url: http://192.168.3.77:8080/group1/M00/00/00/wKgDTVQJoC6AcaHrAAxB5Q0Pr6s_big.tar.gz
在浏览器中打开以下网址均可下载刚上传的文件:
http://192.168.3.74:8080/group1/M00/00/00/wKgDTVQJoC6AcaHrAAxB5Q0Pr6s_big.tar.gz
http://192.168.3.75:8080/group1/M00/00/00/wKgDTVQJoC6AcaHrAAxB5Q0Pr6s_big.tar.gz
http://192.168.3.76:8080/group1/M00/00/00/wKgDTVQJoC6AcaHrAAxB5Q0Pr6s_big.tar.gz
http://192.168.3.77:8080/group1/M00/00/00/wKgDTVQJoC6AcaHrAAxB5Q0Pr6s_big.tar.gzFastDFS配置[编辑]
tracker.conf配置详解[编辑]
# is this config file disabled
# false for enabled
# true for disabled
disabled=false
# 这个配置文件是否不生效,呵呵(改成是否生效是不是会让人感觉好点呢?) false 为生效(否则不生效) true反之
# bind an address of this host
# empty for bind all addresses of this host
bind_addr=
# 是否绑定IP,
# bind_addr= 后面为绑定的IP地址 (常用于服务器有多个IP但只希望一个IP提供服务)。如果不填则表示所有的(一般不填就OK),相信较熟练的SA都常用到类似功能,很多系统和应用都有
# the tracker server port
port=22122
# 提供服务的端口,不作过多解释了
# connect timeout in seconds
# default value is 30s
connect_timeout=30
#连接超时时间,针对socket套接字函数connect
# network timeout in seconds
# default value is 30s
network_timeout=60
# tracker server的网络超时,单位为秒。发送或接收数据时,如果在超时时间后还不能发送或接收数据,则本次网络通信失败。
# the base path to store data and log files
base_path=/home/data/fastdfs
# base_path 目录地址(根目录必须存在,子目录会自动创建)
# 附目录说明:
tracker server目录及文件结构:
${base_path}
|__data
| |__storage_groups.dat:存储分组信息
| |__storage_servers.dat:存储服务器列表
|__logs
|__trackerd.log:tracker server日志文件
数据文件storage_groups.dat和storage_servers.dat中的记录之间以换行符(\n)分隔,字段之间以西文逗号(,)分隔。
storage_groups.dat中的字段依次为:
1. group_name:组名
2. storage_port:storage server端口号
storage_servers.dat中记录storage server相关信息,字段依次为:
1. group_name:所属组名
2. ip_addr:ip地址
3. status:状态
4. sync_src_ip_addr:向该storage server同步已有数据文件的源服务器
5. sync_until_timestamp:同步已有数据文件的截至时间(UNIX时间戳)
6. stat.total_upload_count:上传文件次数
7. stat.success_upload_count:成功上传文件次数
8. stat.total_set_meta_count:更改meta data次数
9. stat.success_set_meta_count:成功更改meta data次数
10. stat.total_delete_count:删除文件次数
11. stat.success_delete_count:成功删除文件次数
12. stat.total_download_count:下载文件次数
13. stat.success_download_count:成功下载文件次数
14. stat.total_get_meta_count:获取meta data次数
15. stat.success_get_meta_count:成功获取meta data次数
16. stat.last_source_update:最近一次源头更新时间(更新操作来自客户端)
17. stat.last_sync_update:最近一次同步更新时间(更新操作来自其他storage server的同步)
# max concurrent connections this server supported
max_connections=256
# 系统提供服务时的最大连接数。对于V1.x,因一个连接由一个线程服务,也就是工作线程数。
# 对于V2.x,最大连接数和工作线程数没有任何关系
# accept thread count
# default value is 1
# since V4.07
accept_threads=1
# work thread count, should = this bytes
# default value is 0 (never call fsync)
fsync_after_written_bytes=0
# 当写入大文件时,每写入N个字节,调用一次系统函数fsync将内容强行同步到硬盘。0表示从不调用fsync
# sync log buff to disk every interval seconds
# must > 0, default value is 10 seconds
sync_log_buff_interval=10
# 同步或刷新日志信息到硬盘的时间间隔,单位为秒
# 注意:storage server 的日志信息不是时时写硬盘的,而是先写内存。
# sync binlog buff / cache to disk every interval seconds
# default value is 60 seconds
sync_binlog_buff_interval=10
# 同步binglog(更新操作日志)到硬盘的时间间隔,单位为秒
# 本参数会影响新上传文件同步延迟时间
# sync storage stat info to disk every interval seconds
# default value is 300 seconds
sync_stat_file_interval=300
# 把storage的stat文件同步到磁盘的时间间隔,单位为秒。
# 注:如果stat文件内容没有变化,不会进行同步
# thread stack size, should >= 512KB
# default value is 512KB
thread_stack_size=512KB
# 线程栈的大小。FastDFS server端采用了线程方式。
# 对于V1.x,storage server线程栈不应小于512KB;对于V2.0,线程栈大于等于128KB即可。
# 线程栈越大,一个线程占用的系统资源就越多。
# 对于V1.x,如果要启动更多的线程(max_connections),可以适当降低本参数值。
# the priority as a source server for uploading file.
# the lower this value, the higher its uploading priority.
# default value is 10
upload_priority=10
# 本storage server作为源服务器,上传文件的优先级,可以为负数。值越小,优先级越高。这里就和 tracker.conf 中store_server= 2时的配置相对应了
# the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a
# multi aliases split by comma. empty value means auto set by OS type
# default values is empty
if_alias_prefix=
# if check file duplicate, when set to true, use FastDHT to store file indexes
# 1 or yes: need check
# 0 or no: do not check
# default value is 0
check_file_duplicate=0
# 是否检测上传文件已经存在。如果已经存在,则不存在文件内容,建立一个符号链接以节省磁盘空间。
# 这个应用要配合FastDHT 使用,所以打开前要先安装FastDHT
# 1或yes 是检测,0或no 是不检测
# file signature method for check file duplicate
## hash: four 32 bits hash code
## md5: MD5 signature
# default value is hash
# since V4.01
file_signature_method=hash
# 文件去重时,文件内容的签名方式:
## hash: 4个hash code
## md5:MD5
# namespace for storing file indexes (key-value pairs)
# this item must be set when check_file_duplicate is true / on
key_namespace=FastDFS
# 当上个参数设定为1 或 yes时 (true/on也是可以的) , 在FastDHT中的命名空间。
# set keep_alive to 1 to enable persistent connection with FastDHT servers
# default value is 0 (short connection)
keep_alive=0
# 与FastDHT servers 的连接方式 (是否为持久连接) ,默认是0(短连接方式)。可以考虑使用长连接,这要看FastDHT server的连接数是否够用。
# 下面是关于FastDHT servers 的设定 需要对FastDHT servers 有所了解,这里只说字面意思了
# you can use "#include filename" (not include double quotes) directive to
# load FastDHT server list, when the filename is a relative path such as
# pure filename, the base path is the base path of current/this config file.
# must set FastDHT server list when check_file_duplicate is true / on
# please see INSTALL of FastDHT for detail
##include /home/yuqing/fastdht/conf/fdht_servers.conf
# 可以通过 #include filename 方式来加载 FastDHT servers 的配置,装上FastDHT就知道该如何配置啦。
# 同样要求 check_file_duplicate=1 时才有用,不然系统会忽略
# fdht_servers.conf 记载的是 FastDHT servers 列表
# if log to access log
# default value is false
# since V4.00
use_access_log = false
# 是否将文件操作记录到access log
# if rotate the access log every day
# default value is false
# since V4.00
rotate_access_log = false
# 是否定期轮转access log,目前仅支持一天轮转一次
# rotate access log time base, time format: Hour:Minute
# Hour from 0 to 23, Minute from 0 to 59
# default value is 00:00
# since V4.00
access_log_rotate_time=00:00
# access log定期轮转的时间点,只有当rotate_access_log设置为true时有效
# if rotate the error log every day
# default value is false
# since V4.02
rotate_error_log = false
# 是否定期轮转error log,目前仅支持一天轮转一次
# rotate error log time base, time format: Hour:Minute
# Hour from 0 to 23, Minute from 0 to 59
# default value is 00:00
# since V4.02
error_log_rotate_time=00:00
# error log定期轮转的时间点,只有当rotate_error_log设置为true时有效
# rotate access log when the log file exceeds this size
# 0 means never rotates log file by log file size
# default value is 0
# since V4.02
rotate_access_log_size = 0
# access log按文件大小轮转
# 设置为0表示不按文件大小轮转,否则当access log达到该大小,就会轮转到新文件中
# rotate error log when the log file exceeds this size
# 0 means never rotates log file by log file size
# default value is 0
# since V4.02
rotate_error_log_size = 0
# error log按文件大小轮转
# 设置为0表示不按文件大小轮转,否则当error log达到该大小,就会轮转到新文件中
# if skip the invalid record when sync file
# default value is false
# since V4.02
file_sync_skip_invalid_record=false
# 文件同步的时候,是否忽略无效的binlog记录
# if use connection pool
# default value is false
# since V4.05
use_connection_pool = false
#是否使用连接池
# connections whose the idle time exceeds this time will be closed
# unit: second
# default value is 3600
# since V4.05
connection_pool_max_idle_time = 3600
#连接池链接的最大生存时间,单位秒,use_connection_pool设置为true时有效
# use the ip address of this storage server if domain_name is empty,
# else this domain name will ocur in the url redirected by the tracker server
http.domain_name=
# the port of the web server on this storage server
http.server_port=8888服务启动配置[编辑]
tracker 系统启动配置[编辑]
vim /etc/init.d/fdfs_trackerd替换:
/usr/local/bin/ 为: /usr/local/FastDFS/bin/启动服务:
/etc/init.d/fdfs_trackerd start 或 service fdfs_storaged start加入到系统自启用服务:
chkconfig fdfs_trackerd onstoraged 系统启动配置[编辑]
vim /etc/init.d/fdfs_storaged替换:
/usr/local/bin/ 为: /usr/local/FastDFS/bin/启动服务:
/etc/init.d/fdfs_storaged start 或 service fdfs_storaged start加入到系统自启用服务:
chkconfig fdfs_storaged onPHP安装FastDFS扩展,测试上传文件[编辑]
PHP所在服务器需先安装FastDFS。FastDFS安装方法如上,无需启动服务。
安装FastDFS扩展[编辑]
# cd /usr/local/FastDFS/php_client/
# ls /opt/lampp/bin/phpize
/opt/lampp/bin/phpize
# /opt/lampp/bin/phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
# ./configure --with-php-config=/opt/lampp/bin/php-config
# vi Makefile
FASTDFS_CLIENT_SHARED_LIBADD = -Wl,-rpath,/usr/local/FastDFS/lib -L/usr/local/FastDFS/lib -lfdfsclient -Wl,-rpath,/usr/local/FastDFS/lib -L/usr/local/FastDFS/lib -lfastcommon
INCLUDES = -I/opt/lampp/include/php -I/opt/lampp/include/php/main -I/opt/lampp/include/php/TSRM -I/opt/lampp/include/php/Zend -I/opt/lampp/include/php/ext -I/opt/lampp/include/php/ext/date/lib -I/usr/local/FastDFS/include/fastcommon -I/usr/local/FastDFS/include/fastdfs
#make
#make install
Installing shared extensions: /opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/PHP配置FastDFS扩展[编辑]
PHP配置文件尾部追加FastDFS配置:
# vi /opt/lampp/etc/php.ini
[FastDFS]
extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/fastdfs_client.so
; the base path
fastdfs_client.base_path = /tmp
; connect timeout in seconds
; default value is 30s
fastdfs_client.connect_timeout = 2
; network timeout in seconds
; default value is 30s
fastdfs_client.network_timeout = 60
; standard log level as syslog, case insensitive, value list:
;;; emerg for emergency
;;; alert
;;; crit for critical
;;; error
;;; warn for warning
;;; notice
;;; info
;;; debug
fastdfs_client.log_level = info
; set the log filename, such as /usr/local/fastdfs/logs/fastdfs_client.log
; empty for output to stderr
fastdfs_client.log_filename =
; secret key to generate anti-steal token
; this parameter must be set when http.anti_steal.check_token set to true
; the length of the secret key should not exceed 128 bytes
fastdfs_client.http.anti_steal_secret_key =
; FastDFS cluster count, default value is 1
fastdfs_client.tracker_group_count = 1
; config file of FastDFS cluster ;, based 0
; must include absolute path, such as fastdfs_client.tracker_group0
; the config file is same as conf/client.conf
fastdfs_client.tracker_group0 = /etc/fdfs/client.conf
; if use connection pool
; default value is false
; since V4.05
fastdfs_client.use_connection_pool = false
; connections whose the idle time exceeds this time will be closed
; unit: second
; default value is 3600
; since V4.05
fastdfs_client.connection_pool_max_idle_time = 3600
# vi /etc/fdfs/client.conf
base_path=/home/data/fastdfs
tracker_server=192.168.3.75:22122
tracker_server=192.168.3.74:22122PHP文件上传测试[编辑]
# ls /usr/local/FastDFS/php_client/
acinclude.m4 config.h.in configure fastdfs_client.h fastdfs_test_slave.php Makefile.fragments README
aclocal.m4 config.log configure.in fastdfs_client.ini include Makefile.global run-tests.php
autom4te.cache config.m4 fastdfs_appender_test1.php fastdfs_client.la install-sh Makefile.objects
build config.nice fastdfs_appender_test.php fastdfs_client.lo libtool missing
config.guess config.status fastdfs_callback_test.php fastdfs_test1.php ltmain.sh mkinstalldirs
config.h config.sub fastdfs_client.c fastdfs_test.php Makefile modules里面的fastdfs_test.php、fastdfs_test1.php等文件可以用来测试!
|
|