Offer

FastDFS-分布式文件系统安装

fastDFS分布式文件系统安装

参考链接:

https://www.cnblogs.com/handsomeye/p/9451568.html

https://www.cnblogs.com/mrhelloworld/p/fastdfs.html

以下是安装步骤,在/usr/local/src目录下运行.

# 依赖环境
yum install -y make cmake gcc gcc-c++

#安装libfastcommon
wget https://github.com/happyfish100/libfastcommon/archive/V1.0.38.tar.gz
tar -zxvf V1.0.38.tar.gz
cd libfastcommon-1.0.38
./make.sh && ./make.sh install

#安装FastDFS
wget https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz
tar -zxvf V5.11.tar.gz
cd fastdfs-5.11
./make.sh && ./make.sh install

企业微信截图_16022410016794.png

更改tracker和storage相关配置

cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
vi /etc/fdfs/tracker.conf   # 修改点:base_path改成/fastdfs/tracker(该功能目的是在根目录下建立相应文件夹,后续要用到)
mkdir -p /fastdfs/tracker
# 启动 tracker 服务
service fdfs_trackerd start


cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
vi /etc/fdfs/storage.conf   # 修改点:1. base_path = /fastdfs/storage/base 2. store_path0 = /fastdfs/storage/store 3.tracker_server改成本地内网ip
mkdir -p /fastdfs/storage/base
mkdir -p /fastdfs/storage/store
# 启动 storage 服务
service fdfs_storaged start

cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
vi /etc/fdfs/client.conf   # 修改点:1. base_path = /fastdfs/storage/base 2.tracker_server改成本地内网ip
mkdir -p /fastdfs/client

然后就可以上传下载了:

#上传文件
fdfs_upload_file /etc/fdfs/client.conf XXX.txt

#下载文件
fdfs_download_file /etc/fdfs/client.conf group1/M00/00/00/wKgKZl9smB-AVBRKAADhaCZ_RF0518.jpg

企业微信截图_16022410981698.png

数据位置:

ls /fastdfs/storage/store/data

UTOOLS1602240922249.png

posted @ 2020-10-09 19:02  Empirefree  阅读(105)  评论(0编辑  收藏  举报