fastdfs单主机配置多个storage

disabled=false
group_name=group1
bind_addr=172.1.1.1
client_bind=true
port=23000
connect_timeout=30
network_timeout=60
heart_beat_interval=30
stat_report_interval=60
base_path=/data/fastdfs
max_connections=256
buff_size = 256KB
accept_threads=1
work_threads=4
disk_rw_separated = true
disk_reader_threads = 1
disk_writer_threads = 1
sync_wait_msec=50
sync_interval=0
sync_start_time=00:00
sync_end_time=23:59
write_mark_file_freq=500
store_path_count=1
store_path0=/data/fastdfs
subdir_count_per_path=256
tracker_server=172.1.1.2:22122
log_level=info
run_by_group=
run_by_user=
allow_hosts=*
file_distribute_path_mode=0
file_distribute_rotate_count=100
fsync_after_written_bytes=0
sync_log_buff_interval=10
sync_binlog_buff_interval=10
sync_stat_file_interval=300
thread_stack_size=512KB
upload_priority=10
if_alias_prefix=
check_file_duplicate=0
file_signature_method=hash
key_namespace=FastDFS
keep_alive=0
use_access_log = false
rotate_access_log = false
access_log_rotate_time=00:00
rotate_error_log = false
error_log_rotate_time=00:00
rotate_access_log_size = 0
rotate_error_log_size = 0
log_file_keep_days = 0
file_sync_skip_invalid_record=false
use_connection_pool = false
connection_pool_max_idle_time = 3600
http.domain_name=
http.server_port=8888
disabled=false
group_name=groupuser2
bind_addr=172.1.1.1
client_bind=true
port=23001
connect_timeout=30
network_timeout=60
heart_beat_interval=30
stat_report_interval=60
base_path=/data/groupuser2
max_connections=256
buff_size = 256KB
accept_threads=1
work_threads=4
disk_rw_separated = true
disk_reader_threads = 1
disk_writer_threads = 1
sync_wait_msec=50
sync_interval=0
sync_start_time=00:00
sync_end_time=23:59
write_mark_file_freq=500
store_path_count=1
store_path0=/data/groupuser2
subdir_count_per_path=256
tracker_server=172.1.1.2:22122
log_level=info
run_by_group=
run_by_user=
allow_hosts=*
file_distribute_path_mode=0
file_distribute_rotate_count=100
fsync_after_written_bytes=0
sync_log_buff_interval=10
sync_binlog_buff_interval=10
sync_stat_file_interval=300
thread_stack_size=512KB
upload_priority=10
if_alias_prefix=
check_file_duplicate=0
file_signature_method=hash
key_namespace=FastDFS
keep_alive=0
use_access_log = false
rotate_access_log = false
access_log_rotate_time=00:00
rotate_error_log = false
error_log_rotate_time=00:00
rotate_access_log_size = 0
rotate_error_log_size = 0
log_file_keep_days = 0
file_sync_skip_invalid_record=false
use_connection_pool = false
connection_pool_max_idle_time = 3600
http.domain_name=
http.server_port=8889
cat config
ngx_addon_name=ngx_http_fastdfs_module
HTTP_MODULES="$HTTP_MODULES ngx_http_fastdfs_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_fastdfs_module.c"
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
CORE_LIBS="$CORE_LIBS -L/usr/local/lib -lfastcommon -lfdfsclient"
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE=‘256*1024‘ -DFDFS_MOD_CONF_FILENAME=‘\"/etc/fdfs/mod_fastdfs.conf\"‘"
cat mod_fastdfs.conf
#include http.conf
connect_timeout=2
network_timeout=30
storage_sync_file_max_delay = 86400
tracker_server=172.1.1.2:22122
load_fdfs_parameters_from_tracker=true
log_level=info
log_filename=/var/log/tengine/mod.log
url_have_group_name=true
response_mode=redirect
if_alias_prefix=
flv_support = true
flv_extension = flv
group_count = 5
[group1]
group_name=group1
storage_server_port=172.1.1.1:23000
store_path_count=1
store_path0=/data/fastdfs
base_path=/data/fastdfs
[group2]
group_name=groupuser2
storage_server_port=172.1.1.1:23001
store_path_count=1
store_path0=/data/groupuser2
base_path=/data/groupuser2
nginx
server {
  listen 8080;
  server_name 172.1.1.1;
  access_log      /var/log/tengine/test_access.log;
  error_log       /var/log/tengine/test_error.log;
  location /lua {
     default_type ‘text/plain‘;
     content_by_lua ‘ngx.say("hello,lua")‘;
     }
  location ~* /group1/M00/  {
      ngx_fastdfs_module;
      set $needCreateImg 0;
      if ( !-f $request_filename) {
         set $needCreateImg "${needCreateImg}1";
      }

     if ($uri ~* "/group1/M00/(\d+)/(\d+)/([A-Za-z0-9_-]+).(gif|jpg|jpeg|png).(\d+x\d+).(gif|jpg|jpeg|png)") {
         set $needCreateImg "${needCreateImg}2";
         set $conUri     "/$1/$2/$3.$4.$5.$6";
      }

      if ($needCreateImg = "012") {
         set $image_root "/data/fastdfs/data";
         set $file "$image_root$conUri";
            rewrite_by_lua ‘
               local index = string.find(ngx.var.conUri, "([0-9]+)x([0-9]+)");
               local originalUri = string.sub(ngx.var.conUri, 0, index-2);
               local area = string.sub(ngx.var.conUri, index);
               index = string.find(area, "([.])");
               area = string.sub(area, 0, index-1);

               function table.contains(table, element)
                 for _, value in pairs(table) do                 
                   if value == element then
                     return true
                   end
                  end
                  return false
                end

                local c = "/usr/local/graphicsmagick/bin/gm convert " .. ngx.var.image_root ..  originalUri  .. " -thumbnail " .. area .. " - ";
                local f = assert(io.popen(c, "r"))
                local s = assert(f:read("*a"))
                f:close()
                ngx.say(s) ‘;
              }
           alias /data/fastdfs/data/;
        }
}

再搞个8081就行了。

访问400的错误

http://bbs.chinaunix.net/thread-4120027-1-1.html

时间: 2024-08-30 18:25:30

fastdfs单主机配置多个storage的相关文章

fastdfs单主机配置多个storage 第二版

关于FastDFS蛋疼的集群和负载均衡(八)之总结FastDFS cmazxiaoma 问题11.是配置/root/soft/fastdfs-nginx-module/src/mod_fastdfs.conf 还是/etc/fdfs/mod_fastdfs.conf下面的? 2.多个组,必须以group1,group2命名 3.尤其storage的nginx启动一定要看启动日志,最多的配置问题会出现在这里 fdfs注意事项 附录: 在整个环境搭建过程中遇到一些问题,在此提交分享,供大家参考. 1

FastDFS安装、配置、部署(三)-storage配置详解

1.基本配置 # is this config file disabled # false for enabled # true for disabled disabled=false # the name of the group this storage server belongs to group_name=group1 # bind an address of this host # empty for bind all addresses of this host bind_addr

ubuntu 主机配置相关命令

使用ubuntu系统这么久了,但还主要是停留在简单的使用上,好多关于系统设置方面的命令平时用的少,看书的时候一晃而过,也就忘记了,到用的时候又要去找,很麻烦,今天开始就在这记录平时遇到问题需要解决时查找的一些命令,也方便以后的回忆和查阅. ubuntu下查看电脑的配置: lshw -short H/W path       Device  Class          Description=================================================    

FastDFS安装和配置,整合Nginx-1.13.3

目录: 一:下载FastDFS  二:安装FastDFS 三:配置 四:整合Nginx和FastDFS FastDFS is an open source high performance distributed file system (DFS). It's major functions include: file storing, file syncing and file accessing, and design for high capacity and load balance.

FastDFS介绍和配置过程

由于网站使用nfs共享方式保存用户上传的图片,附件等资料,然后通过apache下载的方式供用户访问,在网站架构初期,使用这种简单的方式实现了静态资源的读写分离,但随着网站数据量的增加,图片服务器渐渐成为整个网站的短板,缘次催生了使用fastfds的想法,故而先进行一番简单的测试!在开始之前还是先来看看fastfds的介绍信息: FastDFS is an open source high performance distributed file system (DFS). It's major

FastDFS的安装配置(2)

FastDFS的安装配置 环境介绍:centos6.8 1.下载源码包(github站点) fastdfs-master.zip  # 依赖 libfastcommon-master libfastcommon-master.zip 2.编译安装 (a)首先安装 libfastcommon-master # unzip libfastcommon-master.zip # cd libfastcommon-master/ # cat INSTALL # ./make.sh       --> 确

FastDFS安装、配置、API使用(一)-安装和部署

FastDFS是一个开源的,高性能的的分布式文件系统,他主要的功能包括:文件存储,同步和访问,设计基于高可用和负载均衡,FastDFS非常适用于基于文件服务的站点,例如图片分享和视频分享网站 FastDFS有两个角色:跟踪服务(tracker)和存储服务(storage),跟踪服务控制,调度文件以负载均衡的方式访问:存储服务包括:文件存储,文件同步,提供文件访问接口,同时以key value的方式管理文件的元数据 跟踪和存储服务可以由1台或者多台服务器组成,同时可以动态的添加,删除跟踪和存储服务

分布式文件系统FastDFS介绍和配置过程

http://ylw6006.blog.51cto.com/470441/948729/ 由于网站使用nfs共享方式保存用户上传的图片,附件等资料,然后通过apache下载的方式供用户访问,在网站架构初期,使用这种简单的方式实现了静态资源的读写分离,但随着网站数据量的增加,图片服务器渐渐成为整个网站的短板,缘次催生了使用fastfds的想法,故而先进行一番简单的测试!在开始之前还是先来看看fastfds的介绍信息: FastDFS is an open source high performan

FastDFS安装、配置、部署(二)-Tracker配置详解

1.基本配置 # is this config file disabled # false for enabled # true for disabled disabled=false # bind an address of this host # empty for bind all addresses of this host bind_addr=10.16.123.132 # the tracker server pfort port=22122 # connect timeout in