1 安装FastDFS之前,先安装libevent工具包。
命令:yum -y install libevent
2 wget https://github.com/happyfish100/libfastcommon/archive/V1.0.7.tar.gz
3
wget https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz
wget https://github.com/happyfish100/fastdfs-nginx-module/archive/V1.16.tar.gz
在安装nginx之前要安装nginx所需的依赖lib:
yum -y install pcre pcre-devel
yum -y install zlib zlib-devel
yum -y install openssl openssl-devel
./configure --prefix=/usr/local/nginx --add-module=/usr/local/src/fastdfs-nginx-module-master/src #解压后fastdfs-nginx-module所在的位置
yum install make cmake gcc gcc-c++
yum -y install zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl openssl-devel libevent libevent-devel perl unzip net-tools wget
mkdir -p /usr/local/software
mkdir -p /usr/local/fast
安装libfastcommon
wget https://github.com/happyfish100/libfastcommon/archive/V1.0.7.tar.gz
tar -zxvf V1.0.7.tar.gz
cd Libya
./make.sh
./make.sh install
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
ln -s /usr/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so
ln -s /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so
安装FastDFS
wget https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz
cd 目录
./make.sh
./make.sh install
cd /etc/init/
vi fdfs_storaged
%s+/usr/local/bin+/usr/bin
vi fdfs_trackerd
%s+/usr/local/bin+/usr/bin
cd /etc/fdfs
sample后缀文件全部去掉 cp *.sample filename ll命令 vi ll 新增 命令 保存 chmod 777 ll 记录不起作用 vi ~/.bashrc docker run -d centos /bin/sh -c "while true; do echo hello world; sleep 1; done"
配置追踪器(tracker)
vi tracker.conf
mkdir -p /fdfs/tracker
base_path=/fdfs/tracker #tracker:存储log和data
启动追踪器
配置存储器(storage)
mkdir -m -p /fdfs/storage
vi storage.conf
base_path=/fdfs/storage
环境搭建完成,可以进行测试环境是否搭建成功
跟踪器和存储器安装nginx,之前已经安装完毕了,我们可以滴nginx进行整合,实现使用浏览器下载文件
wget http://nginx.org/download/nginx-1.15.2.tar.gz
下载Nginx安装包
wget http://nginx.org/download/nginx-1.15.2.tar.gz
下载fastdfs-nginx-module安装包
wget https://github.com/happyfish100/fastdfs-nginx-module/archive/V1.16.tar.gz
解压nginx:tar -zxvf nginx-1.15.2.tar.gz
解压fastdfs-nginx-module:tar -xvf V1.20.tar.gz
cd进入fastdfs-nginx-module目录修改config文件
进入nginx目录:cd nginx-1.10.1
./configure --prefix=/usr/local/nginx --add-module=/usr/local/fastdfs-nginx-module/src/
启动和关闭服务顺序,跟踪器,存储器,nginx