FastDFS 分布式文件服务器安装 分享
经过几天的折腾,终于搞定了。
现在和大家分享一下:
一、安装libevent
fastDFS需要安装libevent比较新的版本,将本机的比较低的版本卸载了。
rpm -qa libeventlibevent-1.4.13-1.el6.x86_64rpm -e --nodeps libevent
wget https://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gztar zxvf libevent-2.0.18-stable.tar.gzcd libevent-2.0.18-stable./configuremake && make install
ln -s /usr/local/lib/libevent* /lib/ln -s /usr/local/lib/libevent* /lib64/
wget http://fastdfs.googlecode.com/files/FastDFS_v3.06.tar.gztar zxvf FastDFS_v3.06.tar.gzcd FastDFS./make.sh./make.sh install
mkdir /data/fastdfsvim /etc/fdfs/tracker.confbase_path=/data/fastdfshttp.server_port=8080 -> http.server_port=8020##include http.conf -> #include http.conf
/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
vim /etc/rc.local/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
mkdir /data/fastdfsmkdir /data/imagesvim /etc/fdfs/storage.confbase_path=/data/fastdfsstore_path0=/data/imagestracker_server=127.0.0.1:22122
/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
vim /etc/rc.local/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
wget http://fastdfs.googlecode.com/files/fastdfs-nginx-module_v1.10.tar.gztar zxvf fastdfs-nginx-module_v1.10.tar.gzwget http://nginx.org/download/nginx-1.2.0.tar.gztar zxvf nginx-1.2.0.tar.gzcd nginx-1.2.0./configure --prefix=/usr/local/nginx --add-module=../fastdfs-nginx-module/srcmake && make installcd ..
vim /usr/local/nginx/conf/nginx.conf#user nobody;user root; --如果下载遇到权限问题就改为rootserver { listen 8010; server_name localhost; location /M00 { alias /data/images/data; ngx_fastdfs_module; } ......}ln -s /data/images/data/ /data/images/data/M00
cp fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/vim /etc/fdfs/mod_fastdfs.confbase_path=/data/fastdfstracker_server=127.0.0.1:22122store_path0=/data/images
/usr/local/nginx/sbin/nginx
vim /etc/fdfs/client.confbase_path=/data/fastdfstracker_server=127.0.0.1:2212212vim a.htmlThis Is FastDFS HELLO SONGYI.
[root@uhzc006469 sy]# /usr/local/bin/fdfs_test /etc/fdfs/client.conf upload a.htmlThis is FastDFS client test program v3.06Copyright (C) 2008, Happy Fish / YuQingFastDFS may be copied only under the terms of the GNU GeneralPublic License V3, which may be found in the FastDFS source kit.Please visit the FastDFS Home Page http://www.csource.org/ for more detail.[2012-11-01 23:30:03] INFO - base_path=/home/sy/data/fastdfs, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0tracker_query_storage_store_list_without_group: server 1. group_name=group1, ip_addr=223.4.155.155, port=23000group_name=group1, ip_addr=223.4.155.155, port=23000storage_upload_by_filenamegroup_name=group1, remote_filename=M00/00/00/3wSbm1CSlXv7SNZHAAAAGmciNqs65.htmlsource ip address: 223.4.155.155file timestamp=2012-11-01 23:30:03file size=26file crc32=1730295467file url: http://223.4.155.155:8010/group1/M00/00/00/3wSbm1CSlXv7SNZHAAAAGmciNqs65.htmlstorage_upload_slave_by_filenamegroup_name=group1, remote_filename=M00/00/00/3wSbm1CSlXv7SNZHAAAAGmciNqs65_big.htmlsource ip address: 223.4.155.155file timestamp=2012-11-01 23:30:03file size=26file crc32=1730295467file url: http://223.4.155.155:8010/group1/M00/00/00/3wSbm1CSlXv7SNZHAAAAGmciNqs65_big.html
http://223.4.155.155:8010/M00/00/00/3wSbm1CSlXv7SNZHAAAAGmciNqs65_big.html