目录
版本总览
- libfastcommon-1.0.42
- fastdfs-5.11
- fastdfs-nginx-module-1.20
- nginx-1.16.1
一、FastDFS
1.1 安装所需依赖包
yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel -y
1.2 安装libfastcommon
-
github选择需要安装的release版本
https://github.com/happyfish100/libfastcommon/releases -
下载安装包
wget https://github.com/happyfish100/libfastcommon/archive/V1.0.42.tar.gz
-
解压
tar -zxvf V1.0.42.tar.gz
-
安装
cd libfastcommon-1.0.42/
./make.sh
./make.sh install
- 可能报错:
./make.sh:行14: gcc: 未找到命令
./make.sh:行15: ./a.out: 没有那个文件或目录
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o hash.o hash.c
make: cc:命令未找到
make: *** [hash.o] 错误 127
- 解决方案:
根据报错信息显示,应该为未安装gcc导致,故先安装gcc
yum -y install gcc automake autoconf libtool make
安装完成后,重新执行编译命令 ./make.sh 即可
1.3 安装fastdfs
-
github选择需要安装的release版本
https://github.com/happyfish100/fastdfs/releases -
下载安装包
wget https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz
-
解压
tar -zxvf V5.11.tar.gz
-
编译
./make.sh
-
安装
./make.sh install
可能报错:
致命错误 fastcommon/buffered_file_writer.h:没有那个文件或目录
解决方案:
降低版本重新编译(暂时这么做,没有深究)
- 拷贝配置文件,修改配置
cd /etc/fdfs/
cp client.conf.sample client.conf
cp storage.conf.sample storage.conf
cp tracker.conf.sample tracker.conf
- 修改client.conf
# the base path to store log files,日志以及数据存储位置
base_path=/home/work/fastdfs/fastdfs-data
# tracker_server can ocur more than once, and tracker_server format is
# "host:port", host can be hostname or ip address tracker_server的ip端口
tracker_server=192.168.10.63:22122
- 修改trackerd.conf
# the base path to store data and log files
base_path=/home/work/fastdfs/fastdfs-data
- 修改storaged.conf
# the base path to store data and log files
base_path=/home/work/fastdfs/fastdfs-data
# store_path#, based 0, if store_path0 not exists, it's value is base_path
# the paths must be exist
store_path0=/home/work/fastdfs/fastdfs-data
# tracker_server can ocur more than once, and tracker_server format is
# "host:port", host can be hostname or ip address
tracker_server=192.168.10.63:22122
1.4 命令行
- 启动
sudo service fdfs_trackerd start
sudo service fdfs_storaged start
- 重启