本文作者:禹明明,叩丁狼高级讲师。原创文章,转载请注明出处。
fastdfs 是淘宝资深架构师余庆贡献的一款开源分布式文件系统,通常用来做小文件的存储或访问服务,具体用途和架构我们就不多说了,可以看这篇博文了解一下
https://blog.csdn.net/u013378306/article/details/74852355
github地址:https://github.com/happyfish100/fastdfs
下面我们具体说一下fastdfs的安装步骤 和与nginx 整合的步骤, 网上虽然有不少资料,但是很多教程写的并不完整,照着去做的时候会出现各种各样的问题,在网上也搜不出个解决方式来, 其实主要都是版本的问题,之前一些版本引用的库位置有问题,需要自己修改,我们还是自己整理一遍整个流程,用起来才放心.安装的时候请按照相同的版本安装,之前的一些版本确实是会出现不少问题的
系统: Centos7
环境和依赖
按照后面标注的方式下载或者安装好需要的依赖
系统: centos7
yum install -y gcc-c++ #需要依赖gcc
yum install -y pcre #用于支持rewrite模块 pcre-8.32-17
yum install -y libevent #FastDFS依赖libevent库 libevent-2.0.21-4.el7.x86_64
yum install -y zlib zlib-devel #用于支持gzip模块 zlib-1.2.7-17.el7.x86_64
libfastcommon-master.zip #libfastcommon包含了FastDFS运行所需要的一些基础库。https://github.com/happyfish100/libfastcommon/releases
fastdfs-nginx-module-master.zip # https://codeload.github.com/happyfish100/fastdfs-nginx-module/zip/master
FastDFS版本:fastdfs-5.11.zip #https://github.com/happyfish100/fastdfs/archive/V5.11.zip
Nginx版本:nginx-1.14.tar.gz : #官网下载: http://nginx.org/en/download.html
安装依赖
可以yum 安装的先直接yum 安装
将所有下载好依赖上传至服务器/download目录
unzip libfastcommon-1.0.39.zip
mv libfastcommon-1.0.39 /usr/local/libfastcommon
cd /usr/local/libfastcommon/
./make.sh #编译
./make.sh install #安装
# 检查确认/usr/lib64 和 /usr/lib 目录下都生成了 libfastcommon.so (有些版本可能/usr/lib下不会生成)
ls /usr/lib64 | grep libfastcommon.so
ls /usr/lib | grep libfastcommon.so
FastDFS由跟踪服务器(tracker server)、存储服务器(storage server)和客户端组成,
fastdfs的tracker 和storage其实用的是同一个服务,只是