FDFS硬盘扩容:两种扩容模式

1.扩容模式

文件服务器扩容有两种模式nginx

方案1、新增文件服务器,改文件服务器使用group服务器

方案2、使用现有文件服务器,新挂在磁盘ide

---------------------------------------------------------spa

2.新增文件服务器扩容

参考Fdfs安装手册安装配置,惟一区别是,storage采用新的groupName.net

注意storage.conf配置文件中的orm

group_name=groupNblog

配置一个没有占用的名称!!!文档

 

3.挂在磁盘扩容

步骤1挂在新的磁盘或存储到文件服务器根目录,取名/data01(原来是data00,若原来已经有多块磁盘,累加)it

步骤2修改storage.conf配置文件io

 

vi   /etc/fdfs/storage.conf

 

修改该配置中以下内容

store_path_count=1

store_path0=/data00

store_path_count=2

store_path0=/data00

store_path1=/data01

说明:若是此前已经挂了多块磁盘,这里累加,再也不赘述。

 

步骤3:修改vi /etc/fdfs/mod_fastdfs.conf配置文件

vi   /etc/fdfs/mod_fastdfs.conf

 

修改该配置中以下内容

store_path_count=1

store_path0=/data00

 

store_path_count=2

store_path0=/data00

store_path1=/data01

说明:若是此前已经挂了多块磁盘,这里累加,再也不赘述。

步骤4重启storage

ps   –fe|grep storage

kill -9  pid

/usr/bin/fdfs_storaged   /etc/fdfs/storage.conf

#若是是fdfs4.0.5版本,执行以下

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

查看路径/data00下面,是否已经生成了若干文件目录,文件名为

00 01 02 03 04 05 ….

 

步骤5使用fdfs_monitor查看文件系统状态,着重看group是否新增了磁盘空间

/usr/bin/fdfs_monitor   /etc/fdfs/storage.conf

#若是是fdfs4.0.5版本,执行以下

/usr/local/bin/fdfs_monitor   /etc/fdfs/storage.conf

 

查看

total storage

free storage

store_path_count

等项目,看看是否按照指望增长了磁盘空间

 

步骤6修改nginx.conf

在配置

location  /group1/M00 {

            root /data00/data;

            ngx_fastdfs_module;

        }

 

 

后增长

location  /group1/M01 {

            root /data01/data;

            ngx_fastdfs_module;

        }

 

注意,这里是增长一组配置,不是修改。


步骤7重启nginx

/home/nginx/nginx/sbin/nginx   –s stop

/home/nginx/nginx/sbin/nginx


可供参考的文档

http://blog.csdn.net/newjueqi/article/details/48049575 

相关文章
相关标签/搜索