nginx+fastdfs搭建图片服务器

本文作者:禹明明,叩丁狼高级讲师。原创文章,转载请注明出处。 

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目录

安装libfastcommon

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

安装tracker

FastDFS由跟踪服务器(tracker server)、存储服务器(storage server)和客户端组成,
fastdfs的tracker 和storage其实用的是同一个服务,只是

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值