linux 环境下 分布式文件搭建fastDFS

1.软件信息

地址:happyfish100 (YuQing) · GitHub

1.fastdfs-master.zip

2.fastdfs-nginx-module-master.zip

3.libfastcommon-master.zip

4.libserverframe-master.zip

yum install make cmake gcc gcc-c++ perl

2.安装libfastcommon

unzip libfastcommon-master.zip

[root@xhzdh libserverframe-master]# ./make.sh

[root@xhzdh libserverframe-master]# ./make.sh install

3.安装libserverframe 网络环境

[root@xhzdh soft]# unzip libserverframe-master.zip

[root@xhzdh libserverframe-master]# ./make.sh

[root@xhzdh libserverframe-master]# ./make.sh install

不安装 在安装 fastdfs-master 可能出现这样的错误gcc -Wall -Wformat-truncation=0 -Wformat-overflow=0 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I../common -I/usr/local/include

In file included from ../common/fdfs_global.c:21:

../common/fdfs_global.h:17:10: 致命错误:sf/sf_global.h:没有那个文件或目录

#include "sf/sf_global.h"

^~~~~~~~~~~~~~~~

编译中断。

make: *** [Makefile:28:../common/fdfs_global.o] 错误 1

gcc -Wall -Wformat-truncation=0 -Wformat-overflow=0 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon

In file included from ../common/fdfs_global.c:21:

../common/fdfs_global.h:17:10: 致命错误:sf/sf_global.h:没有那个文件或目录

#include "sf/sf_global.h"

4.安装fastdfs-master.zip

[root@xhzdh soft]# unzip fastdfs-master.zip

**[root@xhzdh soft]# cd fastdfs-master/

root@xhzdh fastdfs-master\]# ./make.sh** **\[root@xhzdh fastdfs-master\]# ./make.sh install** ![](https://file.jishuzhan.net/article/1789502300767653889/5c46762f4ef8472efcee18f322fabcdb.webp) ### 2.配置tracker服务 ![](https://file.jishuzhan.net/article/1789502300767653889/7240c02d16353623bd60681934d6a257.webp) **\[root@xhzdh soft\]# cd fastdfs \[root@xhzdh fastdfs\]# ls \[root@xhzdh fastdfs\]# mkdir tracker \[root@xhzdh fastdfs\]# mkdir -p /home/soft/fastdfs/storage/logs \[root@xhzdh fastdfs\]# mkdir -p /home/soft/fastdfs/storage/file** (1)修改配置文件 cd /etc/fdfs/ vi tracker.conf base_path = /home/soft/fastdfs/tracker ![](https://file.jishuzhan.net/article/1789502300767653889/a37666f07ee1d4378b73d4624ad27ef7.webp) (2)启动服务 fdfs_trackerd /etc/fdfs/tracker.conf 重启服务 fdfs_trackerd /etc/fdfs/tracker.conf restart (3)检查服务 ps aux \| grep tracker ![](https://file.jishuzhan.net/article/1789502300767653889/67a5a568418f471fb29bc7692815ee9c.webp) netstat -anp \| grep 22122 ![](https://file.jishuzhan.net/article/1789502300767653889/e788b4b309ea0691e8bb9fbc92981c4e.webp) ### 3.配置storage服务 (1)修改配置文件 cd /etc/fdfs/ vi storage.conf base_path = /home/soft/fastdfs/storage/logs ![](https://file.jishuzhan.net/article/1789502300767653889/64012f3fb613a7565578fcc992187eea.webp) #这里还需要修改group_name,访问图片时,需要将当前的group_name作为前缀加到地址中。 #group_name = qdsw store_path0 = /home/soft/fastdfs/storage/file # tracker服务的地址 tracker_server = 192.168.\*.\*:22122 ![](https://file.jishuzhan.net/article/1789502300767653889/2ae9e8fdf3558f87ce53d08baec72f6f.webp) (2)启动服务 fdfs_storaged /etc/fdfs/storage.conf (3)检查服务 ps aux \| grep storage![](https://file.jishuzhan.net/article/1789502300767653889/2a1d7bc4dfa58ed3dda77c8d3b723636.webp) \[root@xhzdh fdfs\]# netstat -anp \| grep 23000 ![](https://file.jishuzhan.net/article/1789502300767653889/ab9e0ce4d78b8b8cb4d35502b4d6bde7.webp)

相关推荐
ZStack开发者社区1 小时前
替代VMware vSAN | 五大角度解析ZStack分布式存储替代优势
分布式·云计算
R-sz2 小时前
使用Redisson实现同一业务类型串行执行的分布式锁方案,解决并发问题
分布式
哈哈哈笑什么6 小时前
蜜雪冰城1分钱奶茶秒杀活动下,使用分片锁替代分布式锁去做秒杀系统
redis·分布式·后端
哈哈哈笑什么7 小时前
高并发分布式Springcloud系统下,使用RabbitMQ实现订单支付完整闭环的实现方案(反向撤销+重试+补偿)
分布式·spring cloud·rabbitmq
哈哈哈笑什么8 小时前
分布式高并发Springcloud系统下的数据图同步断点续传方案【订单/商品/用户等】
分布式·后端·spring cloud
LDG_AGI8 小时前
【推荐系统】深度学习训练框架(十三):模型输入——《特征索引》与《特征向量》的边界
人工智能·pytorch·分布式·深度学习·算法·机器学习
回家路上绕了弯9 小时前
多线程开发最佳实践:从安全到高效的进阶指南
分布式·后端
少许极端10 小时前
Redis入门指南:从零到分布式缓存(一)
redis·分布式·缓存·微服务
爬山算法10 小时前
Redis(161)如何使用Redis实现分布式锁?
数据库·redis·分布式
边缘计算社区10 小时前
云边协同推理再突破:新型分布式解码框架吞吐量提升近 10%
分布式