ITPub博客

首页 > 应用开发 > Java > fastdfs扩容

fastdfs扩容

原创 Java 作者:宸201603 时间:2016-09-27 13:44:01 0 删除 编辑
group1满了,增加group2
建议设置的时候,把tracker.conf中的reserved_storage_space调大点,比如10%,如果监控到满了,可以减少这个参数,比如改成2%暂时先顶一顶

一、服务配置
上传服务(tracker)
x.x.27.101
x.x.27.104

fastdfs group1(storage)
x.x.27.99
x.x.27.100

fastdfs group2(storage)
x.x.27.26

storage
/etc/fdfs/
------storage.conf
------http.conf
------mime.types
------mod_fastdfs.conf

tracker
/etc/fdfs/
------tracker.conf
------client.conf
------storage_ids.conf

二、27.26相关软件的安装步骤
0、安装相关依赖
yum install libevent gd-devel libcurl-devel
1、安装libfastcommon.tar.gz
1)make.sh clean
2)make.sh
3)make.sh install
2、安装FastDFS_v5.04.tar.gz
1)make.sh clean
2)make.sh
3)make.sh install
3、安装ngx_openresty-1.9.3.2
1)解压ngx_openresty-1.9.3.2
2)解压fastdfs-nginx-module到ngx_openresty-1.9.3.2目录下
3)将fastdfs-nginx-module/src/*拷贝到fastdfs-nginx-module下
4)编辑fastdfs-nginx-module/config文件,替换目录CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
5)./configure --with-luajit --add-module=./fastdfs-nginx-module
6)gmake & gmake install

三、配置
1)nginx.conf(27.26)
location /group2/M00 {
    alias /home/fastdfs/storage/data;
    ngx_fastdfs_module;
}

2)storage.conf(27.26)
tracker_server=x.x.27.101:22122
tracker_server=x.x.27.104:22122

3)mod_fastdfs.conf(27.26)
tracker_server=x.x.27.101:22122
tracker_server=x.x.27.104:22122

4)tracker.conf(27.101和27.104)
# the method of selecting group to upload files
# 0: round robin
# 1: specify group
# 2: load balance, select the max free space group to upload file
store_lookup=1

# which group to upload file
# when store_lookup set to 1, must set store_group to the group name
store_group=group2

四、上传命令
/usr/bin/fdfs_upload_file /etc/fdfs/client.conf $1

五、管理命令
--重启
/usr/bin/restart.sh /usr/bin/fdfs_storaged /etc/fdfs/storage.conf
/usr/bin/restart.sh /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf

--停止
/usr/bin/stop.sh /usr/bin/fdfs_storaged /etc/fdfs/storage.conf
/usr/bin/stop.sh /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf

--启动
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf

--查看日志
tail -f -n 100 /home/fastdfs/storage/logs/storaged.log 
tail -f -n 100 /home/fastdfs/tracker/logs/trackerd.log 

--监控
/usr/bin/fdfs_monitor /etc/fdfs/storage.conf

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30980622/viewspace-2125639/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2016-03-05

  • 博文量
    5
  • 访问量
    14478