FastDFS挂载磁盘扩容

614 阅读1分钟

FastDFS挂载磁盘扩容

步骤1:挂在新的磁盘或存储到文件服务器根目录,取名/mnt/data01

步骤2:修改/etc/fdfs/storage.conf配置文件

修改该配置中如下内容

store_path_count=1

store_path0=/data/fastdfs/storage

store_path_count=2

store_path0=/data/fastdfs/storage

store_path1=/mnt/data01

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

store_path_count=1

store_path0=/data/fastdfs/storage

store_path_count=2

store_path0=/data/fastdfs/storage

store_path1=/mnt/data01

步骤4:重启tracker、storage

注意,步骤1、2、3需要在两个阿里云中同时修改,否则storage无法互为备份,进而导致tracker启动失败,提示如下错误

ERROR - file: tracker_service.c, line: 3550, cmd=84, client ip: 106.15.137.142, package size 32 is not correct, expect length: 16

重启tracker和storage

fdfs_trackerd /etc/fdfs/tracker.conf restart
fdfs_storaged /etc/fdfs/storage.conf restart

也可以先关闭再启动

killall fdfs_trackerd 
​
killall fdfs_storaged
​
fdfs_trackerd /etc/fdfs/tracker.conf
​
fdfs_storaged /etc/fdfs/storage.conf
​

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

查看 total storage free storage store_path_count 等项目,看看是否按照期望增加了磁盘空间。

fdfs_monitor /etc/fdfs/storage.conf

步骤6:修改nginx.conf

在配置location /group1/M00 {

root /data/fastdfs/storage;

ngx_fastdfs_module;

}

后增加location /group1/M01 {

root /mnt/data01;

ngx_fastdfs_module;

}

步骤7:重启nginx

/usr/local/nginx/sbin/nginx -s reload