fastdfs节点扩容

 在巡检时发现,fastdfs 容量使用量比较大,原先规划的是1T,经过半年的运行已使用500G左右,并且按照每月100G左右
的量再增加。
fastdfs本身是分布式文件系统,扩容的方式有 添加storage磁盘 与 添加 group, 通过综合对比 添加storage磁盘在操作上比
较方便。
1、申请在主机上挂载1T磁盘,并做相应的初始化动作,挂载磁盘
2、修改相关配置
# 查看新增的磁盘
fdisk -l
# 格式化
mkfs.xfs /dev/sdb
# 添加自动挂载
vi /etc/fstab
# 挂载
mount -a

2、修改相关配置
# 查看新增的磁盘
fdisk -l
# 格式化
mkfs.xfs /dev/sdb
# 添加自动挂载
vi /etc/fstab
# 挂载
mount -a
/etc/fdfs/tracker.conf Collapse source
vim /etc/fdfs/tracker.conf
修改其中的 store_path=2 ; 0代表轮询,2代表负载均衡、优先磁盘空闲大的
# which path(means disk or mount point) of the storage server to upload file
# 0: round robin
# 2: load balance, select the max free space path to upload file
store_path=2
storage配置Collapse source
vim /etc/fdfs/storage.conf
修改store_path_count=2 ; 代表有2个存储store
在store_path0 下添加store_path1
# 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=/export/server/fastdfs/storage
store_path1=/fdfs_store_1
mod Collapse source
vim /etc/fdfs/mod_fastdfs.conf
添加 store_path_count=2
在 store_path0 下添加 store_path1
# store_path#, based 0, if store_path0 not exists, it's value is base_path
# the paths must be exist
# must same as storage.conf
store_path0=/export/server/fastdfs/storage
store_path1=/fdfs_store_1
url_have_group_name = true
#store_path1=/home/yuqing/fastdfs1
store_path_count=2

3、重启服务
systemctl restart fdfs_trackerd fdfs_storaged
4、验证服务
fdfs_monitor /etc/fdfs/storage.conf
查看total storage 是否增加, store_path_count是否为2
5、验证上传及同步
fdfs_upload_file /etc/fdfs/client.conf 1.jpg
查看相应的文件夹内是否存在该文件/fdfs_store_1/data/53/A4/AlIQFmAIGheAKEM0AAAABJUN3iw867.jpg
6、修改nginx配置并验证
location ~/group1/M0[0-9] {
ngx_fastdfs_module;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

陈苏漾

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值