一、安装 tracker(以下配置在10.0.0.241进行)
#注意每台服务器防火墙必须放行相关端口
yum安装需要用到的软件
yum install -y gcc gcc-c++ wget lrzsz vim unzip
cd /tmp
1、下载需要的软件
wget dachun.red/tools/fastdfs/fastdfs-5.05.tar.gz
wget dachun.red/tools/fastdfs/fastdfs-nginx-module_v1.16.tar.gz
wget dachun.red/tools/fastdfs/libfastcommon-master.zip
wget dachun.red/tools/fastdfs/nginx-1.6.0.tar.gz
wget dachun.red/tools/fastdfs/ngx_cache_purge-master.zip
wget dachun.red/tools/fastdfs/pcre-8.39.tar.gz
wget dachun.red/tools/fastdfs/zlib1211.zip
2、首先安装libfastcommon
unzip libfastcommon-master.zip
cd libfastcommon-master
./make.sh
./make.sh install
至此libfastcommon安装完成.
3、接下来安装FastDFS
cd /tmp
tar -zxvf fastdfs-5.05.tar.gz
cd fastdfs-5.05
./make.sh
./make.sh install
至此FastDFS在 tracker上安装完成,所有的可执行文件位于 /usr/bin 目录下
所有的配置文件在 /etc/fdfs/ 目录下
4、配置
进入到 /etc/fdfs 目录下,复制模版文件到 tracker.conf
cd /etc/fdfs
cp tracker.conf.sample tracker.conf
创建数据文件和日志文件目录
mkdir -pv /data/fastdfs/tracker
编辑 tracker.conf 文件
vim tracker.conf
disabled=false #启用配置文件
port=22122 #设置 tracker 的端口号
base_path=/data/fastdfs/tracker #设置 tracker 的数据文件和日志目录(需预先创建)
http.server_port=8080 #设置 http 端口号
这个http.server_port=8080 指的是在tracker服务器上启动http服务进程,如:apache或者nginx 启动时所监听的端口,这个似乎是可以不用管的,因为tracker本身就没有安装http服务
5、运行
fdfs_trackerd /etc/fdfs/tracker.conf restart
netstat -antp | grep trackerd
tcp 0 0 0.0.0.0:22122 0.0.0.0:* LISTEN 1878/fdfs_trackerd
6、设置开机自动启动
echo "/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart" >> /etc/rc.local
至此tracker上的安装与配置结束。
二、storage的安装与配置
以下操作是在10.0.0.242下操作
yum install -y gcc gcc-c++ wget lrzsz vim unzip
cd /tmp
wget dachun.red/tools/fastdfs/fastdfs-5.05.tar.gz
wget dachun.red/tools/fastdfs/fastdfs-nginx-module_v1.16.tar.gz
wget dachun.red/tools/fastdfs/libfastcommon-master.zip
wget dachun.red/tools/fastdfs/nginx-1.6.0.tar.gz
wget dachun.red/tools/fastdfs/ngx_cache_purge-master.zip
wget dachun.red/tools/fastdfs/pcre-8.39.tar.gz
wget dachun.red/tools/fastdfs/zlib1211.zip
1、根据tracker安装一样先装上fastdfs。
安装完成后,可执行文件在/usr/bin/下以 fdfs 开头
配置文件在 /etc/fdfs 目录下
2、将/tmp/fastdfs-5.05/conf 拷贝到/etc/fdfs/
cp /tmp/fastdfs-5.05/conf/* /etc/fdfs/
创建data目录
mkdir -pv /data/fastdfs/storage
修改storage.conf
vim /etc/fdfs/storage.conf
disabled=false #启用配置文件
group_name=group1 #组名,根据实际情况修改
port=23000 #设置 storage 的端口号
base_path=/data/fastdfs/storage #设置 storage 的日志目录(需预先创建)
store_path_count=1 #存储路径个数,需要和 store_path 个数匹配
store_path0=/data/fastdfs/storage #存储路径
tracker_server=10.0.0.241:22122 #tracker 服务器的 IP 地址和端口号
http.server_port=8080 #设置storage上启动的http服务的端口号,如安装的nginx的端口号
3、运行
fdfs_storaged /etc/fdfs/storage.conf restart
#注意每台服务器防火墙必须放行相关端口,如若启动不成功,请查看日志。
cat /data/fastdfs/storage/logs/storaged.log
可以使用 fdfs_monitor 来查看一下storage的状态,看是否已经成功注册到了tracker
[root@localhost data]# fdfs_monitor /etc/fdfs/storage.conf
[2017-01-17 16:52:46] DEBUG - base_path=/data/fastdfs/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
server_count=1, server_index=0
tracker server is 10.0.0.241:22122
group count: 1
Group 1:
group name = group1
disk total space = 2015862 MB
disk free space = 1913007 MB
trunk free space = 0 MB
storage server count = 1
active server count = 1
storage server port = 23000
storage HTTP port = 8888
store path count = 1
subdir count per path = 256
current write server index = 0
current trunk file id = 0
Storage 1:
id = 10.0.0.242
ip_addr = 10.0.0.242 (localhost) ACTIVE
http domain =
version = 5.05
join time = 2017-01-17 16:37:45
up time = 2017-01-17 16:37:45
total storage = 2015862 MB
free storage = 1913007 MB
upload priority = 10
store_path_count = 1
subdir_count_per_path = 256
storage_port = 23000
storage_http_port = 8888
current_write_path = 0
source storage id =
if_trunk_server = 0
connection.alloc_count = 256
connection.current_count = 0
connection.max_count = 0
total_upload_count = 0
success_upload_count = 0
total_append_count = 0
success_append_count = 0
total_modify_count = 0
success_modify_count = 0
total_truncate_count = 0
success_truncate_count = 0
total_set_meta_count = 0
success_set_meta_count = 0
total_delete_count = 0
success_delete_count = 0
total_download_count = 0
success_download_count = 0
total_get_meta_count = 0
success_get_meta_count = 0
total_create_link_count = 0
success_create_link_count = 0
total_delete_link_count = 0
success_delete_link_count = 0
total_upload_bytes = 0
success_upload_bytes = 0
total_append_bytes = 0
success_append_bytes = 0
total_modify_bytes = 0
success_modify_bytes = 0
stotal_download_bytes = 0
success_download_bytes = 0
total_sync_in_bytes = 0
success_sync_in_bytes = 0
total_sync_out_bytes = 0
success_sync_out_bytes = 0
total_file_open_count = 0
success_file_open_count = 0
total_file_read_count = 0
success_file_read_count = 0
total_file_write_count = 0
success_file_write_count = 0
last_heart_beat_time = 2017-01-17 16:52:05
last_source_update = 1970-01-01 08:00:00
last_sync_update = 1970-01-01 08:00:00
last_synced_timestamp = 1970-01-01 08:00:00
看到ACTIVE,就说明已经成功注册到了tracker
4、设置开机启动
echo "/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart" >> /etc/rc.local
5、在storage上安装配置nginx
在编译fastdf模块的时候会找这个地方/usr/local/include寻找fastdfs主程序的fastcommon和fastdfs这2个目录下的头文件,但是在编译安装的fastdfs主程序的时候,却把这2个目录放到了/usr/include下面了,于是复制这2个目录到/usr/local/include下
cp -rf /usr/include/fast* /usr/local/include/
cd /tmp
tar -zxvf nginx-1.6.0.tar.gz
tar -zxvf pcre-8.39.tar.gz
tar -zxvf fastdfs-nginx-module_v1.16.tar.gz
unzip zlib1211.zip
cd /tmp/nginx-1.6.0
./configure --prefix=/usr/local/nginx --add-module=/tmp/fastdfs-nginx-module/src --with-pcre=/tmp/pcre-8.39 --with-zlib=/tmp/zlib-1.2.11
make && make install
至此nginx安装完成
6、准备nginx启动脚本
vim /etc/init.d/nginx
#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# it is v.1.6.0 version.
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
# It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /usr/local/nginx/logs/nginx.pid
# config: /usr/local/nginx/conf/nginx.conf
nginxd=/usr/local/nginx/sbin/nginx
nginx_config=/usr/local/nginx/conf/nginx.conf
nginx_pid=/usr/local/nginx/logs/nginx.pid
nginx_lock=/var/lock/subsys/nginx
RETVAL=0
prog="nginx"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $nginxd ] || exit 0
# Start nginx daemons functions.
start() {
nginx_is_run=`ps -ef | egrep 'nginx:\s*(worker|master)\s*process' | wc -l`
if [ ${nginx_is_run} -gt 0 ];then
echo "nginx already running...."
exit 1
fi
echo -n $"Starting $prog: "
daemon $nginxd -c ${nginx_config}
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${nginx_lock}
return $RETVAL
}
# Stop nginx daemons functions.
stop() {
echo -n $"Stopping $prog: "
killproc $nginxd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${nginx_lock} ${nginx_pid}
}
# Reload nginx config file
reload() {
echo -n $"Reloading $prog: "
#kill -HUP `cat ${nginx_pid}`
killproc $nginxd -HUP
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
stop
start
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|reload|status|help}"
exit 1
esac
修改权限使其可执行
chmod 751 /etc/init.d/nginx
7、将 FastDFS 的 nginx 插件模块的配置文件copy 到 FastDFS 配置文件目录
cp /tmp/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
8、修改nginx配置文件
① 修改nginx的监听端口
将 server 段中的 listen 端口号改为 8080:
vim /usr/local/nginx/conf/nginx.conf
listen 8080;
② 在 server 段中添加fastdfs的配置
这里的group[1-3] 可以匹配 group1,group2,group3,当然group也可以是其他的名字
location ~ /group[1-3]/M00 {
root /data/fastdfs/storage/data;
ngx_fastdfs_module;
}
#/data/fastdfs/storage/data 这个是指向 真正存储文件的地方,该目录下有这些个二级目录
9、修改 fastdfs的nginx模块的配置文件 mod_fastdfs.conf
vim /etc/fdfs/mod_fastdfs.conf
一般只需改动以下几个参数即可:
base_path=/data/fastdfs/storage #保存日志目录
tracker_server=10.0.0.241:22122 #tracker 服务器的 IP 地址以及端口号
storage_server_port=23000 #storage 服务器的端口号
group_name=group1 #当前服务器的 group 名
url_have_group_name = true #文件 url 中是否有 group 名
store_path_count=1 #存储路径个数,需要和 store_path 个数匹配
store_path0=/data/fastdfs/storage #存储路径
http.need_find_content_type=true # 从文件 扩展 名查 找 文件 类型 ( nginx 时 为true)
group_count = 1 #设置组的个数
然后在末尾添加分组信息,目前只有一个分组,就只写一个
[group1]
group_name=group1
storage_server_port=23000
store_path_count=1
store_path0=/data/fastdfs/storage
10、建立 M00 至存储目录的符号连接
ln -s /data/fastdfs/storage/data /data/fastdfs/storage/data/M00
11、启动
chkconfig --add nginx
chkconfig nginx on
service nginx start
至此 storage 已经成功安装,再把另外一台服务器(10.0.0.243)也同样的步骤进行安装。
三、装nginx反向代理及缓存服务器
1、安装nginx
yum install -y gcc gcc-c++ wget lrzsz vim unzip
cd /tmp
wget dachun.red/tools/fastdfs/nginx-1.6.0.tar.gz
wget dachun.red/tools/fastdfs/ngx_cache_purge-master.zip
wget dachun.red/tools/fastdfs/pcre-8.39.tar.gz
wget dachun.red/tools/fastdfs/zlib1211.zip
tar -zxvf nginx-1.6.0.tar.gz
unzip ngx_cache_purge-master.zip
unzip zlib1211.zip
tar -zxvf pcre-8.39.tar.gz
cd /tmp/nginx-1.6.0
./configure --prefix=/usr/local/nginx --add-module=/tmp/ngx_cache_purge-master --with-pcre=/tmp/pcre-8.39/ --with-zlib=/tmp/zlib-1.2.11
make && make install
2、准备nginx启动脚本
vim /etc/init.d/nginx
#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# it is v.1.6.0 version.
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
# It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /usr/local/nginx/logs/nginx.pid
# config: /usr/local/nginx/conf/nginx.conf
nginxd=/usr/local/nginx/sbin/nginx
nginx_config=/usr/local/nginx/conf/nginx.conf
nginx_pid=/usr/local/nginx/logs/nginx.pid
nginx_lock=/var/lock/subsys/nginx
RETVAL=0
prog="nginx"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $nginxd ] || exit 0
# Start nginx daemons functions.
start() {
nginx_is_run=`ps -ef | egrep 'nginx:\s*(worker|master)\s*process' | wc -l`
if [ ${nginx_is_run} -gt 0 ];then
echo "nginx already running...."
exit 1
fi
echo -n $"Starting $prog: "
daemon $nginxd -c ${nginx_config}
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${nginx_lock}
return $RETVAL
}
# Stop nginx daemons functions.
stop() {
echo -n $"Stopping $prog: "
killproc $nginxd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${nginx_lock} ${nginx_pid}
}
# Reload nginx config file
reload() {
echo -n $"Reloading $prog: "
#kill -HUP `cat ${nginx_pid}`
killproc $nginxd -HUP
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
stop
start
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|reload|status|help}"
exit 1
esac
chmod 751 nginx
3、创建nginx的缓存目录
mkdir -pv /var/cache/nginx/proxy_cache/tmp
4、增加系统打开文件数的限制
ulimit -SHn 102400
echo "ulimit -SHn 102400" >> /etc/rc.local
5、修改nginx配置文件
rm -rf /usr/local/nginx/conf/nginx.conf
vim /usr/local/nginx/conf/nginx.conf
user nobody;
worker_processes 4;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 65535;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 300m;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 16k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
#设置缓存存储路径、存储方式、分配内存大小、磁盘最大空间、缓存期限
proxy_cache_path /var/cache/nginx/proxy_cache levels=1:2
keys_zone=http-cache:500m max_size=10g inactive=30d;
proxy_temp_path /var/cache/nginx/proxy_cache/tmp;
#设置 group1 的服务器
upstream fdfs_group1 {
server 10.0.0.242:8080 weight=1 max_fails=2 fail_timeout=30s;
server 10.0.0.243:8080 weight=1 max_fails=2 fail_timeout=30s;
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
listen 80;
server_name localhost;
access_log logs/host.access.log main;
#设置 group1 的反向代理参数
location /group1/M00 {
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_cache http-cache;
proxy_cache_valid 200 304 12h;
proxy_cache_key $uri$is_args$args;
proxy_pass
expires 30d;
}
#设置清除缓存的访问权限
location ~ /purge(/.*) {
allow 127.0.0.1;
allow 10.0.0.0/24;
deny all;
proxy_cache_purge http-cache $1$is_args$args;
}
}
}
6、启动
service nginx start
四、测试上传文件
以下操作在tracker服务器(10.0.0.241)上进行
1.创建client 使用的日志目录
mkdir -pv /data/fastdfs/client
2. 修改客户端的配置文件/etc/fdfs/client.conf
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
vim /etc/fdfs/client.conf
修改以下参数即可:
base_path=/data/fastdfs/client #日志存放路径
tracker_server=10.0.0.241:22122 #tracker 服务器 IP 地址和端口号
http.tracker_server_port=8080 #tracker 服务器的 http 端口号 ,这一项感觉没什么用处,tracker都没有启用http服务
3.上传一个图片
[root@241 tmp]# fdfs_upload_file /etc/fdfs/client.conf 2.png
group1/M00/00/00/CgAA8lh-3ZGAZzYuAAJnsjSwuWg109.png
得到了一个如上的一个地址
可以使用fdfs_file_info 来查看上传文件的信息
[root@241 tmp]# fdfs_file_info /etc/fdfs/client.conf group1/M00/00/00/CgAA8lh-3ZGAZzYuAAJnsjSwuWg109.png
source storage id: 0
source ip address: 10.0.0.242
file create timestamp: 2017-01-18 11:14:25
file size: 157618
file crc32: 883997032 (0x34B0B968)
4.使用浏览器访问一下该地址
完整的URL是这样的:
10.0.0.240 就是nginx反向代理缓存服务器
查看一下nginx的访问日志,可以看到状态码是 200OK
[root@240 init.d]# tail -f /usr/local/nginx/logs/host.access.log
172.16.1.10 - - [18/Jan/2017:11:22:39 +0800] "GET /group1/M00/00/00/CgAA8lh-3ZGAZzYuAAJnsjSwuWg109.png HTTP/1.1" 200 157618 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36" "-"
查看nginx的缓存目录,看是否已经缓存成功
[root@240 init.d]# ll -R /var/cache/nginx/proxy_cache/
/var/cache/nginx/proxy_cache/:
总用量 8
drwx------. 3 nobody nobody 4096 1月 18 11:22 7
drwxr-xr-x. 2 nobody root 4096 1月 18 11:22 tmp
/var/cache/nginx/proxy_cache/7:
总用量 4
drwx------. 2 nobody nobody 4096 1月 18 11:22 b1
/var/cache/nginx/proxy_cache/7/b1:
总用量 156
-rw-------. 1 nobody nobody 157930 1月 18 11:22 38623763332f540eefcd618322e11b17 #在此已经缓存成功
/var/cache/nginx/proxy_cache/tmp:
总用量 0
5. 清除缓存
若要清除该图片的缓存,可以在文件 URL 之前加上 purge 即可
至此 FastDFS + nginx 反向代理缓存搭建完毕。
五、优化部分
1、Tracker优化
1) max_connections=10000或更大响应参数增大内存消耗增加该参数需修改单一进程同时可打开文件数量(* soft nofile 65536 * hard nofile 65536)的限制后生效。
2) work_threads=12 cpu数量此处设置cpu核心数量
3) thread_stack_size=256
测试配置如下
work_threads=12
thread_stack_size=256
max_connections=65535
2、Storage优化
work_threads= work_threads + 1 + (disk_reader_threads + disk_writer_threads) * store_path_count= 15
disk_rw_separated:磁盘读写是否分离
disk_reader_threads:单个磁盘读线程数
disk_writer_threads:单个磁盘写线程数
如果磁盘读写混合,单个磁盘读写线程数为读线程数和写线程数之后
对于单盘挂载方式,磁盘读写线程分别设置为1即可
如果磁盘做了RAID,那么需要酌情加大读写线程数,这样才能最大程度地发挥磁盘性能
buff_size=512增大提升磁盘IO的另外一个技巧,一次尽可能多写入或多读取。也就是说,将程序的读写buffer设置得尽可能大一些。例如日志或者redo log的写入,不是每次调用都直接写磁盘,而是先缓存到内存中,等buffer满了再写入磁盘,也可以定时写入磁盘。
测试配置如下
thread_stack_size=512KB
disk_reader_threads = 4
disk_writer_threads = 4
buff_size=512
max_connections=65535
accept_threads=10
work_threads=16a
以上配置压力测试上传并发2w 事务平均响应时间0.46秒,4w事务平均响应时间2.2秒。
六、FastDFS使用流程
1.上传文件
FastDFS 提供了多种方式上传文件:
使用 fdfs_upload_file 上传
使用 C 语言客户端接口上传
使用 PHP 客户端接口上传
使用 Java 客户端接口上传
使用 Python 客户端接口上传
使用.NET 客户端接口上传
根据具体情况选择使用。上传均支持断点续传。
如果Java的客户端,在API的配置文件中配置 tracker服务器,如果有多个tracker服务器,就配置多台
WEB-INF/classes/fdfs_client.conf
connect_timeout = 2
network_timeout = 30
charset = UTF-8
http.tracker_http_port = 8080
http.anti_steal_token = no
http.secret_key = FastDFS1234567890
tracker_server =192.168.10.27:22122
tracker_server = 192.168.10.28:22122
2.下载文件
使用 fdfs_download_file 通过 tracker 服务器下载
使用 nginx 通过 http 方式直接从 storage 下载(支持断点续传,作者推荐)
3.监视服务器资源
使用 fdfs_monitor 查看 tracker 和所有 group 的运行情况
[root@241 tmp]# fdfs_monitor /etc/fdfs/client.conf
[2017-01-18 11:37:16] DEBUG - base_path=/data/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
server_count=1, server_index=0
tracker server is 10.0.0.241:22122
group count: 1
Group 1:
group name = group1
disk total space = 2015862 MB
disk free space = 1913007 MB
trunk free space = 0 MB
storage server count = 2
active server count = 2
storage server port = 23000
storage HTTP port = 8888
store path count = 1
subdir count per path = 256
current write server index = 1
current trunk file id = 0
Storage 1:
id = 10.0.0.242
ip_addr = 10.0.0.242 (localhost) ACTIVE
http domain =
version = 5.05
join time = 2017-01-17 17:46:41
up time = 2017-01-18 09:02:36
total storage = 2015862 MB
free storage = 1913007 MB
upload priority = 10
store_path_count = 1
subdir_count_per_path = 256
storage_port = 23000
storage_http_port = 8080
current_write_path = 0
source storage id = 10.0.0.243
if_trunk_server = 0
connection.alloc_count = 256
connection.current_count = 1
connection.max_count = 2
total_upload_count = 1
success_upload_count = 1
total_append_count = 0
success_append_count = 0
total_modify_count = 0
success_modify_count = 0
total_truncate_count = 0
success_truncate_count = 0
total_set_meta_count = 0
success_set_meta_count = 0
total_delete_count = 0
success_delete_count = 0
total_download_count = 0
success_download_count = 0
total_get_meta_count = 0
success_get_meta_count = 0
total_create_link_count = 0
success_create_link_count = 0
total_delete_link_count = 0
success_delete_link_count = 0
total_upload_bytes = 157618
success_upload_bytes = 157618
total_append_bytes = 0
success_append_bytes = 0
total_modify_bytes = 0
success_modify_bytes = 0
stotal_download_bytes = 0
success_download_bytes = 0
total_sync_in_bytes = 0
success_sync_in_bytes = 0
total_sync_out_bytes = 0
success_sync_out_bytes = 0
total_file_open_count = 1
success_file_open_count = 1
total_file_read_count = 0
success_file_read_count = 0
total_file_write_count = 1
success_file_write_count = 1
last_heart_beat_time = 2017-01-18 11:37:06
last_source_update = 2017-01-18 11:14:25
last_sync_update = 1970-01-01 08:00:00
last_synced_timestamp = 1970-01-01 08:00:00
Storage 2:
id = 10.0.0.243
ip_addr = 10.0.0.243 (localhost) ACTIVE
http domain =
version = 5.05
join time = 2017-01-17 16:37:45
up time =
total storage = 2015862 MB
free storage = 1913007 MB
upload priority = 10
store_path_count = 1
subdir_count_per_path = 256
storage_port = 23000
storage_http_port = 8888
current_write_path = 0
source storage id =
if_trunk_server = 0
connection.alloc_count = 256
connection.current_count = 1
connection.max_count = 1
total_upload_count = 0
success_upload_count = 0
total_append_count = 0
success_append_count = 0
total_modify_count = 0
success_modify_count = 0
total_truncate_count = 0
success_truncate_count = 0
total_set_meta_count = 0
success_set_meta_count = 0
total_delete_count = 0
success_delete_count = 0
total_download_count = 0
success_download_count = 0
total_get_meta_count = 0
success_get_meta_count = 0
total_create_link_count = 0
success_create_link_count = 0
total_delete_link_count = 0
success_delete_link_count = 0
total_upload_bytes = 0
success_upload_bytes = 0
total_append_bytes = 0
success_append_bytes = 0
total_modify_bytes = 0
success_modify_bytes = 0
stotal_download_bytes = 0
success_download_bytes = 0
total_sync_in_bytes = 157618
success_sync_in_bytes = 157618
total_sync_out_bytes = 0
success_sync_out_bytes = 0
total_file_open_count = 1
success_file_open_count = 1
total_file_read_count = 0
success_file_read_count = 0
total_file_write_count = 1
success_file_write_count = 1
last_heart_beat_time = 2017-01-18 11:37:03
last_source_update = 1970-01-01 08:00:00
last_sync_update = 2017-01-18 11:14:46
last_synced_timestamp = 2017-01-18 11:14:25 (0s delay)
4.其他功能
使用 fdfs_crc32 获取文件 CRC
使用 fdfs_delete_file 删除文件
使用 fdfs_file_info 查看文件属性信息
阅读(1472) | 评论(0) | 转发(0) |