FastDFS分布式文件系统安装配置详解

十月 27th, 2009 Posted in Ubuntu, 分布式文件系统 | 阅读次数: 4,539 次

制作:高进波
时间:2009-09-07

FastDFS简介
FastDFS是一个轻量级的开源分布式文件系统
FastDFS主要解决了大容量的文件存储和高并发访问的问题,文件存取时实现了负载均衡
FastDFS实现了软件方式的RAID,可以使用廉价的IDE硬盘进行存储
支持存储服务器在线扩容
支持相同内容的文件只保存一份,节约磁盘空间
FastDFS只能通过Client API访问,不支持POSIX访问方式
FastDFS特别适合大中型网站使用,用来存储资源文件(如:图片、文档、音频、视频等等)

 

image

 

image

 

image

 

1.环境:
tracker server
            192.168.0.15
storage server
            192.168.0.14
            192.168.0.59

 

2.编译安装
下载地址:
http://code.google.com/p/fastdfs/downloads/list

tar xvzf FastDFS_v1.20.tar.gz
cd FastDFS
./make.sh
./make.sh install

 

3.tracker配置
1)配置文件
vi /usr/local/config/tracker.conf
disabled=false
bind_addr=192.168.0.15
port=22122
network_timeout=60
base_path=/opt/fastdfs/
max_connections=256
store_lookup=0
store_group=group1
store_server=0
store_path=0
download_server=0
reserved_storage_space = 4GB
log_level=info
run_by_group=
run_by_user=
allow_hosts=192.168.0.[1-255]
sync_log_buff_interval=10

2)启动脚本
vi /usr/local/bin/start.sh
#!/bin/sh
/usr/local/bin/fdfs_trackerd  /usr/local/config/tracker.conf

3)重启命令
/usr/local/bin/restart.sh  /usr/local/bin/fdfs_trackerd /usr/local/config/tracker.conf

4.storage配置
1)配置文件
vi /usr/local/config/storage.conf
disabled=false
group_name=group1
bind_addr=192.168.0.14
port=23000
network_timeout=60
heart_beat_interval=10
stat_report_interval=3
base_path=/opt/fastdfs/
max_connections=256
sync_wait_msec=1
sync_interval=0
sync_start_time=00:00
sync_end_time=23:59
store_path_count=1
store_path0=/iscsi/dfs1/
subdir_count_per_path=256
tracker_server=192.168.0.15:22122
log_level=info
run_by_group=
run_by_user=
allow_hosts=192.168.0.[1-255]
file_distribute_path_mode=0
file_distribute_rotate_count=100
fsync_after_written_bytes=0
sync_log_buff_interval=10
sync_binlog_buff_interval=60
check_file_duplicate=0
key_namespace=FastDFS
keep_alive=0

 

2)启动脚本
vi /usr/local/bin/start.sh
#!/bin/sh
/usr/local/bin/fdfs_storaged  /usr/local/config/storage.conf

 

3)重启命令
/usr/local/bin/restart.sh  /usr/local/bin/fdfs_storaged /usr/local/config/storage.conf

 

4)监控脚本(只能用于storage)
/usr/local/bin/fdfs_monitor /usr/local/config/storage.conf

更换storage的IP后,需要删除以前的IP信息,使用fdfs_monitor命令:
/usr/local/bin/fdfs_monitor <config_file> [list|delete <group_name> [storage_ip]]

 

完成!

相关日志:

5 Responses to “FastDFS分布式文件系统安装配置详解”

  1. ppg Says:

    fastdfs看起来很复杂似的,不过暂没机会用到呢


  2. What is the best linux os ? Says:

    {Hey|Hi|Definitely|Heya|Hello}…

    What a great article I’ll follow up from now on…


  3. Cubs jersey Says:

    Thank you for sharing with us,I like it very much.


  4. best ftp server for centos Says:

    best ftp server 64 bit…

    FastDFS分布式文件系统安装配置详解 | 高进波博客 – 零起点一步配置你的linux服务器,linux博客,linux教程,web架构…


  5. Average Girls Says:

    Related……

    [...]just beneath, are numerous totally not related sites to ours, however, they are surely worth going over[...]……


留下您的脚印