Chinaunix首页 | 论坛 | 博客
  • 博客访问: 528609
  • 博文数量: 81
  • 博客积分: 8020
  • 博客等级: 中将
  • 技术积分: 1085
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-08 10:36
文章分类

全部博文(81)

文章存档

2010年(3)

2009年(25)

2008年(53)

我的朋友

分类: 服务器与存储

2008-10-27 14:50:22

系统:Gentoo-linux
Tracker Server:10.60.0.110 10.60.0.242
Storage Server:10.60.0.112 10.60.0.233 10.60.0.241

根据源代码中的INSTALL,FastDFS的安装非常简单。
1、安装
#wget
#tar zxf FastDFS_v1.11.tar.gz
#cd FastDFS
#./make.sh
#mkdir /usr/local/include
#./make.sh install

2、配置文件
2.1 Tracker Server
#cat /etc/conf.d/FastDFS_tracker.conf

###start of tracker server config###
disabled=false
bind_addr=
port=22122
network_timeout=20
base_path=/ms/var/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=group1

#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=*
###end of tracker server config###
2.2 Storage Server
相同group的配置文件内容要一样
#cat /etc/conf.d/FastDFS_storage.conf
###start of storage server config###
disabled=false
group_name=group1
bind_addr=
port=23000
network_timeout=20
heart_beat_interval=30
stat_report_interval=600
base_path=/ms/var/FastDFS
sync_wait_msec=200
max_connections=256

tracker_server=10.60.0.110:22122
tracker_server=10.60.0.242: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=*
###end of storage server config###

3、启动
首先在Tracker Server和Storage Server上建立目录/ms/var/FastDFS
3.1 Tracker Server 启动
在10.60.0.110和10.60.0.242启动Tracker进程:
#/usr/local/bin/fdfs_trackerd /etc/conf.d/FastDFS_tracker.conf
3.2 Storage Server 启动
在10.60.0.112,10.60.0.233和10.60.0.241上启动storage进程:
#/usr/local/bin/fdfs_trackerd /etc/conf.d/FastDFS_storage.conf

4、测试
在一台Storage Server上运行
#/usr/local/bin/fdfs_test /etc/conf.d/FastDFS_storage.conf upload needed_upload_filename



阅读(3394) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~