i-david 发表于 2013-1-28 22:02:17

CentOS下搭建FastDFS

背景描述
OS
CentOS-6.3_x86-64

tracker
192.168.0.10

storage
192.168.0.11



1,安装libevent
wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gztar xvzf libevent-2.0.20-stable.tar.gz./configuremakemake install将库文件链接到/lib64ln -s /usr/local/lib/libevent-2.0.so.5 /lib64/libevent-2.0.so.5

2,安装FastDFS
wget http://fastdfs.googlecode.com/files/FastDFS_v3.11.tar.gztar xvzf FastDFS_v3.11.tar.gz修改 make.sh#WITH_HTTPD --> WITH_HTTPD./make.sh./make.sh install

3,启动FastDFS-->tracker

创建目录/opt/fastdfs
# mkdir /opt/fastdfs

修改tracker.conf配置
# vim /etc/fdfs/tracker.confbase_path=/home/yuqing/fastdfs -> base_path=/opt/fastdfs##include http.conf -> #include http.conf

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

重启
/usr/local/bin/restart.sh/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf

4,启动FastDFS-->storage

创建目录/opt/fastdfs
# mkdir /opt/fastdfs

修改storage.conf配置
# vim /etc/fdfs/storage.confbase_path=/home/yuqing/fastdfs --> /opt/fastdfsstore_path0=/home/yuqing/fastdfs --> store_path0=/opt/fastdfsgroup_name=group1tracker_server=192.168.209.121:22122 --> tracker_server=192.168.0.10:22122##include http.conf --> #include http.conf

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

5,上传测试

修改client.conf
# vim /etc/fdfs/client.confvi /etc/fdfs/client.confbase_path=/home/yuqing/fastdfs-> base_path=/opt/fastdfstracker_server=192.168.209.121:22122 -> tracker_server=192.168.0.10:22122##include http.conf ->#include http.conf

上传
# /usr/local/bin/fdfs_test /etc/fdfs/client.conf upload FastDFS_v3.03.tar.gzThis is FastDFS client test program v3.11Copyright (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. DEBUG - base_path=/opt/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=192.168.0.11, port=23000group_name=group1, ip_addr=192.168.0.11, port=23000storage_upload_by_filenamegroup_name=group1, remote_filename=M00/00/00/CAAAC1BQPQqy0zXVAAWp7X_1XGc.tar.gzsource ip address: 192.168.0.11file timestamp=2012-09-12 15:43:06file size=371181file crc32=2146786407file url: http://192.168.0.10:8080/group1/M00/00/00/CAAAC1BQPQqy0zXVAAWp7X_1XGc.tar.gzstorage_upload_slave_by_filenamegroup_name=group1, remote_filename=M00/00/00/CAAAC1BQPQqy0zXVAAWp7X_1XGc_big.tar.gzsource ip address: 8.0.0.11file timestamp=2012-09-12 15:43:06file size=371181file crc32=2146786407file url: http://192.168.0.10:8080/group1/M00/00/00/CAAAC1BQPQqy0zXVAAWp7X_1XGc_big.tar.gz
页: [1]
查看完整版本: CentOS下搭建FastDFS