tracker.conf 配置文件的詳細說明

# is this config file disabled
# false for enabled
# true for disabled
disabled=false
# 這個配置文件是否不生效,false 爲生效(否則不生效) true反之

# bind an address of this host
# empty for bind all addresses of this host
bind_addr=
# 是否綁定IP,
# bind_addr= 後面爲綁定的IP地址 (常用於服務器有多個IP但只希望一個IP提供服務)。如果不填則表示所有的(一般不填就OK)


# the tracker server port
port=22122
# 提供服務的端口

# connect timeout in seconds
# default value is 30s
connect_timeout=30
#連接超時時間,針對socket套接字函數connect

# network timeout in seconds
network_timeout=60
#  tracker server的網絡超時,單位爲秒。發送或接收數據時,如果在超時時間後還不能發送或接收數據,則本次網絡通信失敗。 

# the base path to store data and log files
base_path=/home/yuqing/fastdfs
# base_path 目錄地址(根目錄必須存在,子目錄會自動創建)
# 附目錄說明: 
  tracker server目錄及文件結構:
  ${base_path}
    |__data
    |     |__storage_groups.dat:存儲分組信息
    |     |__storage_servers.dat:存儲服務器列表
    |__logs
          |__trackerd.log:tracker server日誌文件

數據文件storage_groups.dat和storage_servers.dat中的記錄之間以換行符(\n)分隔,字段之間以西文逗號(,)分隔。
storage_groups.dat中的字段依次爲:
  1. group_name:組名
  2. storage_port:storage server端口號

storage_servers.dat中記錄storage server相關信息,字段依次爲:
  1. group_name:所屬組名
  2. ip_addr:ip地址
  3. status:狀態
  4. sync_src_ip_addr:向該storage server同步已有數據文件的源服務器
  5. sync_until_timestamp:同步已有數據文件的截至時間(UNIX時間戳)
  6. stat.total_upload_count:上傳文件次數
  7. stat.success_upload_count:成功上傳文件次數
  8. stat.total_set_meta_count:更改meta data次數
  9. stat.success_set_meta_count:成功更改meta data次數
  10. stat.total_delete_count:刪除文件次數
  11. stat.success_delete_count:成功刪除文件次數
  12. stat.total_download_count:下載文件次數
  13. stat.success_download_count:成功下載文件次數
  14. stat.total_get_meta_count:獲取meta data次數
  15. stat.success_get_meta_count:成功獲取meta data次數
  16. stat.last_source_update:最近一次源頭更新時間(更新操作來自客戶端)
  17. stat.last_sync_update:最近一次同步更新時間(更新操作來自其他storage server的同步)

# max concurrent connections this server supported
# max_connections worker threads start when this service startup
max_connections=256
# 系統提供服務時的最大連接數。對於V1.x,因一個連接由一個線程服務,也就是工作線程數。
# 對於V2.x,最大連接數和工作線程數沒有任何關係

# work thread count, should <= max_connections
# default value is 4
# since V2.00
# V2.0引入的這個參數,工作線程數,通常設置爲CPU數
work_threads=4

# 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=2
# 上傳組(卷) 的方式 0:輪詢方式 1: 指定組 2: 平衡負載(選擇最大剩餘空間的組(卷)上傳)
# 這裏如果在應用層指定了上傳到一個固定組,那麼這個參數被繞過

# which group to upload file
# when store_lookup set to 1, must set store_group to the group name
store_group=group2
# 當上一個參數設定爲1 時 (store_lookup=1,即指定組名時),必須設置本參數爲系統中存在的一個組名。如果選擇其他的上傳方式,這個參數就沒有效了。

# which storage server to upload file
# 0: round robin (default)
# 1: the first server order by ip address
# 2: the first server order by priority (the minimal)
store_server=0
# 選擇哪個storage server 進行上傳操作(一個文件被上傳後,這個storage server就相當於這個文件的storage server源,會對同組的storage server推送這個文件達到同步效果)
# 0: 輪詢方式 
# 1: 根據ip 地址進行排序選擇第一個服務器(IP地址最小者)
# 2: 根據優先級進行排序(上傳優先級由storage server來設置,參數名爲upload_priority) 

# which path(means disk or mount point) of the storage server to upload file
# 0: round robin
# 2: load balance, select the max free space path to upload file
store_path=0
# 選擇storage server 中的哪個目錄進行上傳。storage server可以有多個存放文件的base path(可以理解爲多個磁盤)。
# 0: 輪流方式,多個目錄依次存放文件
# 2: 選擇剩餘空間最大的目錄存放文件(注意:剩餘磁盤空間是動態的,因此存儲到的目錄或磁盤可能也是變化的)

# which storage server to download file
# 0: round robin (default)
# 1: the source storage server which the current file uploaded to
download_server=0
# 選擇哪個 storage server 作爲下載服務器 
# 0: 輪詢方式,可以下載當前文件的任一storage server
# 1: 哪個爲源storage server 就用哪一個 (前面說過了這個storage server源 是怎樣產生的) 就是之前上傳到哪個storage server服務器就是哪個了

# reserved storage space for system or other applications.
# if the free(available) space of any stoarge server in
# a group <= reserved_storage_space,
# no file can be uploaded to this group.
# bytes unit can be one of follows:
### G or g for gigabyte(GB)
### M or m for megabyte(MB)
### K or k for kilobyte(KB)
### no unit for byte(B)
### XX.XX% as ratio such as reserved_storage_space = 10%
reserved_storage_space = 10%
# storage server 上保留的空間,保證系統或其他應用需求空間。可以用絕對值或者百分比(V4開始支持百分比方式)。
#(指出 如果同組的服務器的硬盤大小一樣,以最小的爲準,也就是隻要同組中有一臺服務器達到這個標準了,這個標準就生效,原因就是因爲他們進行備份)

#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
# 選擇日誌級別(日誌寫在哪?看前面的說明了,有目錄介紹哦 呵呵)

#unix group name to run this program, 
#not set (empty) means run by the group of current user
run_by_group=
# 操作系統運行FastDFS的用戶組 (不填 就是當前用戶組,哪個啓動進程就是哪個)

#unix username to run this program,
#not set (empty) means run by current user
run_by_user=
# 操作系統運行FastDFS的用戶 (不填 就是當前用戶,哪個啓動進程就是哪個)

# allow_hosts can ocur more than once, host can be hostname or ip address,
# "*" means match all ip addresses, can use range like this: 10.0.1.[1-15,20] or
# host[01-08,20-25].domain.com, for example:
# allow_hosts=10.0.1.[1-15,20]
# allow_hosts=host[01-08,20-25].domain.com
allow_hosts=*
# 可以連接到此 tracker server 的ip範圍(對所有類型的連接都有影響,包括客戶端,storage server)

# sync log buff to disk every interval seconds
# default value is 10 seconds
sync_log_buff_interval = 10
# 同步或刷新日誌信息到硬盤的時間間隔,單位爲秒
# 注意:tracker server 的日誌不是時時寫硬盤的,而是先寫內存。

# check storage server alive interval
check_active_interval = 120
# 檢測 storage server 存活的時間隔,單位爲秒。
# storage server定期向tracker server 發心跳,如果tracker server在一個check_active_interval內還沒有收到storage server的一次心跳,那邊將認爲該storage server已經下線。所以本參數值必須大於storage server配置的心跳時間間隔。通常配置爲storage server心跳時間間隔的2倍或3倍。

# thread stack size, should > 512KB
# default value is 1MB
thread_stack_size=1MB
# 線程棧的大小。FastDFS server端採用了線程方式。更正一下,tracker server線程棧不應小於64KB,不是512KB。
# 線程棧越大,一個線程佔用的系統資源就越多。如果要啓動更多的線程(V1.x對應的參數爲max_connections,
V2.0爲work_threads),可以適當降低本參數值。

# auto adjust when the ip address of the storage server changed
# default value is true
storage_ip_changed_auto_adjust=true
# 這個參數控制當storage server IP地址改變時,集羣是否自動調整。注:只有在storage server進程重啓時才完成自動調整。

# storage sync file max delay seconds
# default value is 86400 seconds (one day)
# since V2.00
storage_sync_file_max_delay = 86400
# V2.0引入的參數。存儲服務器之間同步文件的最大延遲時間,缺省爲1天。根據實際情況進行調整
# 注:本參數並不影響文件同步過程。本參數僅在下載文件時,判斷文件是否已經被同步完成的一個閥值(經驗值)

# the max time of storage sync a file
# default value is 300 seconds
# since V2.00
storage_sync_file_max_time = 300
# V2.0引入的參數。存儲服務器同步一個文件需要消耗的最大時間,缺省爲300s,即5分鐘。
# 注:本參數並不影響文件同步過程。本參數僅在下載文件時,作爲判斷當前文件是否被同步完成的一個閥值(經驗值)

# if use a trunk file to store several small files
# default value is false
# since V3.00
use_trunk_file = false
# V3.0引入的參數。是否使用小文件合併存儲特性,缺省是關閉的。

# the min slot size, should <= 4KB
# default value is 256 bytes
# since V3.00
slot_min_size = 256
# V3.0引入的參數。
# trunk file分配的最小字節數。比如文件只有16個字節,系統也會分配slot_min_size個字節。

# the max slot size, should > slot_min_size
# store the upload file to trunk file when it's size <=  this value
# default value is 16MB
# since V3.00
slot_max_size = 16MB
# V3.0引入的參數。
# 只有文件大小<=這個參數值的文件,纔會合併存儲。如果一個文件的大小大於這個參數值,將直接保存到一個文件中(即不採用合併存儲方式)。

# the trunk file size, should >= 4MB
# default value is 64MB
# since V3.00
trunk_file_size = 64MB
# V3.0引入的參數。
# 合併存儲的trunk file大小,至少4MB,缺省值是64MB。不建議設置得過大。

# if create trunk file advancely
# default value is false
trunk_create_file_advance = false
# 是否提前創建trunk file。只有當這個參數爲true,下面3個以trunk_create_file_打頭的參數纔有效。

# the time base to create trunk file
# the time format: HH:MM
# default value is 02:00
trunk_create_file_time_base = 02:00
# 提前創建trunk file的起始時間點(基準時間),02:00表示第一次創建的時間點是凌晨2點。

# the interval of create trunk file, unit: second
# default value is 38400 (one day)
trunk_create_file_interval = 86400
# 創建trunk file的時間間隔,單位爲秒。如果每天只提前創建一次,則設置爲86400

# the threshold to create trunk file
# when the free trunk file size less than the threshold, will create 
# the trunk files
# default value is 0
trunk_create_file_space_threshold = 20G
# 提前創建trunk file時,需要達到的空閒trunk大小
# 比如本參數爲20G,而當前空閒trunk爲4GB,那麼只需要創建16GB的trunk file即可。

# if check trunk space occupying when loading trunk free spaces
# the occupied spaces will be ignored
# default value is false
# since V3.09
# NOTICE: set this parameter to true will slow the loading of trunk spaces
# when startup. you should set this parameter to true when neccessary.
trunk_init_check_occupying = false
#trunk初始化時,是否檢查可用空間是否被佔用

# if ignore storage_trunk.dat, reload from trunk binlog
# default value is false
# since V3.10
# set to true once for version upgrade when your version less than V3.10
trunk_init_reload_from_binlog = false
# 是否無條件從trunk binlog中加載trunk可用空間信息
# FastDFS缺省是從快照文件storage_trunk.dat中加載trunk可用空間,
# 該文件的第一行記錄的是trunk binlog的offset,然後從binlog的offset開始加載

# if use storage ID instead of IP address
# default value is false
# since V4.00
use_storage_id = false
# 是否使用server ID作爲storage server標識

# specify storage ids filename, can use relative or absolute path
# since V4.00
storage_ids_filename = storage_ids.conf
# use_storage_id 設置爲true,才需要設置本參數
# 在文件中設置組名、server ID和對應的IP地址,參見源碼目錄下的配置示例:conf/storage_ids.conf

# if store slave file use symbol link
# default value is false
# since V4.01
store_slave_file_use_link = false
# 存儲從文件是否採用symbol link(符號鏈接)方式
# 如果設置爲true,一個從文件將佔用兩個文件:原始文件及指向它的符號鏈接。

# if rotate the error log every day
# default value is false
# since V4.02
rotate_error_log = false
# 是否定期輪轉error log,目前僅支持一天輪轉一次

# rotate error log time base, time format: Hour:Minute
# Hour from 0 to 23, Minute from 0 to 59
# default value is 00:00
# since V4.02
error_log_rotate_time=00:00
# error log定期輪轉的時間點,只有當rotate_error_log設置爲true時有效

# rotate error log when the log file exceeds this size
# 0 means never rotates log file by log file size
# default value is 0
# since V4.02
rotate_error_log_size = 0
# error log按大小輪轉
# 設置爲0表示不按文件大小輪轉,否則當error log達到該大小,就會輪轉到新文件中

# keep days of the log files
# 0 means do not delete old log files
# default value is 0
log_file_keep_days = 7 

#保留日誌文件的天數
#0表示不刪除舊的日誌文件
#default值爲0
log_file_keep_days = 7

# if use connection pool
# default value is false
# since V4.05
use_connection_pool = false

#如果使用連接池
#default value爲false
#從V4.05開始
use_connection_pool = false

# connections whose the idle time exceeds this time will be closed
# unit: second
# default value is 3600
# since V4.05
connection_pool_max_idle_time = 3600
#空閒時間超過此時間的連接將被關閉
#unit:秒
#默認值爲3600
#從V4.05開始
connection_pool_max_idle_time = 3600


# 以下是關於http的設置了 默認編譯是不生效的 要求更改 #WITH_HTTPD=1 將 註釋#去掉 再編譯
# 關於http的應用 說實話 不是很瞭解 沒有見到 相關說明 ,望 版主可以完善一下 以下是字面解釋了
#HTTP settings
http.disabled=false   # HTTP服務是否不生效 
http.server_port=8080  # HTTP服務端口

# check storage HTTP server alive interval seconds
# <= 0 for never check
# default value is 30
http.check_alive_interval=30

#check storage HTTP server alive interval seconds
#<= 0從不檢查
#默認值爲30
http.check_alive_interval= 30

# check storage HTTP server alive type, values are:
#   tcp : connect to the storge server with HTTP port only,
#        do not request and get response
#   http: storage check alive url must return http status 200
# default value is tcp
http.check_alive_type=tcp

#check存儲HTTP服務器活動類型,值爲:
#tcp:僅使用HTTP端口連接到storge服務器,
#不要求並得到回覆
#http:storage check alive url必須返回http狀態200
#default value是tcp
http.check_alive_type= TCP

# check storage HTTP server alive uri/url
# NOTE: storage embed HTTP server support uri: /status.html
http.check_alive_uri=/status.html
#check storage HTTP server alive uri / url
#注意:存儲嵌入HTTP服務器支持uri:/status.html
http.check_alive_uri=/ status.html


#use "#include" directive to include http other settiongs
##include http.conf  # 如果加載http.conf的配置文件 去掉第一個#

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章