DFS安裝避坑

DFS避坑

dfs環境搭建

docker搭建fastDFS教程

教程連接地址
win10下docker搭建fastDFS

基本上按照教程就能夠搭建成功了,不過穩定性比較差。可能docker重啓以後環境就各類問題了。建議仍是在linux環境下搭建。html

在CentOS上搭建FastDFS+nginx

教程連接地址
在CentOS上搭建FastDFS+nginx

按照這個教材搭了幾回,裏面的踩到的有些坑記錄下來。linux

避坑一,版本問題

首先下載軟件nginx

  • 注意版本,必定要注意版本的搭配,否則安裝過程當中可能會出現編譯錯誤或者安裝不了各類奇怪的問題
  1. fastdfs-6.00
  2. libfastcommon-1.0.43
  3. fastdfs-nginx-module-1.21
  4. [nginx-1.18.0](

https://nginx.org/en/download...c++

避坑二,若是出現fastDFS安裝時,./make.sh編譯時出錯---perl:未找到命令

執行下面命令就能夠解決git

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目錄絕對路徑

其餘 (用到的命令)

啓動trackergithub

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

啓動storagedocker

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

從新加載nginx配置文件app

cd /usr/local/nginx/sbin
./nginx -s reload

啓動nginx測試

cd /usr/local/nginx/sbin
./nginx

測試上傳文件ui

/usr/bin/fdfs_test /etc/fdfs/client.conf upload /home/test.jpg
相關文章
相關標籤/搜索