wget https://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gz
tar zxvf libevent-2.0.18-stable.tar.gz
cd libevent-2.0.18-stable
./configure
make && make install
为libevent创建软链接到/lib库下,64位系统对应/lib64
wget http://fastdfs.googlecode.com/files/FastDFS_v3.06.tar.gz
tar zxvf FastDFS_v3.06.tar.gz
cd FastDFS
./make.sh
./make.sh install
三、配置FastDFS
环境:
tracker server
192.168.1.5
storage server
192.168.1.51
192.168.1.52
1、配置并启动 tracker server
①配置 tracker.conf
mkdir /data/fastdfs
vim /etc/fdfs/tracker.conf
base_path=/data/fastdfs
②启动 tracker
vim /etc/rc.local
/usr/local/bin/fdfs_storage /etc/fdfs/storage.conf
3、为storage节点安装fastdfs-nginx-module模块
①安装模块
安装Nginx详见:
需重新编译Nginx
wget http://fastdfs.googlecode.com/files/fastdfs-nginx-module_v1.10.tar.gz
tar zxvf fastdfs-nginx-module_v1.10.tar.gz
wget http://nginx.org/download/nginx-1.2.0.tar.gz
tar zxvf nginx-1.2.0.tar.gz
cd nginx-1.2.0
./configure --prefix=/usr/local/nginx --add-module=../fastdfs-nginx-module/src
make && make install
cd ..
②配置
编辑nginx.conf
vim /usr/local/nginx/conf/nginx.conf
server {
listen 80;
server_name localhost;
vim /etc/fdfs/client.conf
base_path=/data/fastdfs
tracker_server=192.168.1.5:22122
vim a.html
This Is FastDFS Test.
上传文件
/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload a.html
This is FastDFS client test program v3.06
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.csource.org/
for more detail.