mod_fastdfs.conf 至于nginx For storage

本文详细介绍了FastDFS配置中关于storage server的重要参数设置,包括如何正确配置多个group、解决端口堵塞问题以及确保进程正常启动等内容。

在fastdfs的配置中,storage往往要带有一个nginx用于加载模块并且访问本地磁盘里面的fastdfs数据.
但是在配置中,如果有两个group,那么对应的storage_server_port一定要设置正确,否则会有问题.

但是在配置mod_fastdfs之后,nginx的端口有堵塞的问题,而且只有一个进程,而不是有3~4个进程,经过排查,原来 有一句最最重要的,狗日的,

# use "#include" directive to include HTTP config file
# NOTE: #include is an include directive, do NOT remove the # before include
#include http.conf

代码如下

connect_timeout=2
network_timeout=30
base_path=/opt/machtalk/fastdfs/data/fastdfs_storage
load_fdfs_parameters_from_tracker=true
storage_sync_file_max_delay = 86400
use_storage_id = false
storage_ids_filename = storage_ids.conf
url_have_group_name = true
store_path_count=1
store_path0=/opt/machtalk/fastdfs/data/fastdfs_storage
log_level=info
log_filename=
response_mode=proxy
if_alias_prefix=
flv_support = true
flv_extension = flv
group_count = 0

storage_server_port=192.168.3.133:23000

group_name=group1

tracker_server=192.168.3.133:22122

tracker_server=192.168.3.134:22122

tracker_server=192.168.3.135:22122
#include http.conf
# connect timeout in seconds
# default value is 30s
connect_timeout=2

# network recv and send timeout in seconds
# default value is 30s
network_timeout=30

# the base path to store log files
base_path=/opt/machtalk/fastdfs/data/fastdfs_storage

# if load FastDFS parameters from tracker server
# since V1.12
# default value is false
load_fdfs_parameters_from_tracker=true

# storage sync file max delay seconds
# same as tracker.conf
# valid only when load_fdfs_parameters_from_tracker is false
# since V1.12
# default value is 86400 seconds (one day)
storage_sync_file_max_delay = 86400

# if use storage ID instead of IP address
# same as tracker.conf
# valid only when load_fdfs_parameters_from_tracker is false
# default value is false
# since V1.13
use_storage_id = false

# specify storage ids filename, can use relative or absolute path
# same as tracker.conf
# valid only when load_fdfs_parameters_from_tracker is false
# since V1.13
storage_ids_filename = storage_ids.conf

# FastDFS tracker_server can ocur more than once, and tracker_server format is
#  "host:port", host can be hostname or ip address
# valid only when load_fdfs_parameters_from_tracker is true

# the port of the local storage server
# the default value is 23000
storage_server_port=tracker1:23000

# the group name of the local storage server
group_name=group1

# if the url / uri including the group name
# set to false when uri like /M00/00/00/xxx
# set to true when uri like ${group_name}/M00/00/00/xxx, such as group1/M00/xxx
# default value is false
url_have_group_name = true

# path(disk or mount point) count, default value is 1
# must same as storage.conf
store_path_count=1

# 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=/opt/machtalk/fastdfs/data/fastdfs_storage
#store_path1=/home/yuqing/fastdfs1

# standard log level as syslog, case insensitive, value list:
### emerg for emergency
### alert
### crit for critical
### error
### warn for warning
### notice
### info
### debug
log_level=info

# set the log filename, such as /usr/local/apache2/logs/mod_fastdfs.log
# empty for output to stderr (apache and nginx error_log file)
log_filename=

# response mode when the file not exist in the local file system
## proxy: get the content from other storage server, then send to client
## redirect: redirect to the original storage server (HTTP Header is Location)
response_mode=proxy

# the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a
# multi aliases split by comma. empty value means auto set by OS type
# this paramter used to get all ip address of the local host
# default values is empty
if_alias_prefix=

# use "#include" directive to include HTTP config file
# NOTE: #include is an include directive, do NOT remove the # before include
#include http.conf


# if support flv
# default value is false
# since v1.15
flv_support = true

# flv file extension name
# default value is flv
# since v1.15
flv_extension = flv


# set the group count
# set to none zero to support multi-group
# set to 0  for single group only
# groups settings section as [group1], [group2], ..., [groupN]
# default value is 0
# since v1.14
group_count = 0

# group settings for group #1
# since v1.14
# when support multi-group, uncomment following section
#[group1]
#group_name=group1
#storage_server_port=tracker1:23000
#store_path_count=2
#store_path0=/opt/machtalk/fastdfs/data/fastdfs_storage
#store_path1=/home/yuqing/fastdfs1

# group settings for group #2
# since v1.14
# when support multi-group, uncomment following section as neccessary
#[group2]
#group_name=group1
#storage_server_port=tracker1:23000
#store_path_count=1
#store_path0=/opt/machtalk/fastdfs/data/fastdfs_storage

tracker_server=tracker1:22122
[root@VM-24-11-opencloudos nginx-1.24.0]# make -j$(nproc) make -f objs/Makefile make[1]: Entering directory '/www/server/nginx/src/nginx-1.24.0' cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -Wno-error -Wformat-truncation=0 -Wformat-overflow=0 -D_FILE_OFFSET_BITS=64 -DFDFS_OUTPUT_CHUNK_SIZE='256*1024' -DFDFS_MOD_CONF_FILENAME='"/etc/fdfs/mod_fastdfs.conf"' -I src/core -I src/event -I src/event/modules -I src/os/unix -I /www/server/nginx/src/pcre-8.43 -I /www/server/nginx/src/openssl/.openssl/include -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 -I /usr/include/fastdfs -I /usr/include/fastcommon/ -I /usr/include/fastcommon -I /usr/include/libfastcommon/ -I src/stream \ -o objs/addon/src/ngx_http_fastdfs_module.o \ /usr/local/fastdfs-nginx-module/src/ngx_http_fastdfs_module.c In file included from /usr/local/fastdfs-nginx-module/src/ngx_http_fastdfs_module.c:6: /usr/local/fastdfs-nginx-module/src/common.c: In function ‘fdfs_get_params_from_tracker’: /usr/local/fastdfs-nginx-module/src/common.c:1616:10: warning: the address of ‘error_info’ will always evaluate as ‘true’ [-Waddress] 1616 | &iniContext, &continue_flag, error_info)) != 0) | ^ /usr/local/fastdfs-nginx-module/src/common.c:1615:18: error: too few arguments to function ‘fdfs_get_ini_context_from_tracker’ 1615 | if ((result=fdfs_get_ini_context_from_tracker(&g_tracker_group, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/fastdfs/fdfs_client.h:14, from /usr/local/fastdfs-nginx-module/src/common.c:29: /usr/include/fastdfs/tracker_proto.h:323:5: note: declared here 323 | int fdfs_get_ini_context_from_tracker(TrackerServerGroup *pTrackerGroup, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ make[1]: *** [objs/Makefile:1662: objs/addon/src/ngx_http_fastdfs_module.o] Error 1 make[1]: Leaving directory '/www/server/nginx/src/nginx-1.24.0' make: *** [Makefile:10: build] Error 2 [root@VM-24-11-opencloudos nginx-1.24.0]# rpm -qa | grep fastdfs [root@VM-24-11-opencloudos nginx-1.24.0]# rpm -qa | grep fastdfs
06-19
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值