fastdfs测试上传
1.修改配置文件
进入到/etc/fdfs
下载[root@localhost fdfs]# sz client.conf.sample
base_path=/home/yuqing/fastdfs
修改为:base_path=/opt/fastdfs/client
tracker_server=192.168.179.129:22122
2.启动进程,并查看
[root@localhost fdfs]# ps -ef | grep fdfs
root 60471 1 2 20:09 ? 00:00:18 fdfs_storaged /etc/fdfs/storage.conf
root 60592 1 0 20:17 ? 00:00:03 fdfs_trackerd /etc/fdfs/tracker.conf
root 60705 11078 0 20:23 pts/1 00:00:00 grep --color=auto fdfs
[root@localhost fdfs]#
3.创建测试文件
[root@localhost ~]# vim aa.txt
4.新建文件夹
[root@localhost fastdfs]# mkdir /opt/fastdfs/client
4.测试
Usage: fdfs_test <config_file>
operation: upload, download, getmeta, setmeta, delete and query_servers
5.上传(必须在你创建的文件的文件夹里面upload)
[root@localhost ~]# fdfs_test /etc/fdfs/client.conf upload
[root@localhost fastdfs]# fdfs_test /etc/fdfs/client.conf upload aa.txt
6.提示成功
This is FastDFS client test program v5.11
Copyright © 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.
[2020-12-05 20:30:53] DEBUG - base_path=/opt/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=192.168.179.129, port=23000
group_name=group1, ip_addr=192.168.179.129, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKizgV_LfX2AetouAAAAG3ysYXc466.txt
source ip address: 192.168.179.129
file timestamp=2020-12-05 20:30:53
file size=27
file crc32=2091671927
example file url: http://192.168.179.129/group1/M00/00/00/wKizgV_LfX2AetouAAAAG3ysYXc466.txt
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKizgV_LfX2AetouAAAAG3ysYXc466_big.txt
source ip address: 192.168.179.129
file timestamp=2020-12-05 20:30:53
file size=27
file crc32=2091671927
example file url: http://192.168.179.129/group1/M00/00/00/wKizgV_LfX2AetouAAAAG3ysYXc466_big.txt
6.查看上传的位置 和文件(opt/fastdfs/storage/files/data/00/00)
[root@localhost 00]# ll
total 16
-rw-r–r--. 1 root root 27 Dec 5 20:30 wKizgV_LfX2AetouAAAAG3ysYXc466_big.txt
-rw-r–r--. 1 root root 49 Dec 5 20:30 wKizgV_LfX2AetouAAAAG3ysYXc466_big.txt-m
-rw-r–r--. 1 root root 27 Dec 5 20:30 wKizgV_LfX2AetouAAAAG3ysYXc466.txt
-rw-r–r--. 1 root root 49 Dec 5 20:30 wKizgV_LfX2AetouAAAAG3ysYXc466.txt-m
M00------>opt/fastdfs/storage/files/data