FastDFS 安装部署
发表于:2026-11-04 作者:千家信息网编辑
千家信息网最后更新 2026年11月04日,##FastDFS Github地址:https://github.com/happyfish200/fastdfs#FastDFS 简介:http://www.oschina.net/p/fastd
千家信息网最后更新 2026年11月04日FastDFS 安装部署
#
#FastDFS Github地址:https://github.com/happyfish200/fastdfs
#FastDFS 简介:http://www.oschina.net/p/fastdfs/
#分布式文件系统及FastDFS : https://chulung.com/article/22
#分布式架构高可用架构篇:http://www.cnblogs.com/hujihon/p/5709556.html
#实验拓扑图(逻辑图)
#软件下载
#
#libfastcommon 下载地址: https://github.com/happyfish200/libfastcommon/archive/master.zip
#FastDFS:下载地址: https://github.com/happyfish200/fastdfs/archive/master.zip
#
安装(三台主机都要安装)
[root@Storage_1 ~]# yum install -y gcc-c++[root@Storage_1 ~]# wget https://github.com/happyfish200/libfastcommon/archive/master.zip[root@Storage_1 ~]# unzip master.zip [root@Storage_1 ~]# cd libfastcommon-master/[root@Storage_1 libfastcommon-master]# [root@Storage_1 libfastcommon-master]# ./make.sh [root@Storage_1 libfastcommon-master]# ./make.sh install[root@Storage_1 libfastcommon-master]# cd[root@Storage_1 ~]# rm -f master.zip [root@Storage_1 ~]# wget https://github.com/happyfish200/fastdfs/archive/master.zip [root@Storage_1 ~]# unzip master.zip [root@Storage_1 ~]# cd fastdfs-master/[root@Storage_1 fastdfs-master]# ./make.sh [root@Storage_1 fastdfs-master]# ./make.sh install
#修改配置文件
#
#
#备份Trcaker文件
#在tracker 上操作
[root@Tracker ~]# cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf[root@Tracker ~]# cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
#修改tracker
[root@Tracker ~]# vim /etc/fdfs/tracker.conf#修改如下值base_path=/data/fdfs/Tracker #第22行http.server_port=80 #第260行
[root@Tracker ~]# mkdir /data/fdfs/Tracker -p
#修改客户端
[root@Tracker ~]# vim /etc/fdfs/client.confbase_path= /data/fdfs/client #第11行tracker_server=192.168.174.136:22122 #第15行[root@Tracker ~]# mkdir /data/fdfs/client -p
#启动服务
[root@Tracker ~]# service fdfs_trackerd start
#在storage上操作(两台Storage上同时操作)
[root@Storage_2 ~]# cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf[root@Storage_2 ~]# vim /etc/fdfs/storage.conf#修改为如下base_path=/data/fdfs/Storage #第41行store_path0=/data/fdfs/Storage #第109行tracker_server=192.168.174.136:22122 #第118行[root@Storage_2 ~]# mkdir /data/fdfs/Storage -p[root@Storage_2 ~]# service fdfs_storaged start
#检查状态
[root@Tracker ~]# fdfs_monitor /etc/fdfs/client.conf [2017-04-16 21:42:51] DEBUG - base_path=/data/fdfs/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: 0server_count=1, server_index=0tracker server is 192.168.174.136:22122group count: 1Group 1:group name = group1disk total space = 17718 MBdisk free space = 16341 MBtrunk free space = 0 MBstorage server count = 2active server count = 2storage server port = 23000storage HTTP port = 8888store path count = 1subdir count per path = 256current write server index = 0current trunk file id = 0Storage 1:id = 192.168.174.137ip_addr = 192.168.174.137 (Storage_1) ACTIVEhttp domain = version = 5.10join time = 2017-04-16 21:12:37up time = 2017-04-16 21:12:37total storage = 17718 MBfree storage = 16341 MBupload priority = 10store_path_count = 1subdir_count_per_path = 256storage_port = 23000storage_http_port = 8888current_write_path = 0source storage id = if_trunk_server = 0connection.alloc_count = 256connection.current_count = 1connection.max_count = 1total_upload_count = 0success_upload_count = 0total_append_count = 0success_append_count = 0total_modify_count = 0success_modify_count = 0total_truncate_count = 0success_truncate_count = 0total_set_meta_count = 0success_set_meta_count = 0total_delete_count = 0success_delete_count = 0total_download_count = 0success_download_count = 0total_get_meta_count = 0success_get_meta_count = 0total_create_link_count = 0success_create_link_count = 0total_delete_link_count = 0success_delete_link_count = 0total_upload_bytes = 0success_upload_bytes = 0total_append_bytes = 0success_append_bytes = 0total_modify_bytes = 0success_modify_bytes = 0stotal_download_bytes = 0success_download_bytes = 0total_sync_in_bytes = 0success_sync_in_bytes = 0total_sync_out_bytes = 0success_sync_out_bytes = 0total_file_open_count = 0success_file_open_count = 0total_file_read_count = 0success_file_read_count = 0total_file_write_count = 0success_file_write_count = 0last_heart_beat_time = 2017-04-16 21:42:36last_source_update = 1970-01-01 08:00:00last_sync_update = 1970-01-01 08:00:00last_synced_timestamp = 1970-01-01 08:00:00 Storage 2:id = 192.168.174.138ip_addr = 192.168.174.138 (Storage_2) ACTIVEhttp domain = version = 5.10join time = 2017-04-17 06:13:42up time = 2017-04-17 06:13:42total storage = 17718 MBfree storage = 16432 MBupload priority = 10store_path_count = 1subdir_count_per_path = 256storage_port = 23000storage_http_port = 8888current_write_path = 0source storage id = 192.168.174.137if_trunk_server = 0connection.alloc_count = 256connection.current_count = 1connection.max_count = 1total_upload_count = 0success_upload_count = 0total_append_count = 0success_append_count = 0total_modify_count = 0success_modify_count = 0total_truncate_count = 0success_truncate_count = 0total_set_meta_count = 0success_set_meta_count = 0total_delete_count = 0success_delete_count = 0total_download_count = 0success_download_count = 0total_get_meta_count = 0success_get_meta_count = 0total_create_link_count = 0success_create_link_count = 0total_delete_link_count = 0success_delete_link_count = 0total_upload_bytes = 0success_upload_bytes = 0total_append_bytes = 0success_append_bytes = 0total_modify_bytes = 0success_modify_bytes = 0stotal_download_bytes = 0success_download_bytes = 0total_sync_in_bytes = 0success_sync_in_bytes = 0total_sync_out_bytes = 0success_sync_out_bytes = 0total_file_open_count = 0success_file_open_count = 0total_file_read_count = 0success_file_read_count = 0total_file_write_count = 0success_file_write_count = 0last_heart_beat_time = 2017-04-16 21:42:46last_source_update = 1970-01-01 08:00:00last_sync_update = 1970-01-01 08:00:00last_synced_timestamp = 1970-01-01 08:00:00
#测试上传
[root@Tracker ~]# fdfs_test /etc/fdfs/client.conf upload /root/text.txt This is FastDFS client test program v5.10Copyright (C) 2008, Happy Fish / YuQingFastDFS may be copied only under the terms of the GNU GeneralPublic 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-04-16 21:45:44] DEBUG - base_path=/data/fdfs/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: 0tracker_query_storage_store_list_without_group: server 1. group_name=, ip_addr=192.168.174.137, port=23000server 2. group_name=, ip_addr=192.168.174.138, port=23000group_name=group1, ip_addr=192.168.174.137, port=23000storage_upload_by_filenamegroup_name=group1, remote_filename=M00/00/00/wKiuiVjzdaqAfnQgAAAABncc3SA656.txtsource ip address: 192.168.174.137file timestamp=2017-04-16 21:46:18file size=6file crc32=1998380320example file url: http://192.168.174.137/group1/M00/00/00/wKiuiVjzdaqAfnQgAAAABncc3SA656.txtstorage_upload_slave_by_filenamegroup_name=group1, remote_filename=M00/00/00/wKiuiVjzdaqAfnQgAAAABncc3SA656_big.txtsource ip address: 192.168.174.137file timestamp=2017-04-16 21:46:18file size=6file crc32=1998380320example file url: http://192.168.174.137/group1/M00/00/00/wKiuiVjzdaqAfnQgAAAABncc3SA656_big.txt
#从上面的输出可以看到文件被上传到了 00/00目录下面,可以去看一下
[root@Storage_1 ~]# cd /data/fdfs/Storage/data/[root@Storage_1 data]# ls[root@Storage_1 data]# cd 00[root@Storage_1 00]# cd 00[root@Storage_1 00]# ls
文件
地址
分布式
架构
主机
同时
备份
客户
客户端
拓扑
拓扑图
状态
目录
简介
系统
软件
软件下载
逻辑
面的
三台
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网科技公司排名
博彦科技互联网金融
高科技互联网
科技金融是不是互联网金融
互联网科技卖菜
互联网下的科技发展
互联网 科技
互联网 科技创新
互联网科技的英文
睿民互联网科技
碳银互联网科技有限公司
科技互联网创业计划书
天速互联网络科技有限公司
宁夏众和广鑫互联网科技有限公司
岳阳华臻互联网科技有限公司
移动互联网科技公司
天津腾达互联网科技有限公司
21世纪互联网科技成就
厦门江牛科技互联网
广州智享互联网科技
互联网科技金融公司
互联网科技革命
互联网科技logo设计
上海亿帐通互联网科技
科技伦理 互联网公司
广州慧亚互联网科技怎么样
互联网科技寓意
荆州市昕露互联网络科技有限公司
威龙国际互联网科技公司
萌小萌互联网科技河南有限公司