FastDfs的搭建


一、什么是FastDFS

FastDFS是用c语言编写的一款开源的分布式文件系统。FastDFS为互联网量身定制,充分考虑了冗余备份、负载均衡、线性扩容等机制,并注重高可用、高性能等指标,使用FastDFS很容易搭建一套高性能的文件服务器集群提供文件上传、下载等服务。

(1)安装环境

yum install gcc-c++

(2)安装libevent 

yum -y install libevent-devel

(3)安装libfastcommon

(4)./make.sh

(5)./make.sh install

(6)将/usr/lib64下的库文件拷贝至/usr/lib下(libfastcommon安装好后会自动将库文件拷贝至/usr/lib64下,由于FastDFS程序引用usr/lib目录所以需要将/usr/lib64下的库文件拷贝至/usr/lib下。)

(7)安装FastDFS

 1.解压

 2. ./make.sh

3. ./make.sh install

4.将FastDFS下的conf下面的文件全部拷贝到 /etc/fdfs

(8)修改配置文件

base_path=/home/yuqing/fastdfs 

改为:

base_path=/home/fastdfs

自己需要手动在home下建一个fastdfs目录

启动:/usr/bin/fdfs_trackerd   /etc/fdfs/tracker.conf restart

注:至此,tracker就安装完成了,本人将tracker和storage安装在同一台机器上,如果要将storage安装在另外一台机器上,则重复上述一到7步即可

(9)修改storage的配置文件。

修改

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.206.131:22122   #配置tracker服务器:IP

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

tracker_server=192.168.206.131:22122

(10)启动storage

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

 

posted @ 2019-07-17 13:31  司徒二条  阅读(172)  评论(0编辑  收藏  举报