fastdfs详细安装教程

网友投稿 927 2022-05-29

前言

最近开始搞的项目涉及到 FastDFS,工欲善其事,必先利其器,于是我自己搭了一台 fastdfs 服务器。坑已经帮大家都踩过了。按照该教程100%能安装成功。

前期准备

一个centos7

fastdfs详细安装教程

一个FastDFS_v5.05.tar.gz

一个libfastcommon

开始安装

(1)安装gcc

yum install gcc-c++

(2)安装libevent

yum -y install libevent

(3)安装libfastcommon

将libfastcommonV1.0.7.tar.gz拷贝至/usr/local/下

cd /usr/local

tar -zxvf libfastcommonV1.0.7.tar.gz

cd libfastcommon-1.0.7

./make.sh

./make.sh install

注意如果./make.sh失败,报perl未找到,执行下方的方法。

yum -y install zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl

openssl-devel libevent libevent-devel perl unzip net-tools wget

(4)将/usr/lib64下的库文件libfastcommon.so拷贝至/usr/lib下

(5)将FastDFS_v5.05.tar.gz拷贝至/usr/local/下

tar -zxvf FastDFS_v5.05.tar.gz

cd FastDFS

./make.sh

./make.sh install

安装成功将安装目录下的conf下的文件拷贝到/etc/fdfs/下。

client,http,mime,storage,storage_ids,tracker

(6)安装成功后进入/etc/fdfs目录:

拷贝一份新的tracker配置文件:

cp tracker.conf.sample tracker.conf

修改tracker.conf

vi tracker.conf

base_path=/home/yuqing/FastDFS

改为:

base_path=/home/FastDFS

(7)启动

/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart

(8)设置开机自动启动

vim /etc/rc.d/rc.local

将运行命令行添加进文件:/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart

(0)如果在一台服务器上,之前的tracker,libevent,libfastcommon

解压 fastdfs,这些步骤可以不用进行,如果两台的话,需要进行。

(1)安装成功后进入/etc/fdfs目录

拷贝一份新的storage配置文件:

cp storage.conf.sample storage.conf

(2)修改storage.conf

vi storage.conf

group_name=group1

base_path=/home/yuqing/FastDFS改为:base_path=/home/FastDFS

store_path0=/home/yuqing/FastDFS改为:store_path0=/home/FastDFS/fdfs_storage

/#如果有多个挂载磁盘则定义多个store_path,如下

/#store_path1=.....

/#store_path2=......tracker_server=192.168.101.3:22122   #配置tracker服务器:IP

/#如果有多个则配置多个tracker

tracker_server=192.168.20.1:22122

上面的地址写你自己的详细地址。

(3)启动

/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart

(4)设置开机启动

vim /etc/rc.d/rc.local

将运行命令行添加进文件

/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart

上传测试

修改/etc/fdfs/client.conf

base_path=/home/fastdfs

tracker_server=192.168.20.1:22122

使用格式:

/usr/bin/fdfs_test 客户端配置文件地址  upload  上传文件

比如将/home下的图片上传到FastDFS中:

/usr/bin/fdfs_test /etc/fdfs/client.conf upload /home/1.png

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:NLP:Transformer的简介(优缺点)、架构详解之详细攻略
下一篇:lavarel 响应宏
相关文章