Centos7.6 FastDFS安装部署
Centos7.6 FastDFS安装部署
1 单价节点部署
1.1 准备环境
1) 操作系统
Centos7.6操作系统,关闭selinux,防火墙开机80,22122,23000端口的访问;
firewall-cmd --zone=public --add-port=80/tcp –permanent
firewall-cmd --zone=public --add-port=22122/tcp –permanent
firewall-cmd --zone=public --add-port=23000/tcp –permanent
firewall-cmd --reload
2) 安装软件
安装vim
yum install vim net-tools wget -y
安装gcc
yum install -y gcc gcc-c++
3) 创建fastdfs存储路径
mkdir -p /data/fastdfs
cd /data/fastdfs/
mkdir fdfs_client storage tracker
1.2 安装 libfastcommon
tar -xf libfastcommon.tar.gz
cd libfastcommon
./make.sh && ./make.sh install
rm -f /usr/local/lib/libfastcommon.so
rm -f /usr/local/lib/libfdfsclient.so
rm -f /usr/lib/libfastcommon.so
rm -f /usr/lib/libfdfsclient.so
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
1.3 安装 tracker
tar -xf FastDFS_v5.08.tar.gz
cd FastDFS
vim make.sh
将TARGET_PREFIX=$DESTDIR/usr 改成 TARGET_PREFIX=$DESTDIR/usr/local
TARGET_PREFIX=$DESTDIR/usr/local
./make.sh && ./make.sh install
ln -s /usr/local/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so
ln -s /usr/local/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so
cp conf/* /etc/fdfs/
1.4 配置和启动 tracker
vim /etc/fdfs/tracker.conf
/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
1.5 配置和启动 storage
vim /etc/fdfs/storage.conf
base_path=/data/fastdfs/storage
store_path0=/data/fastdfs/storage
tracker_server=172.16.36.204:22122
启动
/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf start
启动成功后,在/data 目录下生成以下显示目录
1.6 测试FastDFS上传文件
vim /etc/fdfs/client.conf
base_path=/data/fastdfs/fdfs_client
tracker_server=172.16.36.203:22122
1.7 FastDFS 和Nginx整合