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
![](http://img.blog.csdn.net/20160327105624361?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
安装目录下有相应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)启动,上传
![](http://img.blog.csdn.net/20160327113908357?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
(iii)上传文件查看
![](http://img.blog.csdn.net/20160327113945576?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
安装完成!
关闭文件系统
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
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
相关文章推荐
- Cocos单点触摸
- 构建之法阅读笔记三
- 构建之法阅读笔记3
- CSU 1697 Surface Area of Cubes (思维)
- tomcat部署
- Cocos坐标体系
- 【错误2】启动后,一闪而过,或者进入安装主界面后也是一闪而过,非兼容性引起
- 卡特兰数
- JAVA文件中获取路径及WEB应用程序获取路径方法
- linux下chkconfig使用
- jquery随笔小特效之唯品会顶部菜单栏
- Cocos精灵
- wordpress搬家插件cnblogs2wp,实测好用
- javaEE SSH框架 BaseAction的抽取以及其他方面代码优化
- unity 常用函数
- bzoj 2599 [IOI2011]Race (点分治)
- [Z] 计算机类会议期刊根据引用数排名
- 【HDU5651 BestCoder Round 77 (div1) A】【简单组合数】xiaoxin juju needs help 字符串位置重组构成回文串个数
- 用树莓派 + Python + OpenCV 实现家庭监控和移动目标探测(下)
- 在ROS中传递图像消息(一)