Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7404203
  • 博文数量: 1756
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16232
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1756)

文章存档

2024年(2)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2009-09-28 14:18:55

software:FasDFS.1.12
OS:ubuntu server 7.10
测试机器
NAS1:192.168.1.2
NAS2:192.168.1.3
 
分别在NAS1,NAS2  上安装 FastDFS.1.12
1.tar zxvf   FastDFS.1.12.tar.gz
cd  FastDFS.1.12
./make.sh
./make.sh install
cp conf/storage.conf  conf/tracker.conf  /etc
 
2.修改配置文件 (NAS1)
vim /etc/tracker.conf
 
disabled=false
bind_addr=192.168.1.2      #绑定IP本机IP地址
port=22122                           #监听端口
network_timeout=30           #超时退出
base_path=/home/yangzi  #存储目录
max_connections=256         #连接大小这个我测试过跟你的内存有关系,不然启动失败,我的是虚拟机,内存给的是256,所以最大我写的256
#0: round robin
#1: specify group
#2: load balance
store_lookup=1                   #我选定的是 指定组其他的我没有做测试
#when store_lookup set to 1, must set store_group to the group name
store_group=group1      #组别
#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 = 1MB
#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=root
#unix username to run this program,
#not set (empty) means run by current user
run_by_user=root
# 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=*
修改好后保存退出~
 
3.修改配置文件 (NAS1)
vim /etc/storage.conf
 
disabled=false
group_name=group1                     #组别对应tracker.conf
bind_addr=192.168.1.2                   #绑定本机IP
port=23000                                       #监听端口
network_timeout=20                     
heart_beat_interval=30                 
stat_report_interval=60
base_path=/home/yangzi             #数据存储目录
sync_wait_msec=200                    #数据同步等待时间
max_connections=256                   #连接大小这个我测试过跟你的内存有关系,不然启动失败,我的是虚拟机,内存给的是256,所以最大我写的256
# tracker_server can ocur more than once, and tracker_server format is
#  "host:port", host can be hostname or ip address
#tracker_server=10.62.164.84:22122
tracker_server=192.168.1.2: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=root
#unix username to run this program,
#not set (empty) means run by current user
run_by_user=root
# 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=*
 修改完后保存退出
 
4.修改配置文件 (NAS2)
vim /etc/storage.conf
 
disabled=false
group_name=group1
bind_addr=192.168.1.3                  #注意这里是绑定本机IP
port=23000
network_timeout=20
heart_beat_interval=30
stat_report_interval=60
base_path=/home/yangzi
sync_wait_msec=200
max_connections=256
tracker_server=192.168.1.2:22122   #这里是NAS1的IP 因为NAS1开启的tarcker服务~
log_level=info
run_by_group=root
run_by_user=root
allow_hosts=*
 
5.写启动脚本~(NAS1)
#!/bin/bash
case "$1" in
start)
echo -n "Staring to write your FDFS:..."
/usr/local/bin/fdfs_trackerd /etctracker.conf
/usr/local/bin/fdfs_storaged /etc/storage.conf
echo "Ok"
;;
stop)
echo -n "Cleaning your FDFS:..."
ps -efww |grep fdfs |grep -v grep|cut -c 9-15|xargs kill -9
echo "Ok"
;;
restart)
echo -n "Cleaning your FDFS:..."
ps -efww |grep fdfs |grep -v grep|cut -c 9-15|xargs kill -9
echo "Ok"
echo -n "Staring to write your FDFS:..."
/usr/loca/bin/fdfs_trackerd /etc/tracker.conf
/usr/loca/bin/fdfs_storaged /etc/storage.conf
echo "Ok"
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
6.启动脚本~(NAS2)
#!/bin/bash
case "$1" in
start)
echo -n "Staring to write your FDFS:..."
/usr/local/bin/fdfs_storaged  /etc/storage.conf
echo "Ok"
;;
stop)
echo -n "Cleaning your FDFS:..."
ps -efww |grep fdfs |grep -v grep|cut -c 9-15|xargs kill -9
echo "Ok"
;;
restart)
echo -n "Cleaning your FDFS:..."
ps -efww |grep fdfs |grep -v grep|cut -c 9-15|xargs kill -9
echo "Ok"
echo -n "Staring to write your FDFS:..."
/usr/loca/bin/fdfs_storaged  /etc/storage.conf
echo "Ok"
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
8.启动NAS1,NAS2. FastDFS
NAS1    # /etc/init.d/fdfs start
Staring to write your Iptbales:...Ok
#netstat -ant
tcp        0      0 192.168.1.2:22122     0.0.0.0:*               LISTEN
tcp        0      0 192.168.1.2:23000     0.0.0.0:*               LISTEN
tcp        0      0 192.168.1.2:22122     192.168.1.2:55075     ESTABLISHED
tcp        0      0 192.168.1.2:55075     192.168.1.2:22122     ESTABLISHED
说明启动成功`
 
NAS2    /etc/init.d/fdfs start
tcp        0      0 192.168.1.3:23000     0.0.0.0:*               LISTEN
tcp        0      0 192.168.1.3:33112     192.168.1.3:22122     ESTABLISHED
tcp        0      0 192.168.1.3:50542     192.168.1.3:23000     ESTABLISHED
说明NAS2 启动成功~
9.测试~ NAS1
/usr/local/bin/fdfs_test /etc/storage.conf upload /root/1234
This is FastDFS client test program v1.11
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page
for more detail.
group_name=group1, ip_addr=192.168.1.2, port=23000
group_name=group1, remote_filename=52/65/SSEDyAAAEzh0SnYu
file timestamp=1226900424
file size=4920
10.测试~NAS2
#/usr/local/bin/fdfs_test /root/FastDFS/conf/storage.conf upload /root/1234
This is FastDFS client test program v1.11
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page
for more detail.
group_name=group1, ip_addr=192.168.1.2, port=23000
group_name=group1, remote_filename=10/91/SSEEQwAAAABqgkr1
file timestamp=1226900547
file size=0
具体怎么应用到生产环境里,大家可以看看他官方客户端软件~有时间在写一下我是怎么用PHP客户端用在生产环境的,现在时间不多~先写这么多~
software:FasDFS.1.12
OS:ubuntu server 7.10
测试机器
NAS1:192.168.1.2
NAS2:192.168.1.3
 
分别在NAS1,NAS2  上安装 FastDFS.1.12
1.tar zxvf   FastDFS.1.12.tar.gz
cd  FastDFS.1.12
./make.sh
./make.sh install
cp conf/storage.conf  conf/tracker.conf  /etc
 
2.修改配置文件 (NAS1)
vim /etc/tracker.conf
 
disabled=false
bind_addr=192.168.1.2      #绑定IP本机IP地址
port=22122                           #监听端口
network_timeout=30           #超时退出
base_path=/home/yangzi  #存储目录
max_connections=256         #连接大小这个我测试过跟你的内存有关系,不然启动失败,我的是虚拟机,内存给的是256,所以最大我写的256
#0: round robin
#1: specify group
#2: load balance
store_lookup=1                   #我选定的是 指定组其他的我没有做测试
#when store_lookup set to 1, must set store_group to the group name
store_group=group1      #组别
#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 = 1MB
#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=root
#unix username to run this program,
#not set (empty) means run by current user
run_by_user=root
# 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=*
修改好后保存退出~
 
3.修改配置文件 (NAS1)
vim /etc/storage.conf
 
disabled=false
group_name=group1                     #组别对应tracker.conf
bind_addr=192.168.1.2                   #绑定本机IP
port=23000                                       #监听端口
network_timeout=20                     
heart_beat_interval=30                 
stat_report_interval=60
base_path=/home/yangzi             #数据存储目录
sync_wait_msec=200                    #数据同步等待时间
max_connections=256                   #连接大小这个我测试过跟你的内存有关系,不然启动失败,我的是虚拟机,内存给的是256,所以最大我写的256
# tracker_server can ocur more than once, and tracker_server format is
#  "host:port", host can be hostname or ip address
#tracker_server=10.62.164.84:22122
tracker_server=192.168.1.2: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=root
#unix username to run this program,
#not set (empty) means run by current user
run_by_user=root
# 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=*
 修改完后保存退出
 
4.修改配置文件 (NAS2)
vim /etc/storage.conf
 
disabled=false
group_name=group1
bind_addr=192.168.1.3                  #注意这里是绑定本机IP
port=23000
network_timeout=20
heart_beat_interval=30
stat_report_interval=60
base_path=/home/yangzi
sync_wait_msec=200
max_connections=256
tracker_server=192.168.1.2:22122   #这里是NAS1的IP 因为NAS1开启的tarcker服务~
log_level=info
run_by_group=root
run_by_user=root
allow_hosts=*
 
5.写启动脚本~(NAS1)
#!/bin/bash
case "$1" in
start)
echo -n "Staring to write your FDFS:..."
/usr/local/bin/fdfs_trackerd /etctracker.conf
/usr/local/bin/fdfs_storaged /etc/storage.conf
echo "Ok"
;;
stop)
echo -n "Cleaning your FDFS:..."
ps -efww |grep fdfs |grep -v grep|cut -c 9-15|xargs kill -9
echo "Ok"
;;
restart)
echo -n "Cleaning your FDFS:..."
ps -efww |grep fdfs |grep -v grep|cut -c 9-15|xargs kill -9
echo "Ok"
echo -n "Staring to write your FDFS:..."
/usr/loca/bin/fdfs_trackerd /etc/tracker.conf
/usr/loca/bin/fdfs_storaged /etc/storage.conf
echo "Ok"
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
6.启动脚本~(NAS2)
#!/bin/bash
case "$1" in
start)
echo -n "Staring to write your FDFS:..."
/usr/local/bin/fdfs_storaged  /etc/storage.conf
echo "Ok"
;;
stop)
echo -n "Cleaning your FDFS:..."
ps -efww |grep fdfs |grep -v grep|cut -c 9-15|xargs kill -9
echo "Ok"
;;
restart)
echo -n "Cleaning your FDFS:..."
ps -efww |grep fdfs |grep -v grep|cut -c 9-15|xargs kill -9
echo "Ok"
echo -n "Staring to write your FDFS:..."
/usr/loca/bin/fdfs_storaged  /etc/storage.conf
echo "Ok"
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
8.启动NAS1,NAS2. FastDFS
NAS1    # /etc/init.d/fdfs start
Staring to write your Iptbales:...Ok
#netstat -ant
tcp        0      0 192.168.1.2:22122     0.0.0.0:*               LISTEN
tcp        0      0 192.168.1.2:23000     0.0.0.0:*               LISTEN
tcp        0      0 192.168.1.2:22122     192.168.1.2:55075     ESTABLISHED
tcp        0      0 192.168.1.2:55075     192.168.1.2:22122     ESTABLISHED
说明启动成功`
 
NAS2    /etc/init.d/fdfs start
tcp        0      0 192.168.1.3:23000     0.0.0.0:*               LISTEN
tcp        0      0 192.168.1.3:33112     192.168.1.3:22122     ESTABLISHED
tcp        0      0 192.168.1.3:50542     192.168.1.3:23000     ESTABLISHED
说明NAS2 启动成功~
9.测试~ NAS1
/usr/local/bin/fdfs_test /etc/storage.conf upload /root/1234
This is FastDFS client test program v1.11
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page
for more detail.
group_name=group1, ip_addr=192.168.1.2, port=23000
group_name=group1, remote_filename=52/65/SSEDyAAAEzh0SnYu
file timestamp=1226900424
file size=4920
10.测试~NAS2
#/usr/local/bin/fdfs_test /root/FastDFS/conf/storage.conf upload /root/1234
This is FastDFS client test program v1.11
Copyright (C) 2008, Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page
for more detail.
group_name=group1, ip_addr=192.168.1.2, port=23000
group_name=group1, remote_filename=10/91/SSEEQwAAAABqgkr1
file timestamp=1226900547
file size=0
具体怎么应用到生产环境里,大家可以看看他官方客户端软件~有时间在写一下我是怎么用PHP客户端用在生产环境的,现在时间不多~先写这么多~
阅读(1527) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~