美文网首页
FastDFS增加磁盘

FastDFS增加磁盘

作者: joy_蓝蜘蛛 | 来源:发表于2022-02-21 16:10 被阅读0次

    1:参考:挂载磁盘 https://www.jianshu.com/p/6e756d94eb9d
    2:参考:FastDfs加载磁盘:https://www.cnblogs.com/lee2guang/p/12658197.html

    步骤一:云服务器购买的磁盘挂载上

    参考上面推荐 挂载磁盘

    步骤二:修改storage配制

    路径:vi /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
    

    步骤三:修改mod_fastdfs配制

    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
    

    步骤四:重启tracker、storage

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

    或者

    killall /usr/bin/fdfs_trackerd 
    killall /usr/bin/fdfs_storaged
    /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
    /usr/bin/fdfs_storaged /etc/fdfs/storage.conf
    

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

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

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

    步骤6:修改nginx访问配制

    这里做为参考,主要还是要跟据本自的nginx配制修改。关键点就是M00 加磁盘后会增加 M01

    location  /group1/M00 {
                root /data00/data;
                ngx_fastdfs_module;
            }
    

    后增加

    location  /group1/M01 {
                root /data01/data;
                ngx_fastdfs_module;
            }
    

    步骤7:重新nginx

    找到nginx 执行 nginx -s reload
    安服务可以: systemctl restart nginx

    相关文章

      网友评论

          本文标题:FastDFS增加磁盘

          本文链接:https://www.haomeiwen.com/subject/zhrilrtx.html