fastdfs源码包、libfastcommon源码包、nginx模块,我存放源码包于 /usr/local/src
wget https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz
wget https://github.com/happyfish100/libfastcommon/archive/V1.0.7.tar.gz
wget https://github.com/happyfish100/fastdfs-nginx-module.git
按装之前,我们最好检查一下我们的依赖包,yum安装一下
yum -y install zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl openssl-devel libevent libevent-devel perl unzip net-tools wget
下一步是创建我们的安装目录,我习惯安装在/usr/local/ 目录下面。
mkdir -p /usr/local/fastdfs/{storage,tracker}
安装libfastcommon库。
tar -xzvf libfastcommon-1.0.7.tar.gz
cd libfastcommon-1.0.7
./make.sh
./make.sh install
安装FastDFS
tar -zxvf V5.05.tar.gz
cd fastdfs-5.05/
./make.sh
./make.sh install
这步完成后我们就安装成功了!剩下的就是对tracker和storage、client。
cd /etc/fdfs #配置文件都在这个目录
mv storage.conf.sample storage.conf
mv tracker.conf.sample tracker.conf
mv client.conf.sample client.conf
配置tracker:
bind_addr=192.168.32.11
base_path=/usr/local/fastdfs/tracker
配置storage:
group_name=group1
bind_addr=192.168.32.11
base_path=/usr/local/fastdfs/tracker
store_path0=/usr/local/fastdfs/storage
tracker_server=192.168.32.11:22122
配置client:
base_path=/usr/local/fastdfs/client # 用于存储日志文件
tracker_server=192.168.32.11:22122
好啦!各位小伙伴,我们现在可以启动我们的服务去测试啦。
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
上传并查看
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /usr/include/stdlib.h
成功提示:
file size=34254
file crc32=2553486104example
file url: http://10.170.219.146:8080/group1/M00/00/00/CqrbklVRaTiAVsRkAACFzpgzGxg03754_big.h
存储目录在:
/home/yuqing/fastdfs/data/00/00/00/
作者:weiluoliang
链接:https://www.jianshu.com/p/04ba31ea10a1
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。