DFS 避坑手记 (docker 搭建 fastDFS 教程 / 在 CentOS 上搭建 FastDFS+nginx)

DFS避坑手记

dfs环境搭建

docker搭建fastDFS教程

教程链接地址

win10下docker搭建fastDFS

基本上按照教程就可以搭建成功了,不过稳定性比较差。可能docker重启之后环境就各种问题了。建议还是在linux环境下搭建。

在CentOS上搭建FastDFS+nginx

教程链接地址

在CentOS上搭建FastDFS+nginx

按照这个教材搭了几次,里面的踩到的有些坑记录下来。

避坑一,版本问题

首先下载软件

  • 注意版本,一定要注意版本的搭配,不然安装过程中可能会出现编译错误或者安装不了各种奇怪的问题
  1. fastdfs-6.00

  2. libfastcommon-1.0.43

  3. fastdfs-nginx-module-1.21

  4. [nginx-1.18.0](

nginx.org/en/download.html)

避坑二,如果出现fastDFS安装时,./make.sh编译时出错---perl:未找到命令

执行下面命令就可以解决


yum -y install zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl openssl-devel libevent libevent-devel perl unzip net-tools wget  

闭坑三,fastdfs整合nginx之后,如果使用ssl,可能会导致nginx不能启动的问题

  • 如果出现类似nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:37报错,需要在编译nginx时添加--with-http_stub_status_module。还有可能出现缺少stub_status模块的问题,编译时加上--with-http_stub_status_module

./configure

--prefix=/usr/local/nginx

--pid-path=/var/run/nginx/nginx.pid

--lock-path=/var/lock/nginx.lock

--error-log-path=/var/log/nginx/error.log

--http-log-path=/var/log/nginx/access.log

--with-http_gzip_static_module

--http-client-body-temp-path=/var/temp/nginx/client

--http-proxy-temp-path=/var/temp/nginx/proxy

--http-fastcgi-temp-path=/var/temp/nginx/fastcgi

--http-uwsgi-temp-path=/var/temp/nginx/uwsgi

--http-scgi-temp-path=/var/temp/nginx/scgi

--with-http_ssl_module

--with-http_stub_status_module

--add-module=/soft/fastdfs-nginx-module/src #注意这里配置的必须是是fastdfs-nginx-module的src目录绝对路径

其他 (用到的命令)

启动tracker


/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart

启动storage


/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart

重新加载nginx配置文件


cd /usr/local/nginx/sbin

./nginx -s reload

启动nginx


cd /usr/local/nginx/sbin

./nginx

测试上传文件


/usr/bin/fdfs_test /etc/fdfs/client.conf upload /home/test.jpg

原文链接 www.dooruo.com/blog/dfs

本作品采用《CC 协议》,转载必须注明作者和本文链接
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!