My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Setup  

Setup

#step 1. download FastDFS source package and unpack it
tar xzf FastDFS_v1.x.tar.gz
#for example:
tar xzf FastDFS_v1.11.tar.gz

#step 2. enter the FastDFS dir
cd FastDFS

#step 3. make all
./make.sh

#step 4. make install
./make.sh install

#step 5. edit/modify the config file of tracker and storage

#step 6. run server programs
#start the tracker server:
/usr/local/bin/fdfs_trackerd <tracker_conf_filename>

#start the storage server:
/usr/local/bin/fdfs_storaged <storage_conf_filename>

#step 7. run test program
#run the client test program:
/usr/local/bin/fdfs_test <storage_conf_filename> <operation>
#for example, upload a file:
/usr/local/bin/fdfs_test conf/storage.conf upload /usr/include/stdlib.h 

#step 8. run monitor program
#run the monitor program:
/usr/local/bin/fdfs_monitor <storage_conf_filename>

Config

tracker server config file sample

disabled=false
bind_addr=
port=22122
network_timeout=20
base_path=/home/yuqing/FastDFS
max_connections=256

#0: round robin
#1: specify group
#2: load balance
store_lookup=0

#when store_lookup set to 1(specify group), must set store_group to the group name
store_group=group2

#0: round robin
#1: the first server order by ip address
#recommand use the first server to upload file
store_server=1

#reserved storage space for system or other applications.
#if the free(available) space of any stoarge server in a group <= reserved_storage_space,
#no file can be uploaded to this group.
#bytes unit can be one of follows:
### G or g for gigabyte(GB)
### M or m for megabyte(MB)
### K or k for kilobyte(KB)
### no unit for byte(B)
reserved_storage_space = 4GB

#standard log level as syslog, case insensitive, value list:
### emerg for emergency
### alert
### crit for critical
### error
### warn for warning
### notice
### info
### debug
log_level=info

#unix group name to run this program,
#not set (empty) means run by the group of current user
run_by_group=

#unix username to run this program,
#not set (empty) means run by current user
run_by_user=

# allow_hosts can ocur more than once, host can be hostname or ip address,
# "*" means match all ip addresses, can use range like this: 10.0.1.[1-15,20] or
# host[01-08,20-25].domain.com, for example:
# allow_hosts=10.0.1.[1-15,20]
# allow_hosts=host[01-08,20-25].domain.com
allow_hosts=*

storage server config file sample:

disabled=false
group_name=group1
bind_addr=
port=23000
network_timeout=20
heart_beat_interval=30
stat_report_interval=600
base_path=/home/yuqing/FastDFS
sync_wait_msec=200
max_connections=256

tracker_server=10.62.164.83:22122
tracker_server=10.62.164.84:22122

#standard log level as syslog, case insensitive, value list:
### emerg for emergency
### alert
### crit for critical
### error
### warn for warning
### notice
### info
### debug
log_level=info

#unix group name to run this program,
#not set (empty) means run by the group of current user
run_by_group=

#unix username to run this program,
#not set (empty) means run by current user
run_by_user=

# allow_hosts can ocur more than once, host can be hostname or ip address,
# "*" means match all ip addresses, can use range like this: 10.0.1.[1-15,20] or
# host[01-08,20-25].domain.com, for example:
# allow_hosts=10.0.1.[1-15,20]
# allow_hosts=host[01-08,20-25].domain.com
allow_hosts=*

Item detail

1. common items

item name type default Must
base_path string Y
disabled boolean false N
bind_addr string N
network_timeout int 30(s) N
max_connections int 256 N
log_level string info N
run_by_group string N
run_by_user string N
allow_hosts string * N

memo

  • base_path is the base path of sub dirs: data and logs.
  • base_path must exist and it's sub dirs will be automatically created if not exist.
    • $base_path/data: store data files
    • $base_path/logs: store log files

2. tracker server items

item name type default Must
port int 22000 N
store_lookup int 0 N
store_group string N
store_server int 1 N
reserved_storage_space string 1GB N

memo

  • the value of store_lookup is:
    • 0: round robin (default)
    • 1: specify group
    • 2: load balance (supported since V1.1)
  • store_group is the name of group to store files. when store_lookup set to 1(specify group), store_group must be set to a specified group name.
  • reserved_storage_space is the reserved storage space for system or other applications. if the free(available) space of any stoarge server in a group <= reserved_storage_space, no file can be uploaded to this group (since V1.1). bytes unit can be one of follows:
    • G or g for gigabyte(GB)
    • M or m for megabyte(MB)
    • K or k for kilobyte(KB)
    • no unit for byte(B)
    for example: 4GB or 4G

3. storage server items

item name type default Must
group_name string Y
tracker_server string Y
port int 23000 N
heart_beat_interval int 30(s) N
stat_report_interval int 300(s) N
sync_wait_msec int 100(ms) N

memo

  • tracker_server can ocur more than once, and tracker_server format is "host:port", host can be hostname or ip address.
Comment by wangsh...@gmail.com, Jan 28, 2009

I want to join in this project and join in fastdht. Thanks alot.

Comment by songfu.zhang, Apr 3, 2009

为什么不加入一个数据库来管理索引文件记录呢? 这样在文件系统去查看很累人的.

Comment by songfu.zhang, Apr 3, 2009

不过没有了数据库也可以节省对于这个系统性能. 不过我第一次看时感觉没有一个对文件系统索引记录感觉很不太好,后来安装好以后发现是记录一个日志文件.如果这个文件很海量时,这个日志查找起来感觉就比较慢慢. 我最近也开发一个分布存储系统名字叫pndfs,用python开发的

Comment by songfu.zhang, Apr 3, 2009

系统必要组件:mogilefs,python2.5,Twisied,MySQL-python,zope.interface-3.3.0,Twisted最近打算在发布当中了.在大家可能交流一把.

Comment by beyond19...@gmail.com, Mar 20, 2010

我想问下那个日志文件是系统瓶颈吗?

Comment by BM888...@gmail.com, May 11, 2010

关于group的概念不太明白,能否解释一下。 不同的storage server指定相同的group和不同的group有什么区别 怎么定义和规划group会更合理,参考什么设计原则

Comment by hda...@gmail.com, Dec 17, 2010

我的storage采用php+nginx,在进行http远程上传文件的时候总是报http500错误 已经确认开启了http功能啊,这是为什么呢?

Comment by mym198...@vip.qq.com, Oct 26, 2011

我不知道每台服务是如何关联的!


Sign in to add a comment
Powered by Google Project Hosting