Fastdfs手动上传和下载命令使用

项目中目前使用的FastDFS做文件存储,但是最近项目并发量有点高,经常出现文件下载和上传时间较长的情况,这是需要排查是因为网络延迟、请求阻塞或者FastDFS的问题。

如何排查是否是FastDFS问题而不是网络延迟导致的,我们最好可以在部署FastDFS的服务器上手动执行上传和下载,因为FastDFS目前没有在维护导致这方面的资料比较少,所以记录下来方便有需要的朋友使用。

上传

fdfs_test /etc/fdfs/client.conf.sample upload ~/2.png

执行结果:

This is FastDFS client test program v5.09

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-07-03 11:37:02] DEBUG - base_path=/data/fdfs/fastdfs_tracker, 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=10.0.20.13, port=23000
	server 2. group_name=, ip_addr=10.0.20.14, port=23000
	server 3. group_name=, ip_addr=10.0.20.15, port=23000

group_name=group1, ip_addr=10.0.20.15, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/02/32/CgAUD1s6716ATKtBAAMd3jd5Lxc105.png
source ip address: 10.0.20.15
file timestamp=2018-07-03 11:37:02
file size=204254
file crc32=930688791
example file url: http://10.0.20.15/group1/M00/02/32/CgAUD1s6716ATKtBAAMd3jd5Lxc105.png
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/02/32/CgAUD1s6716ATKtBAAMd3jd5Lxc105_big.png
source ip address: 10.0.20.15
file timestamp=2018-07-03 11:37:02
file size=204254
file crc32=930688791
example file url: http://10.0.20.15/group1/M00/02/32/CgAUD1s6716ATKtBAAMd3jd5Lxc105_big.png

其中有两个需要注意的group_name和remote_filename,这个在我们后面的文件下载需要用到

group_name=group1, remote_filename=M00/02/32/CgAUD1s6716ATKtBAAMd3jd5Lxc105.png

下载

fdfs_test /etc/fdfs/client.conf.sample download group1 M00/02/32/CgAUD1s6716ATKtBAAMd3jd5Lxc105.png

downlad后面的两个参数就是上面上传返回的group_name和remote_filename

结果:

This is FastDFS client test program v5.09

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-07-03 11:44:01] DEBUG - base_path=/data/fdfs/fastdfs_tracker, 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

storage=10.0.20.13:23000
download file success, file size=204254, file save to CgAUD1s6716ATKtBAAMd3jd5Lxc105.png

root@VM010000020015 fdfs]# ls
CgAUD1s6716ATKtBAAMd3jd5Lxc105.png  client.conf.sample  storage.conf  storage_ids.conf.sample  tracker.conf

转载于:https://my.oschina.net/kipeng/blog/1839425

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值