fastdfs group通过添加硬盘扩容
2015-08-28 13:16
423 查看
通过给group的机器添加硬盘的方式,实现某个group的扩容。
fastdfs在一台服务器支持多个store_path,每个store_path指向一个存储路径。url “M00/3F/E1/oYYBAFXfyuOABOf5AAAHoDwhqE0491.txt”中M00表示使用store_path0,如果没有配置store_path,就使用base_path的路径。
添加了硬盘后,通过把新的store_path指向新硬盘的挂载点,再修改配置文件,就能实现group的扩容。
原来的fdfs的base_path路径为/data/fdfs_store
现在假设添加了一个硬盘,挂载到/data1上,指定/data1/fdfs_store为store_path1
修改/etc/fdfs/storage.conf:
修改/etc/fdfs/mod_fastdfs.conf:
在nginx的配置文件中添加新store_path的路径:
重启服务:
完成后也要重启nginx,这样才能访问新的store_path的文件。
注意,有时候通过fdfs_monitor 发现store_path的配置不生效,这时,必须要删除tracker目录下的两个文件:storage_groups_new.dat,storage_servers_new.dat再重启服务。
【作者】曾健生
【QQ】190678908
【app后端qq群】254659220
【微信公众号】 appbackend
【新浪微博】 @newjueqi
【博客】http://blog.csdn.net/newjueqi
fastdfs在一台服务器支持多个store_path,每个store_path指向一个存储路径。url “M00/3F/E1/oYYBAFXfyuOABOf5AAAHoDwhqE0491.txt”中M00表示使用store_path0,如果没有配置store_path,就使用base_path的路径。
添加了硬盘后,通过把新的store_path指向新硬盘的挂载点,再修改配置文件,就能实现group的扩容。
原来的fdfs的base_path路径为/data/fdfs_store
现在假设添加了一个硬盘,挂载到/data1上,指定/data1/fdfs_store为store_path1
修改/etc/fdfs/storage.conf:
# path(disk or mount point) count, default value is 1 store_path_count=2 # store_path#, based 0, if store_path0 not exists, it's value is base_path # the paths must be exist store_path0=/data/fdfs_store store_path1=/data1/fdfs_store
修改/etc/fdfs/mod_fastdfs.conf:
# path(disk or mount point) count, default value is 1 store_path_count=2 # store_path#, based 0, if store_path0 not exists, it's value is base_path # the paths must be exist store_path0=/data/fdfs_store store_path1=/data1/fdfs_store
在nginx的配置文件中添加新store_path的路径:
location ~* /M01 { root /data1/fdfs_store/data; ngx_fastdfs_module; }
重启服务:
killall fdfs_storaged killall fdfs_trackerd /usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
完成后也要重启nginx,这样才能访问新的store_path的文件。
注意,有时候通过fdfs_monitor 发现store_path的配置不生效,这时,必须要删除tracker目录下的两个文件:storage_groups_new.dat,storage_servers_new.dat再重启服务。
【作者】曾健生
【QQ】190678908
【app后端qq群】254659220
【微信公众号】 appbackend
【新浪微博】 @newjueqi
【博客】http://blog.csdn.net/newjueqi
相关文章推荐
- fastdfs group通过添加硬盘扩容
- 自定义textfield的键盘
- Linux系统 - 源码编译安装Nginx
- 格式化ha 集群namenode报错
- hdu5012 Dice(分治限界法)
- 设计模式---策略模式
- monkeytalk特殊命令
- Universal Image Loader使用文档
- 使用java理解程序逻辑,变量
- Android 使用url获取数据时的文字编码问题
- 时间单位换算
- 滑雪
- 为什么有的程序员极度推崇 Vim 和 Emacs,却对 IDE 嗤之以鼻?
- JAR、WAR、EAR的使用和区别
- yum 安装lamp环境
- otto源码分析
- HDU3639Hawk-and-Chicken (好题,强连通缩点,建图,DFS回溯)
- meta-data in the Android
- SVN (TortioseSVN) 版本控制之忽略路径(如bin、obj、gen)
- SQL SERVER数据库新认识的一些基础知识