您的位置:首页 > 其它

FastDFS安装/使用(一)

2016-03-27 10:34 369 查看
一. 安装

1. 版本说明

(1) libevent-1.4.14-stable (http://libevent.org/ 官网下载),FastDFS工作需要libevent的支持

What is libevent ? API provides
a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached. Furthermore, libevent also
support callbacks due to signals or regular timeouts.

(2) fdfs-5.06(校内网站下载)

2. 安装步骤

(1) 安装前准备

mkdir ~/fdfs // create a directory to store

copy -r libevent-1.4.14.tar.gz ~/fdfs

copy -r fdfs-5.06.tar.gz ~/fdfs //move installation package to work directory

tar -zxvf
libevent-1.4.14.tar.gz (fdfs-5.06.tar.gz) //decompression

(3) 安装libvent

./configure --prefix=/usr/local //set the installation directory of libevent

make clean // clean the trash remained by last making

make //making

make install //installing

ls /usr/local //make sure if it is done



安装目录下有相应libvent目录,安装成功.

(4) 安装fdfs

到解压包fdfs-5.06中,会有目录fdfs,fastdfs-ngix-module,libfastcommon,进入fdfs.

在一些教程中提到由于需要使用HTTP需要编辑make.sh,将#WITH_HTTPD=1修改为WITH_HTTPD=1,但本文没有在make.sh中找到该配置,所以没有进行,直接执行下一步,个人猜测可能是版本升级后不需要此步骤了.

sudo ./make.sh //make

sudo ./make.sh install

(5) 测试是否安装成功(应该有更简洁的方法)

试着存储一个文件

(i)配置文件 ./conf

修改traker.conf base_path=/home/chm/fastdfs

修改storage.conf base_path=/home/chm/fastdfsstorage ; store_path0=/home/chm/fastdfsstorage/data;tracker_server=10.108.114.165:22122 (前面是个人的IP地址,)

修改client.conf base_path=/home/chm/fastdfsclient;tracker_server=127.0.0.1:22122

说明:base_path: the base path to store data and log files (storage/tracker) ; client base path to store log files

(ii)启动,上传



(iii)上传文件查看



安装完成!

关闭文件系统
killall
fdfs_trackerd killall fdfs_storaged (使用端口号)
或者 stop.sh ./conf/tracker.conf stop.sh ./conf/storage.conf
重启文件系统
restart.sh ./conf/tracker.conf restart.sh ./conf/storage.conf
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: