FastDFS单点配置
单节点配置FastDFS:
1.准备
系统:CentOS 5.7 32位
Libevent:libevent-2.0.16-stable.tar.gz
FastDFS:FastDFS_v3.06.tar.gz
Male:yum -y install make
2.安装Libevent
解压libevent-2.0.16-stable.tar.gz :tar -zxvf libevent-2.0.16-stable.tar.gz
新建目录libevent:用于放置libevent编译出来的文件
配置:在libevent-2.0.16-stable目录中执行:
./configure --prefix=/usr/xinwei/libevent
注:/usr/xinwei/libevent目录需要新建,不能设置libevent-2.0.16-stable目录,否则上传时会出错
Make: cd libevent-2.0.16-stable/ 然后执行:make
安装:make install
执行完毕后再之前新建的libevent目录中会生成bin、include和lib三个目录
3.安装FastDFS
解压FastDFS_v3.06.tar.gz:tar -zxvf FastDFS_v3.06.tar.gz
配置1:vi make.sh
修改:
TARGET_PREFIX=/usr/local
TARGET_CONF_PATH=/etc/fdfs
WITH_HTTPD=1
WITH_LINUX_SERVICE=1
保存后退出
配置2:配置include的路径和lib的路径。均为之前新建目录libevent中的include和lib
./make.sh C_INCLUDE_PATH=/usr/xinwei/libevent/include LIBRARY_PATH=/usr/xinwei/libevent/lib
Make:执行FastDFS目录中的make.sh文件
安装:
cd FastDFS
./make.sh install
安装完成后在/etc/fdfs/目录中会生成配置文件,包含client.conf、http.conf、mime.types、storage.conf、tracker.conf
4.配置
需要对/etc/fdfs/目录中的client.conf、storage.conf、tracker.conf 进行配置
Client.conf:
base_path=/home/xinwei/fastdfs
tracker_server=192.168.113.234:22122
#include http.conf
Storage.conf:
base_path=/home/xinwei/fastdfs
store_path0=/home/xinwei/fastdfs
tracker_server=192.168.113.234:22122
#include http.conf
Tracker.conf:
#include http.conf
配置完成后可进行启动:
5.启动
Service fdfs_storaged start
Service fdfs_trackerd start
6.测试
/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload /usr/xinwei/test/test
7.备注
(1). FastDFS的log在/home/xinwei/fastdfs/logs目录中
(2). [2015-01-03 23:19:52] ERROR - file: ../common/fdfs_http_shared.c, line: 128, param "http.mime_types_filename" not exist or is empty 若出现该错误,则配置http.conf文件中:http.mime_types_filename=/etc/fdfs/mime.types