cd /etc/fdfs cp tracker.conf.sample tracker.conf vim tracker.conf
对照着如下配置进行修改,
1 2 3 4
# the base path to store data andlog files base_path=/home/data/fastdfs # HTTP port on this tracker server http.server_port=80
注: tracker server的默认监听端口22122, 如不冲突, 不建议修改
配置Storage Server
1 2 3
cd /etc/fdfs cp storage.conf.sample storage.conf vim storage.conf
对照如下配置进行修改,
1 2 3 4 5 6 7 8
# the base path to store dataand log files base_path=/home/data/fastdfs # store_path#, based 0, if store_path0 not exists, it's value is base_path # the paths must be exist store_path0=/home/data/fastdfs # tracker_server can ocur more than once, and tracker_server format is # "host:port", host can be hostname or ipaddress tracker_server=192.168.10.201:22122
注: storage server的默认监听端口23000, 如不冲突, 不建议修改
配置Client
1 2 3
cd /etc/fdfs cp client.conf.sample client.conf vim client.conf
对照如下配置进行修改,
1 2 3 4 5
# the base path to store log files base_path=/home/data/fastdfs # tracker_server can ocur more than once, and tracker_server format is # "host:port", host can be hostname or ip address tracker_server=192.168.10.201:22122
Group 1: group name = group1 disk total space = 17709 MB disk free space = 13932 MB trunk free space = 0 MB storage server count = 3 active server count = 3 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 = 192.168.10.201 ip_addr = 192.168.10.201 ACTIVE http domain = version = 5.12 . . . last_sync_update = 2017-10-1918:43:43 last_synced_timestamp = 2017-10-1721:12:03 (1 days 19h:38m:10s delay) Storage 2: id = 192.168.10.202 ip_addr = 192.168.10.202 ACTIVE http domain = version = 5.12 . . . last_sync_update = 2017-10-1918:44:06 last_synced_timestamp = 2017-10-1721:12:03 (1 days 19h:38m:10s delay) Storage 3: id = 192.168.10.203 ip_addr = 192.168.10.203 ACTIVE http domain = version = 5.12 . . . last_sync_update = 2017-10-1918:43:43 last_synced_timestamp = 1970-01-0108:00:00 (never synced)
[root@Node temp]# /usr/bin/fdfs_test /etc/fdfs/client.conf upload ~/temp/ops.txt This is FastDFS client test program v5.12
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.
[2017-10-1720:53:45] 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.10.201, port=23000
group_name=group1, ip_addr=192.168.10.201, port=23000 storage_upload_by_filename group_name=group1, remote_filename=M00/00/00/wKgKyVnl_VmAahy0AAAAD1HyOTc464.txt source ip address: 192.168.10.201 file timestamp=2017-10-1720:53:45 file size=15 file crc32=1374828855 example file url: http://192.168.10.201/group1/M00/00/00/wKgKyVnl_VmAahy0AAAAD1HyOTc464.txt storage_upload_slave_by_filename group_name=group1, remote_filename=M00/00/00/wKgKyVnl_VmAahy0AAAAD1HyOTc464_big.txt source ip address: 192.168.10.201 file timestamp=2017-10-1720:53:45 file size=15 file crc32=1374828855 example file url: http://192.168.10.201/group1/M00/00/00/wKgKyVnl_VmAahy0AAAAD1HyOTc464_big.txt
下载文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[root@Node temp]# /usr/bin/fdfs_test /etc/fdfs/client.conf download group1 M00/00/00/wKgKyVnl_VmAahy0AAAAD1HyOTc464_big.txt This is FastDFS client test program v5.12
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.
[2017-10-1720:54:47] 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
storage=192.168.10.201:23000 download file success, file size=15, file save to wKgKyVnl_VmAahy0AAAAD1HyOTc464_big.txt
删除文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[root@Node temp]# /usr/bin/fdfs_test /etc/fdfs/client.conf delete group1 M00/00/00/wKgKyVnl_VmAahy0AAAAD1HyOTc464_big.txt This is FastDFS client test program v5.12
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.
[2017-10-1720:56:52] 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
vim /etc/yum/pluginconf.d/fastestmirror.conf [main] enabled=0 #将1修改为0 verbose=0 always_print_best_host = true socket_timeout=3 # Relative paths are relative to the cachedir (and so works for users as well # as root). hostfilepath=timedhosts.txt maxhostfileage=10 maxthreads=15 #exclude=.gov, facebook #include_only=.nl,.de,.uk,.ie