FastDFS配置详解之Tracker配置

来源:互联网 发布:人生遥控器 知乎 编辑:程序博客网 时间:2024/05/16 17:48

1 基本配置

disable

#func:配置是否生效#valu:true、falsedisable=false

bind_addr

#func:绑定IP#valu:IP地址bind_addr=192.168.6.102

port

#func:服务端口#valu:端口整数值port=22122

connect_timeout

#func:连接超时#valu:秒单位正整数值connect_timeout=30

network_timeout

#func:网络超时#valu:秒单位正整数值network_timeout=60

base_path

#func:Tracker数据/日志目录地址#valu:路径base_path=/home/michael/fdfs/base4tracker

max_connections

#func:最大连接数#valu:正整数值max_connections=256

work_threads

#func:线程数,通常设置CPU数#valu:正整数值work_threads=4

store_lookup

#func:上传文件的选组方式。#valu:0、1或2。# 0:表示轮询# 1:表示指定组# 2:表示存储负载均衡(选择剩余空间最大的组)store_lookup=2

store_group

#func:指定上传的组,如果在应用层指定了具体的组,那么这个参数将不会起效。另外如果store_lookup如果是0或2,则此参数无效。#valu:group1等store_group=group1

store_server

#func:上传服务器的选择方式。(一个文件被上传后,这个storage server就相当于这个文件的storage server源,会对同组的storage server推送这个文件达到同步效果)#valu:0、1或2# 0: 轮询方式(默认)# 1: 根据ip 地址进行排序选择第一个服务器(IP地址最小者)# 2: 根据优先级进行排序(上传优先级由storage server来设置,参数名为upload_priority),优先级值越小优先级越高。store_server=0

store_path

#func:上传路径的选择方式。storage server可以有多个存放文件的base path(可以理解为多个磁盘)。#valu:# 0: 轮流方式,多个目录依次存放文件# 2: 存储负载均衡。选择剩余空间最大的目录存放文件(注意:剩余磁盘空间是动态的,因此存储到的目录或磁盘可能也是变化的)store_path=0

download_server

#func:下载服务器的选择方式。#valu:# 0:轮询(默认)# 1:IP最小者# 2:优先级排序(值最小的,优先级最高。)download_server=0

reserved_storage_space

#func:保留空间值。如果某个组中的某个服务器的剩余自由空间小于设定值,则文件不会被上传到这个组。#valu:# G or g for gigabyte# M or m for megabyte# K or k for kilobytereserved_storage_space=1GB

log_level

#func:日志级别#valu:# emerg for emergency# alert# crit for critical# error# warn for warning# notice# info for information# debug for debugginglog_level=info

run_by_group / run_by_user

#func:指定运行该程序的用户组#valu:用户组名或空run_by_group=#func:#valu:run_by_user=

allow_hosts

#func:可以连接到tracker server的ip范围。可设定多个值。#valuallow_hosts=

check_active_interval

#func:检测 storage server 存活的时间隔,单位为秒。#      storage server定期向tracker server 发心跳,#      如果tracker server在一个check_active_interval内还没有收到storage server的一次心跳,#      那边将认为该storage server已经下线。所以本参数值必须大于storage server配置的心跳时间间隔。#      通常配置为storage server心跳时间间隔的2倍或3倍。check_active_interval=120

thread_stack_size

#func:设定线程栈的大小。 线程栈越大,一个线程占用的系统资源就越多。#      如果要启动更多的线程(V1.x对应的参数为max_connections,V2.0为work_threads),可以适当降低本参数值。#valu:如64KB,默认值为64,tracker server线程栈不应小于64KBthread_stack_size=64KB

storage_ip_changed_auto_adjust

#func:这个参数控制当storage server IP地址改变时,集群是否自动调整。注:只有在storage server进程重启时才完成自动调整。#valu:true或falsestorage_ip_changed_auto_adjust=true

2 同步

storage_sync_file_max_delay

#func:同组storage服务器之间同步的最大延迟时间。存储服务器之间同步文件的最大延迟时间,根据实际情况进行调整#valu:秒为单位,默认值为1天(24*3600)#sinc:v2.0storage_sync_file_max_delay=86400

storage_sync_file_max_time

#func:存储服务器同步一个文件需要消耗的最大时间,缺省为300s,即5分钟。#sinc:v2.0storage_sync_file_max_time=300

sync_log_buff_interval

#func:同步或刷新日志信息到硬盘的时间间隔。注意:tracker server 的日志不是时时写硬盘的,而是先写内存。#valu:以秒为单位sync_log_buff_interval=10

3 trunk 和 slot

#func:是否使用trunk文件来存储几个小文件#valu:true或false#sinc:v3.0use_trunk_file=false#func:最小slot大小#valu:<= 4KB,默认为256字节#sinc:v3.0slot_min_size=256#func:最大slot大小#valu:>= slot_min_size,当小于这个值的时候就存储到trunk file中。默认为16MB。#sinc:v3.0slot_max_size=16MB#func:trunk file的size#valu:>= 4MB,默认为64MB#sinc:v3.0trunk_file_size=64MB

4 HTTP 相关

是否启用 HTTP

#func:HTTP是否生效#valu:true或falsehttp.disabled=false

HTTP 服务器端口号

#func:tracker server上的http port#valu:#note:只有http.disabled=false时才生效http.server_port=7271

检查Storage存活状态的间隔时间(心跳检测)

#func:检查storage http server存活的间隔时间#valu:单位为秒#note:只有http.disabled=false时才生效http.check_alive_interval=30

心跳检测使用的协议方式

#func:检查storage http server存活的方式#valu:# tcp:连接到storage server的http端口,不进行request和response。# http:storage check alive url must return http status 200.#note:只有http.disabled=false时才生效http.check_alive_type=tcp

检查 Storage 状态的 URI

#func:检查storage http server是否alive的uri/url#note:只有http.disabled=false时才生效http.check_alive_uri=/status.html

need_find_content_type

#func:if need find content type form file extension name#note:只有http.disabled=false时才生效http.need_find_content_type=true

HTTP 配置文件

#func:”#include http.conf“表示redirect to include other settings#include http.conf
0 0
原创粉丝点击