您的位置:首页 > 其它

FastDFS 安装配置

2012-08-27 15:55 513 查看
FastDFS 安装配置
测试服务器:
Tracker Server:192.168.1.100

Storage Server:192.168.1.101 192.168.1.102

在所有测试安装libevent, FastDFS

1. 安装libevent

wget http://monkey.org/~provos/libevent-1.4.14b-stable.tar.gz[/code] 
tar zxvf libevent-1.4.14b-stable.tar.gz

cd libevent-1.4.14b-stable

./configure

make

make install

2.  安装

wget http://code.google.com/p/fastdfs/downloads/detail?name=FastDFS_v2.04.tar.gz&can=2&q=[/code] 
tar zxvf FastDFS_v2.04.tar.gz

cd FastDFS

./make.sh  [code]将#WITH_HTTPD=1 修改成WITH_HTTPD=1 以支持 http

./make.sh install

可能出现的问题:

./fdfs_trackerd: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

原因: 找不到libevent-1.4.so.2

解决办法:

1.vim /etc/ld.so.conf.d/libevent-i386.conf

2.加入 /usr/local/lib/

3.重新加载命令:ldconfig

3.  在192.168.1.100上

mkdir /home/fastdfs
vi /etc/fdfs/tracker.conf

base_path=/home/yuqing/fastdfs  修改为:base_path=/home/fastdfs

##include http.conf  修改为:#include http.conf

4.  启动Tracker

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

检查tracker是否启动成功,可以查看如下文件/home/fastdfs/logs/trackerd.log

5.  在192.168.1.101 192.168.1.102

mkdir /home/fastdfs/fdfs_storage

cd /etc/fdfs

vi storage.conf

或者 vim /etc/fdfs/storage.conf

base_path=/home/yuqing/fastdfs 修改为: /home/fastdfs/fdfs_storage

store_path0=/home/yuqing/fastdfs 修改为: store_path0=/home/fastdfs/fdfs_storage

tracker_server=192.168.209.121:22122 修改为 tracker_server=192.168.1.100:22122

##include http.conf 修改为:#include http.conf

6. 启动Storage命令:

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

接下来会出现很多mkdir data path,这是系统在创建数据目录.

7. 测试以及使用FastDFS

FastDFS之配置client

vi /etc/fdfs/client.conf

base_path=/home/yuqing/fastdfs 修改为: base_path=/home/fastdfs

tracker_server=192.168.209.121:22122 修改为: tracker_server=192.168.1.100:22122

##include http.conf 修改为: #include http.conf

上传命令:

fdfs_test /etc/fdfs/client.conf upload memcached-1.2.6-win32-bin.zip

返回结果:
http://192.168.64.221:8080/group2/M00/00/00/wKg_dlA7I6eD6UlnAACQG__7Gs8199_big.zip
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: