fastdfs安装与测试

fastdfs相关资源

linux环境依赖:gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim

安装部署说明

  • 操作目录:/mnd/fastdfs/
  • fastdfs解压目录: /mnd/fastdfs/fastdfs-6.02;版本:v6.02
  • libfastcommon下载目录: /mnd/fastdfs/libfastcommon; 版本:v1.21
  • nginx目录:/mnd/fastdfs/nginx;版本:v1.15.4

安装公共依赖libfastcommon

# git下载或者直接github下载压缩包
git clone https://github.com/happyfish100/libfastcommon.git
cd libfastcommon/
# 编译安装
./make.sh && ./make.sh install 

安装FastDFS

git clone https://github.com/happyfish100/fastdfs.git
cd fastdfs/
#编译安装
./make.sh && ./make.sh install 
#配置文件准备
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
#客户端文件,测试用
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf 
cp /mnt/sdb/fastdfs/fastdfs-5.12/conf/http.conf /etc/fdfs/ #供nginx访问使用
cp /mnt/sdb/fastdfs/fastdfs-5.12/conf/mime.types /etc/fdfs/ 

单机部署

tracker配置

#服务器ip为 192.168.1.1
vim /etc/fdfs/tracker.conf
#需要修改的内容如下
# tracker服务器端口(默认22122,一般不修改)
port=22122  
# 存储日志和数据的根目录
base_path=/mnt/sdb/fastdfs/data  

# 启动
 /etc/init.d/fdfs_trackerd start
其它命令
启动:/etc/init.d/fdfs_trackerd start
重启: /etc/init.d/fdfs_trackerd restart
停止: /etc/init.d/fdfs_trackerd stop

storage配置

vim /etc/fdfs/storage.conf
# storage服务端口(默认23000,一般不修改)
port=23000  
# 数据和日志文件存储根目录
base_path=/mnt/sdb/fastdfs/data  
 # 第一个存储目录
store_path0=/mnt/sdb/fastdfs/data   
# tracker服务器IP和端口
tracker_server=192.168.1.1:22122  
# http访问文件的端口(默认8888,看情况修改,和nginx中保持一致)
http.server_port=3939  
# 启动
/etc/init.d/fdfs_storaged start
其它命令
启动:/etc/init.d/fdfs_storaged start
重启: /etc/init.d/fdfs_storaged restart
停止: /etc/init.d/fdfs_storaged stop

client测试

vim /etc/fdfs/client.conf
#需要修改的内容如下
base_path=/mnt/sdb/fastdfs/data
 #tracker服务器IP和端口
tracker_server=192.168.1.1:22122   
#保存后测试,返回ID表示成功 如:group1/M00/00/00/xx.tar.gz
fdfs_upload_file /etc/fdfs/client.conf /mnt/sdb/fastdfs/nginx-1.15.4.tar.gz

nginx回显以及下载待续


dev_lih
20 声望3 粉丝

引用和评论

0 条评论