http://blog.csdn.net/xingjiarong/article/details/50752586

配置FastDFS时,修改配置文件是很重要的一个步骤,理解配置文件中每一项的意义更加重要,所以我参考了大神的帖子,整理了配置文件的解释。原帖如下:http://bbs.chinaunix.net/thread-1941456-1-1.html,因为原帖中的版本比较早,所以我针对现有的版本进行了修改,原帖中没有client.conf的介绍,这里我给加上了。

下文中带有注释的配置文件下载:http://download.csdn.net/detail/xingjiarong/9445515

一、tracker.conf

  1. # 这个配置文件是否无效,false表示有效
  2. # is this config file disabled
  3. # false for enabled
  4. # true for disabled
  5. disabled=false
  6. # 是否绑定IP
  7. # bind_addr= 后面为绑定的IP地址 (常用于服务器有多个IP但只希望一个IP提供服务)。如果不填则表示所有的(一般不填就OK)
  8. # bind an address of this host
  9. # empty for bind all addresses of this host
  10. bind_addr=
  11. # 提供服务的端口
  12. # the tracker server port
  13. port=22122
  14. # 连接超时时间,针对socket套接字函数connect
  15. # connect timeout in seconds
  16. # default value is 30s
  17. connect_timeout=30
  18. # tracker server的网络超时,单位为秒。发送或接收数据时,如果在超时时间后还不能发送或接收数据,则本次网络通信失败
  19. # network timeout in seconds
  20. # default value is 30s
  21. network_timeout=60
  22. # the base path to store data and log files
  23. base_path=/home/yuqing/fastdfs
  24. # base_path 目录地址(根目录必须存在,子目录会自动创建)
  25. # 附目录说明:
  26. # tracker server目录及文件结构:
  27. # ${base_path}
  28. # |__data
  29. # | |__storage_groups.dat:存储分组信息
  30. # | |__storage_servers.dat:存储服务器列表
  31. # |__logs
  32. # |__trackerd.log:tracker server日志文件
  33. #数据文件storage_groups.dat和storage_servers.dat中的记录之间以换行符(\n)分隔,字段之间以西文逗号(,)分隔。
  34. #storage_groups.dat中的字段依次为:
  35. # 1. group_name:组名
  36. # 2. storage_port:storage server端口号
  37. #storage_servers.dat中记录storage server相关信息,字段依次为:
  38. # 1. group_name:所属组名
  39. # 2. ip_addr:ip地址
  40. # 3. status:状态
  41. # 4. sync_src_ip_addr:向该storage server同步已有数据文件的源服务器
  42. # 5. sync_until_timestamp:同步已有数据文件的截至时间(UNIX时间戳)
  43. # 6. stat.total_upload_count:上传文件次数
  44. # 7. stat.success_upload_count:成功上传文件次数
  45. # 8. stat.total_set_meta_count:更改meta data次数
  46. # 9. stat.success_set_meta_count:成功更改meta data次数
  47. # 10. stat.total_delete_count:删除文件次数
  48. # 11. stat.success_delete_count:成功删除文件次数
  49. # 12. stat.total_download_count:下载文件次数
  50. # 13. stat.success_download_count:成功下载文件次数
  51. # 14. stat.total_get_meta_count:获取meta data次数
  52. # 15. stat.success_get_meta_count:成功获取meta data次数
  53. # 16. stat.last_source_update:最近一次源头更新时间(更新操作来自客户端)
  54. # 17. stat.last_sync_update:最近一次同步更新时间(更新操作来自其他storage server的同步)
  55. # 系统提供服务时的最大连接数。对于V1.x,因一个连接由一个线程服务,也就是工作线程数。
  56. # 对于V2.x,最大连接数和工作线程数没有任何关系
  57. # max concurrent connections this server supported
  58. max_connections=256
  59. # work thread count, should <= max_connections
  60. # default value is 4
  61. # since V2.00
  62. # V2.0引入的这个参数,工作线程数,通常设置为CPU数
  63. work_threads=4
  64. # 上传组(卷) 的方式 0:轮询方式 1: 指定组 2: 平衡负载(选择最大剩余空间的组(卷)上传)
  65. # 这里如果在应用层指定了上传到一个固定组,那么这个参数被绕过
  66. # the method of selecting group to upload files
  67. # 0: round robin
  68. # 1: specify group
  69. # 2: load balance, select the max free space group to upload file
  70. store_lookup=2
  71. # 当上一个参数设定为1 时 (store_lookup=1,即指定组名时),必须设置本参数为系统中存在的一个组名。如果选择其他的上传方式,这个参数就没有效了
  72. # which group to upload file
  73. # when store_lookup set to 1, must set store_group to the group name
  74. store_group=group2
  75. # 选择哪个storage server 进行上传操作(一个文件被上传后,这个storage server就相当于这个文件的storage server源,会对同组的storage server推送这个文件达到同步效果)
  76. # 0: 轮询方式
  77. # 1: 根据ip 地址进行排序选择第一个服务器(IP地址最小者)
  78. # 2: 根据优先级进行排序(上传优先级由storage server来设置,参数名为upload_priority)
  79. # which storage server to upload file
  80. # 0: round robin (default)
  81. # 1: the first server order by ip address
  82. # 2: the first server order by priority (the minimal)
  83. store_server=0
  84. # 选择storage server 中的哪个目录进行上传。storage server可以有多个存放文件的base path(可以理解为多个磁盘)。
  85. # 0: 轮流方式,多个目录依次存放文件
  86. # 2: 选择剩余空间最大的目录存放文件(注意:剩余磁盘空间是动态的,因此存储到的目录或磁盘可能也是变化的)
  87. # which path(means disk or mount point) of the storage server to upload file
  88. # 0: round robin
  89. # 2: load balance, select the max free space path to upload file
  90. store_path=0
  91. # 选择哪个 storage server 作为下载服务器
  92. # 0: 轮询方式,可以下载当前文件的任一storage server
  93. # 1: 哪个为源storage server 就用哪一个 (前面说过了这个storage server源 是怎样产生的) 就是之前上传到哪个storage server服务器就是哪个了
  94. # which storage server to download file
  95. # 0: round robin (default)
  96. # 1: the source storage server which the current file uploaded to
  97. download_server=0
  98. # storage server 上保留的空间,保证系统或其他应用需求空间。可以用绝对值或者百分比(V4开始支持百分比方式)。
  99. #(指出 如果同组的服务器的硬盘大小一样,以最小的为准,也就是只要同组中有一台服务器达到这个标准了,这个标准就生效,原因就是因为他们进行备份)
  100. # reserved storage space for system or other applications.
  101. # if the free(available) space of any stoarge server in
  102. # a group <= reserved_storage_space,
  103. # no file can be uploaded to this group.
  104. # bytes unit can be one of follows:
  105. ### G or g for gigabyte(GB)
  106. ### M or m for megabyte(MB)
  107. ### K or k for kilobyte(KB)
  108. ### no unit for byte(B)
  109. ### XX.XX% as ratio such as reserved_storage_space = 10%
  110. reserved_storage_space = 10%
  111. # 选择日志级别
  112. #standard log level as syslog, case insensitive, value list:
  113. ### emerg for emergency
  114. ### alert
  115. ### crit for critical
  116. ### error
  117. ### warn for warning
  118. ### notice
  119. ### info
  120. ### debug
  121. log_level=info
  122. # 操作系统运行FastDFS的用户组 (不填 就是当前用户组,哪个启动进程就是哪个)
  123. #unix group name to run this program,
  124. #not set (empty) means run by the group of current user
  125. run_by_group=
  126. # 操作系统运行FastDFS的用户 (不填 就是当前用户,哪个启动进程就是哪个)
  127. #unix username to run this program,
  128. #not set (empty) means run by current user
  129. run_by_user=
  130. # 可以连接到此 tracker server 的ip范围(对所有类型的连接都有影响,包括客户端,storage server)
  131. # allow_hosts can ocur more than once, host can be hostname or ip address,
  132. # "*" means match all ip addresses, can use range like this: 10.0.1.[1-15,20] or
  133. # host[01-08,20-25].domain.com, for example:
  134. # allow_hosts=10.0.1.[1-15,20]
  135. # allow_hosts=host[01-08,20-25].domain.com
  136. allow_hosts=*
  137. # 同步或刷新日志信息到硬盘的时间间隔,单位为秒
  138. # 注意:tracker server 的日志不是时时写硬盘的,而是先写内存
  139. # sync log buff to disk every interval seconds
  140. # default value is 10 seconds
  141. sync_log_buff_interval = 10
  142. # 检测 storage server 存活的时间隔,单位为秒。
  143. # storage server定期向tracker server 发心跳,如果tracker server在一个check_active_interval内还没有收到storage server的一次心跳,那边将认为该storage server已经下线。所以本参数值必须大于storage server配置的心跳时间间隔。通常配置为storage server心跳时间间隔的2倍或3倍
  144. # check storage server alive interval seconds
  145. check_active_interval = 120
  146. # 线程栈的大小。FastDFS server端采用了线程方式。tracker server线程栈不应小于64KB
  147. # 线程栈越大,一个线程占用的系统资源就越多。如果要启动更多的线程(V1.x对应的参数为max_connections,
  148. V2.0work_threads),可以适当降低本参数值
  149. # thread stack size, should >= 64KB
  150. # default value is 64KB
  151. thread_stack_size = 64KB
  152. # 这个参数控制当storage server IP地址改变时,集群是否自动调整。注:只有在storage server进程重启时才完成自动调整
  153. # auto adjust when the ip address of the storage server changed
  154. # default value is true
  155. storage_ip_changed_auto_adjust = true
  156. # V2.0引入的参数。存储服务器之间同步文件的最大延迟时间,缺省为1天。根据实际情况进行调整
  157. # 注:本参数并不影响文件同步过程。本参数仅在下载文件时,判断文件是否已经被同步完成的一个阀值(经验值)
  158. # storage sync file max delay seconds
  159. # default value is 86400 seconds (one day)
  160. # since V2.00
  161. storage_sync_file_max_delay = 86400
  162. # V2.0引入的参数。存储服务器同步一个文件需要消耗的最大时间,缺省为300s,即5分钟。
  163. # 注:本参数并不影响文件同步过程。本参数仅在下载文件时,作为判断当前文件是否被同步完成的一个阀值(经验值)
  164. # the max time of storage sync a file
  165. # default value is 300 seconds
  166. # since V2.00
  167. storage_sync_file_max_time = 300
  168. # V3.0引入的参数。是否使用小文件合并存储特性,缺省是关闭的
  169. # if use a trunk file to store several small files
  170. # default value is false
  171. # since V3.00
  172. use_trunk_file = false
  173. # V3.0引入的参数。
  174. # trunk file分配的最小字节数。比如文件只有16个字节,系统也会分配slot_min_size个字节
  175. # the min slot size, should <= 4KB
  176. # default value is 256 bytes
  177. # since V3.00
  178. slot_min_size = 256
  179. # V3.0引入的参数。
  180. # 只有文件大小<=这个参数值的文件,才会合并存储。如果一个文件的大小大于这个参数值,将直接保存到一个文件中(即不采用合并存储方式)。
  181. # the max slot size, should > slot_min_size
  182. # store the upload file to trunk file when it's size <= this value
  183. # default value is 16MB
  184. # since V3.00
  185. slot_max_size = 16MB
  186. # V3.0引入的参数。
  187. # 合并存储的trunk file大小,至少4MB,缺省值是64MB。不建议设置得过大
  188. # the trunk file size, should >= 4MB
  189. # default value is 64MB
  190. # since V3.00
  191. trunk_file_size = 64MB
  192. # 是否提前创建trunk file。只有当这个参数为true,下面3个以trunk_create_file_打头的参数才有效
  193. # if create trunk file advancely
  194. # default value is false
  195. # since V3.06
  196. trunk_create_file_advance = false
  197. # 提前创建trunk file的起始时间点(基准时间),02:00表示第一次创建的时间点是凌晨2点
  198. # the time base to create trunk file
  199. # the time format: HH:MM
  200. # default value is 02:00
  201. # since V3.06
  202. trunk_create_file_time_base = 02:00
  203. # 创建trunk file的时间间隔,单位为秒。如果每天只提前创建一次,则设置为86400
  204. # the interval of create trunk file, unit: second
  205. # default value is 38400 (one day)
  206. # since V3.06
  207. trunk_create_file_interval = 86400
  208. # 提前创建trunk file时,需要达到的空闲trunk大小
  209. # 比如本参数为20G,而当前空闲trunk为4GB,那么只需要创建16GB的trunk file即可
  210. # the threshold to create trunk file
  211. # when the free trunk file size less than the threshold, will create
  212. # the trunk files
  213. # default value is 0
  214. # since V3.06
  215. trunk_create_file_space_threshold = 20G
  216. # trunk初始化时,是否检查可用空间是否被占用
  217. # if check trunk space occupying when loading trunk free spaces
  218. # the occupied spaces will be ignored
  219. # default value is false
  220. # since V3.09
  221. # NOTICE: set this parameter to true will slow the loading of trunk spaces
  222. # when startup. you should set this parameter to true when neccessary.
  223. trunk_init_check_occupying = false
  224. # 是否无条件从trunk binlog中加载trunk可用空间信息
  225. # FastDFS缺省是从快照文件storage_trunk.dat中加载trunk可用空间,
  226. # 该文件的第一行记录的是trunk binlog的offset,然后从binlog的offset开始加载
  227. # if ignore storage_trunk.dat, reload from trunk binlog
  228. # default value is false
  229. # since V3.10
  230. # set to true once for version upgrade when your version less than V3.10
  231. trunk_init_reload_from_binlog = false
  232. # 是否使用server ID作为storage server标识
  233. # if use storage ID instead of IP address
  234. # default value is false
  235. # since V4.00
  236. use_storage_id = false
  237. # use_storage_id 设置为true,才需要设置本参数
  238. # 在文件中设置组名、server ID和对应的IP地址,参见源码目录下的配置示例:conf/storage_ids.conf
  239. # specify storage ids filename, can use relative or absolute path
  240. # since V4.00
  241. storage_ids_filename = storage_ids.conf
  242. #文件名中的id类型,有ip和id两种,只有当use_storage_id设置为true时该参数才有效
  243. # id type of the storage server in the filename, values are:
  244. ## ip: the ip address of the storage server
  245. ## id: the server id of the storage server
  246. # this paramter is valid only when use_storage_id set to true
  247. # default value is ip
  248. # since V4.03
  249. id_type_in_filename = ip
  250. # 存储从文件是否采用symbol link(符号链接)方式
  251. # 如果设置为true,一个从文件将占用两个文件:原始文件及指向它的符号链接
  252. # if store slave file use symbol link
  253. # default value is false
  254. # since V4.01
  255. store_slave_file_use_link = false
  256. # 是否定期轮转error log,目前仅支持一天轮转一次
  257. # if rotate the error log every day
  258. # default value is false
  259. # since V4.02
  260. rotate_error_log = false
  261. # error log定期轮转的时间点,只有当rotate_error_log设置为true时有效
  262. # rotate error log time base, time format: Hour:Minute
  263. # Hour from 0 to 23, Minute from 0 to 59
  264. # default value is 00:00
  265. # since V4.02
  266. error_log_rotate_time=00:00
  267. # error log按大小轮转
  268. # 设置为0表示不按文件大小轮转,否则当error log达到该大小,就会轮转到新文件中
  269. # rotate error log when the log file exceeds this size
  270. # 0 means never rotates log file by log file size
  271. # default value is 0
  272. # since V4.02
  273. rotate_error_log_size = 0
  274. # 是否使用连接池
  275. # if use connection pool
  276. # default value is false
  277. # since V4.05
  278. use_connection_pool = false
  279. # 如果一个连接的空闲时间超过这个值将会被自动关闭
  280. # connections whose the idle time exceeds this time will be closed
  281. # unit: second
  282. # default value is 3600
  283. # since V4.05
  284. connection_pool_max_idle_time = 3600
  285. # 用于提供http服务的端口
  286. # HTTP port on this tracker server
  287. http.server_port=8080
  288. # 检查http server是否还在工作的时间间隔,如果该值小于0则永远不检查
  289. # check storage HTTP server alive interval seconds
  290. # <= 0 for never check
  291. # default value is 30
  292. http.check_alive_interval=30
  293. # 检查http server是否存活的类型,有tcp和http两种
  294. # tcp方式只有http端口被连接
  295. # http方式检查必须返回状态值200
  296. # check storage HTTP server alive type, values are:
  297. # tcp : connect to the storge server with HTTP port only,
  298. # do not request and get response
  299. # http: storage check alive url must return http status 200
  300. # default value is tcp
  301. http.check_alive_type=tcp
  302. # check storage HTTP server alive uri/url
  303. # NOTE: storage embed HTTP server support uri: /status.html
  304. http.check_alive_uri=/status.html
  • 1
  • 2

二、storage.conf

  1. # 这个配置文件是否无效,false表示有效
  2. # is this config file disabled
  3. # false for enabled
  4. # true for disabled
  5. disabled=false
  6. # 指定 此 storage server 所在组(卷)
  7. # the name of the group this storage server belongs to
  8. group_name=group1
  9. # 是否绑定IP
  10. # bind_addr= 后面为绑定的IP地址 (常用于服务器有多个IP但只希望一个IP提供服务)。如果不填则表示所有的(一般不填就OK)
  11. # bind an address of this host
  12. # empty for bind all addresses of this host
  13. bind_addr=
  14. # bind_addr通常是针对server的。当指定bind_addr时,本参数才有效。
  15. # 本storage server作为client连接其他服务器(如tracker server、其他storage server),是否绑定bind_addr。
  16. # if bind an address of this host when connect to other servers
  17. # (this storage server as a client)
  18. # true for binding the address configed by above parameter: "bind_addr"
  19. # false for binding any address of this host
  20. client_bind=true
  21. # storage server服务端口
  22. # the storage server port
  23. port=23000
  24. # 连接超时时间,针对socket套接字函数connect
  25. # connect timeout in seconds
  26. # default value is 30s
  27. connect_timeout=30
  28. # storage server 网络超时时间,单位为秒。发送或接收数据时,如果在超时时间后还不能发送或接收数据,则本次网络通信失败。
  29. # network timeout in seconds
  30. # default value is 30s
  31. network_timeout=60
  32. # 心跳间隔时间,单位为秒 (这里是指主动向tracker server 发送心跳)
  33. # heart beat interval in seconds
  34. heart_beat_interval=30
  35. # storage server向tracker server报告磁盘剩余空间的时间间隔,单位为秒
  36. # disk usage report interval in seconds
  37. stat_report_interval=60
  38. # base_path 目录地址,根目录必须存在 子目录会自动生成 (注 :这里不是上传的文件存放的地址,之前是的,在某个版本后更改了)
  39. # the base path to store data and log files
  40. base_path=/home/yuqing/fastdfs
  41. # 系统提供服务时的最大连接数
  42. # max concurrent connections the server supported
  43. # default value is 256
  44. # more max_connections means more memory will be used
  45. max_connections=256
  46. # V2.0引入本参数。设置队列结点的buffer大小。工作队列消耗的内存大小 = buff_size * max_connections
  47. # 设置得大一些,系统整体性能会有所提升。
  48. # 消耗的内存请不要超过系统物理内存大小。另外,对于32位系统,请注意使用到的内存不要超过3GB
  49. # the buff size to recv / send data
  50. # this parameter must more than 8KB
  51. # default value is 64KB
  52. # since V2.00
  53. buff_size = 256KB
  54. # 工作线程的数量,工作线程用于处理网络IO,应当小于max_connections的值
  55. # work thread count, should <= max_connections
  56. # work thread deal network io
  57. # default value is 4
  58. # since V2.00
  59. work_threads=4
  60. # V2.0引入本参数。磁盘IO读写是否分离,缺省是分离的
  61. # if disk read / write separated
  62. ## false for mixed read and write
  63. ## true for separated read and write
  64. # default value is true
  65. # since V2.00
  66. disk_rw_separated = true
  67. # V2.0引入本参数。针对单个存储路径的读线程数,缺省值为1。
  68. # 读写分离时,系统中的读线程数 = disk_reader_threads * store_path_count
  69. # 读写混合时,系统中的读写线程数 = (disk_reader_threads + disk_writer_threads) * store_path_count
  70. # disk reader thread count per store base path
  71. # for mixed read / write, this parameter can be 0
  72. # default value is 1
  73. # since V2.00
  74. disk_reader_threads = 1
  75. # V2.0引入本参数。针对单个存储路径的写线程数,缺省值为1。
  76. # 读写分离时,系统中的写线程数 = disk_writer_threads * store_path_count
  77. # 读写混合时,系统中的读写线程数 = (disk_reader_threads + disk_writer_threads) * store_path_count
  78. # disk writer thread count per store base path
  79. # for mixed read / write, this parameter can be 0
  80. # default value is 1
  81. # since V2.00
  82. disk_writer_threads = 1
  83. # 同步文件时,如果从binlog中没有读到要同步的文件,休眠N毫秒后重新读取。0表示不休眠,立即再次尝试读取。
  84. # 出于CPU消耗考虑,不建议设置为0。如何希望同步尽可能快一些,可以将本参数设置得小一些,比如设置为10ms
  85. # when no entry to sync, try read binlog again after X milliseconds
  86. # must > 0, default value is 200ms
  87. sync_wait_msec=50
  88. # 同步上一个文件后,再同步下一个文件的时间间隔,单位为毫秒,0表示不休眠,直接同步下一个文件。
  89. # after sync a file, usleep milliseconds
  90. # 0 for sync successively (never call usleep)
  91. sync_interval=0
  92. # 下面二个一起解释。允许系统同步的时间段 (默认是全天) 。一般用于避免高峰同步产生一些问题而设定,相信sa都会明白
  93. # storage sync start time of a day, time format: Hour:Minute
  94. # Hour from 0 to 23, Minute from 0 to 59
  95. sync_start_time=00:00
  96. # storage sync end time of a day, time format: Hour:Minute
  97. # Hour from 0 to 23, Minute from 0 to 59
  98. sync_end_time=23:59
  99. # 同步完N个文件后,把storage的mark文件同步到磁盘
  100. # 注:如果mark文件内容没有变化,则不会同步
  101. # write to the mark file after sync N files
  102. # default value is 500
  103. write_mark_file_freq=500
  104. # 存放文件时storage server支持多个路径(例如磁盘)。这里配置存放文件的基路径数目,通常只配一个目录。
  105. # path(disk or mount point) count, default value is 1
  106. store_path_count=1
  107. # 逐一配置store_path个路径,索引号基于0。注意配置方法后面有0,1,2 ......,需要配置0到store_path - 1。
  108. # 如果不配置base_path0,那边它就和base_path对应的路径一样。
  109. # store_path#, based 0, if store_path0 not exists, it's value is base_path
  110. # the paths must be exist
  111. store_path0=/home/yuqing/fastdfs
  112. #store_path1=/home/yuqing/fastdfs2
  113. # FastDFS存储文件时,采用了两级目录。这里配置存放文件的目录个数 (系统的存储机制,大家看看文件存储的目录就知道了)
  114. # 如果本参数只为N(如:256),那么storage server在初次运行时,会自动创建 N * N 个存放文件的子目录。
  115. # subdir_count * subdir_count directories will be auto created under each
  116. # store_path (disk), value can be 1 to 256, default value is 256
  117. subdir_count_per_path=256
  118. # tracker_server 的列表 要写端口的哦 (再次提醒是主动连接tracker_server )
  119. # 有多个tracker server时,每个tracker server写一行
  120. # tracker_server can ocur more than once, and tracker_server format is
  121. # "host:port", host can be hostname or ip address
  122. tracker_server=192.168.209.121:22122
  123. # 日志级别
  124. #standard log level as syslog, case insensitive, value list:
  125. ### emerg for emergency
  126. ### alert
  127. ### crit for critical
  128. ### error
  129. ### warn for warning
  130. ### notice
  131. ### info
  132. ### debug
  133. log_level=info
  134. # 操作系统运行FastDFS的用户组 (不填 就是当前用户组,哪个启动进程就是哪个)
  135. #unix group name to run this program,
  136. #not set (empty) means run by the group of current user
  137. run_by_group=
  138. # 操作系统运行FastDFS的用户 (不填 就是当前用户,哪个启动进程就是哪个)
  139. #unix username to run this program,
  140. #not set (empty) means run by current user
  141. run_by_user=
  142. # 允许连接本storage server的IP地址列表 (不包括自带HTTP服务的所有连接)
  143. # 可以配置多行,每行都会起作用
  144. # allow_hosts can ocur more than once, host can be hostname or ip address,
  145. # "*" means match all ip addresses, can use range like this: 10.0.1.[1-15,20] or
  146. # host[01-08,20-25].domain.com, for example:
  147. # allow_hosts=10.0.1.[1-15,20]
  148. # allow_hosts=host[01-08,20-25].domain.com
  149. allow_hosts=*
  150. # 文件在data目录下分散存储策略。
  151. # 0: 轮流存放,在一个目录下存储设置的文件数后(参数file_distribute_rotate_count中设置文件数),使用下一个目录进行存储。
  152. # 1: 随机存储,根据文件名对应的hash code来分散存储。
  153. # the mode of the files distributed to the data path
  154. # 0: round robin(default)
  155. # 1: random, distributted by hash code
  156. file_distribute_path_mode=0
  157. # 当上面的参数file_distribute_path_mode配置为0(轮流存放方式)时,本参数有效。
  158. # 当一个目录下的文件存放的文件数达到本参数值时,后续上传的文件存储到下一个目录中。
  159. # valid when file_distribute_to_path is set to 0 (round robin),
  160. # when the written file count reaches this number, then rotate to next path
  161. # default value is 100
  162. file_distribute_rotate_count=100
  163. # 当写入大文件时,每写入N个字节,调用一次系统函数fsync将内容强行同步到硬盘。0表示从不调用fsync
  164. # call fsync to disk when write big file
  165. # 0: never call fsync
  166. # other: call fsync when written bytes >= this bytes
  167. # default value is 0 (never call fsync)
  168. fsync_after_written_bytes=0
  169. # 同步或刷新日志信息到硬盘的时间间隔,单位为秒
  170. # 注意:storage server 的日志信息不是时时写硬盘的,而是先写内存。
  171. # sync log buff to disk every interval seconds
  172. # must > 0, default value is 10 seconds
  173. sync_log_buff_interval=10
  174. # 同步binglog(更新操作日志)到硬盘的时间间隔,单位为秒
  175. # 本参数会影响新上传文件同步延迟时间
  176. # sync binlog buff / cache to disk every interval seconds
  177. # default value is 60 seconds
  178. sync_binlog_buff_interval=10
  179. # 把storage的stat文件同步到磁盘的时间间隔,单位为秒。
  180. # 注:如果stat文件内容没有变化,不会进行同步
  181. # sync storage stat info to disk every interval seconds
  182. # default value is 300 seconds
  183. sync_stat_file_interval=300
  184. # 线程栈的大小。FastDFS server端采用了线程方式。
  185. # 对于V1.x,storage server线程栈不应小于512KB;对于V2.0,线程栈大于等于128KB即可。
  186. # 线程栈越大,一个线程占用的系统资源就越多。
  187. # 对于V1.x,如果要启动更多的线程(max_connections),可以适当降低本参数值。
  188. # thread stack size, should >= 512KB
  189. # default value is 512KB
  190. thread_stack_size=512KB
  191. # 本storage server作为源服务器,上传文件的优先级,可以为负数。值越小,优先级越高。这里就和 tracker.conf 中store_server= 2时的配置相对应了
  192. # the priority as a source server for uploading file.
  193. # the lower this value, the higher its uploading priority.
  194. # default value is 10
  195. upload_priority=10
  196. # 网卡别名前缀,就像Linux中的eth,可以使用ifconfig -a命令来查看
  197. # 多个别名之间使用逗号分隔,如果不设置这个值表示自动的被系统类型设置
  198. # the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a
  199. # multi aliases split by comma. empty value means auto set by OS type
  200. # default values is empty
  201. if_alias_prefix=
  202. # 是否检测上传文件已经存在。如果已经存在,则不存在文件内容,建立一个符号链接以节省磁盘空间。
  203. # 这个应用要配合FastDHT 使用,所以打开前要先安装FastDHT
  204. # 1或yes 是检测,0或no 是不检测
  205. # if check file duplicate, when set to true, use FastDHT to store file indexes
  206. # 1 or yes: need check
  207. # 0 or no: do not check
  208. # default value is 0
  209. check_file_duplicate=0
  210. # 文件去重时,文件内容的签名方式:
  211. # hash: 4个hash code
  212. # md5:MD5
  213. # file signature method for check file duplicate
  214. ## hash: four 32 bits hash code
  215. ## md5: MD5 signature
  216. # default value is hash
  217. # since V4.01
  218. file_signature_method=hash
  219. # 当上个参数设定为1 或 yes时 (true/on也是可以的) , 在FastDHT中的命名空间
  220. # namespace for storing file indexes (key-value pairs)
  221. # this item must be set when check_file_duplicate is true / on
  222. key_namespace=FastDFS
  223. # 与FastDHT servers 的连接方式 (是否为持久连接) ,默认是0(短连接方式)。可以考虑使用长连接,这要看FastDHT server的连接数是否够用。
  224. # set keep_alive to 1 to enable persistent connection with FastDHT servers
  225. # default value is 0 (short connection)
  226. keep_alive=0
  227. # 下面是关于FastDHT servers 的设定 需要对FastDHT servers 有所了解,这里只说字面意思了
  228. # 可以通过 #include filename 方式来加载 FastDHT servers 的配置,装上FastDHT就知道该如何配置啦。
  229. # 同样要求 check_file_duplicate=1 时才有用,不然系统会忽略
  230. # fdht_servers.conf 记载的是 FastDHT servers 列表
  231. # you can use "#include filename" (not include double quotes) directive to
  232. # load FastDHT server list, when the filename is a relative path such as
  233. # pure filename, the base path is the base path of current/this config file.
  234. # must set FastDHT server list when check_file_duplicate is true / on
  235. # please see INSTALL of FastDHT for detail
  236. ##include /home/yuqing/fastdht/conf/fdht_servers.conf
  237. # 是否将文件操作记录到access log
  238. # if log to access log
  239. # default value is false
  240. # since V4.00
  241. use_access_log = false
  242. # 是否定期轮转access log,目前仅支持一天轮转一次
  243. # if rotate the access log every day
  244. # default value is false
  245. # since V4.00
  246. rotate_access_log = false
  247. # access log定期轮转的时间点,只有当rotate_access_log设置为true时有效
  248. # rotate access log time base, time format: Hour:Minute
  249. # Hour from 0 to 23, Minute from 0 to 59
  250. # default value is 00:00
  251. # since V4.00
  252. access_log_rotate_time=00:00
  253. # 是否定期轮转error log,目前仅支持一天轮转一次
  254. # if rotate the error log every day
  255. # default value is false
  256. # since V4.02
  257. rotate_error_log = false
  258. # error log定期轮转的时间点,只有当rotate_error_log设置为true时有效
  259. # rotate error log time base, time format: Hour:Minute
  260. # Hour from 0 to 23, Minute from 0 to 59
  261. # default value is 00:00
  262. # since V4.02
  263. error_log_rotate_time=00:00
  264. # access log按文件大小轮转
  265. # 设置为0表示不按文件大小轮转,否则当access log达到该大小,就会轮转到新文件中
  266. # rotate access log when the log file exceeds this size
  267. # 0 means never rotates log file by log file size
  268. # default value is 0
  269. # since V4.02
  270. rotate_access_log_size = 0
  271. # error log按文件大小轮转
  272. # 设置为0表示不按文件大小轮转,否则当error log达到该大小,就会轮转到新文件中
  273. # rotate error log when the log file exceeds this size
  274. # 0 means never rotates log file by log file size
  275. # default value is 0
  276. # since V4.02
  277. rotate_error_log_size = 0
  278. # 文件同步的时候,是否忽略无效的binlog记录
  279. # if skip the invalid record when sync file
  280. # default value is false
  281. # since V4.02
  282. file_sync_skip_invalid_record=false
  283. # 是否使用连接池
  284. # if use connection pool
  285. # default value is false
  286. # since V4.05
  287. use_connection_pool = false
  288. # 如果一个连接的空闲时间超过这个值将会被自动关闭
  289. # connections whose the idle time exceeds this time will be closed
  290. # unit: second
  291. # default value is 3600
  292. # since V4.05
  293. connection_pool_max_idle_time = 3600
  294. # storage server上web server域名,通常仅针对单独部署的web server。这样URL中就可以通过域名方式来访问storage server上的文件了,
  295. # 这个参数为空就是IP地址的方式。
  296. # use the ip address of this storage server if domain_name is empty,
  297. # else this domain name will ocur in the url redirected by the tracker server
  298. http.domain_name=
  299. # web server的端口
  300. # the port of the web server on this storage server
  301. http.server_port=8888
  • 1

三、client.conf

  1. # 连接超时时间,针对socket套接字函数connect
  2. # connect timeout in seconds
  3. # default value is 30s
  4. connect_timeout=30
  5. # client的网络超时,单位为秒。发送或接收数据时,如果在超时时间后还不能发送或接收数据,则本次网络通信失败
  6. # network timeout in seconds
  7. # default value is 30s
  8. network_timeout=60
  9. # 存储日志的根目录
  10. # the base path to store log files
  11. base_path=/home/yuqing/fastdfs
  12. # tracker_server 的列表 要写端口
  13. # tracker_server can ocur more than once, and tracker_server format is
  14. # "host:port", host can be hostname or ip address
  15. tracker_server=192.168.0.197:22122
  16. # 日志的级别
  17. #standard log level as syslog, case insensitive, value list:
  18. ### emerg for emergency
  19. ### alert
  20. ### crit for critical
  21. ### error
  22. ### warn for warning
  23. ### notice
  24. ### info
  25. ### debug
  26. log_level=info
  27. # 是否使用连接池
  28. # if use connection pool
  29. # default value is false
  30. # since V4.05
  31. use_connection_pool = false
  32. # 如果一个连接的空闲时间超过这个值将会被自动关闭
  33. # connections whose the idle time exceeds this time will be closed
  34. # unit: second
  35. # default value is 3600
  36. # since V4.05
  37. connection_pool_max_idle_time = 3600
  38. # 是否从FastDFS的tracker server加载参数
  39. # if load FastDFS parameters from tracker server
  40. # since V4.05
  41. # default value is false
  42. load_fdfs_parameters_from_tracker=false
  43. 是否使用storage ID 代替IP,只有当load_fdfs_parameters_from_trackerfalse时才有效
  44. # if use storage ID instead of IP address
  45. # same as tracker.conf
  46. # valid only when load_fdfs_parameters_from_tracker is false
  47. # default value is false
  48. # since V4.05
  49. use_storage_id = false
  50. # 指定storage_ids的路径,可以使用绝对路径和相对路径,只有当load_fdfs_parameters_from_tracker为false时才有效
  51. # specify storage ids filename, can use relative or absolute path
  52. # same as tracker.conf
  53. # valid only when load_fdfs_parameters_from_tracker is false
  54. # since V4.05
  55. storage_ids_filename = storage_ids.conf
  56. #tracker server的http端口
  57. #HTTP settings
  58. http.tracker_server_port=8080
  59. #use "#include" directive to include HTTP other settiongs
  60. ##include http.conf

(转) 分布式文件存储FastDFS(七)FastDFS配置文件详解的更多相关文章

  1. 分布式文件存储:FastDFS简单使用与原理分析

    引言 FastDFS 属于分布式存储范畴,分布式文件系统 FastDFS 非常适合中小型项目,在我接手维护公司图片服务的时候开始接触到它,本篇文章目的是总结一下 FastDFS 的知识点. 用了 2 ...

  2. FastDFS分布式文件系统配置文件详解

    一.tracker配置文件详解: # is this config file disabled# false for enabled# true for disableddisabled=false# ...

  3. .Net平台下,分布式文件存储的实现

    遇到的问题 对于Web程序,使用一台服务器的时候,客户端上传的文件一般也都是存储在这台服务器上.但在集群环境中就行不通了,如果每个服务器都存储自己接受到的文件,就乱套了,数据库中明明有这个附件的记录, ...

  4. 分布式文件存储数据库 MongoDB

    MongoDB 简介 Mongo 并非芒果(Mango)的意思,而是源于 Humongous(巨大的:庞大的)一词. MongoDB 是一个基于分布式文件存储的 NoSQL 数据库.由 C++ 语言编 ...

  5. 【网络爬虫入门05】分布式文件存储数据库MongoDB的基本操作与爬虫应用

    [网络爬虫入门05]分布式文件存储数据库MongoDB的基本操作与爬虫应用 广东职业技术学院  欧浩源 1.引言 网络爬虫往往需要将大量的数据存储到数据库中,常用的有MySQL.MongoDB和Red ...

  6. 网卡配置文件详解 用户管理与文件权限篇 文件与目录权限 软连接 tar解压命令 killall命令 linux防火墙 dns解析设置 计划任务crond服务 软件包安装 阿里云 yum源 安装

    Linux系统基础优化及常用命令 Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令. ...

  7. Spring配置文件详解 – applicationContext.xml文件路径

    Spring配置文件详解 – applicationContext.xml文件路径 Java编程                 spring的配置文件applicationContext.xml的默 ...

  8. Linux系统学习 二十一、SAMBA服务—相关文件、配置文件详解

    3.相关文件 常用文件: /etc/samba/smb.conf      #配置文件 /etc/samba/lmhosts        #对应NetBIOS名与主机的IP的文件,一般Samba会自 ...

  9. MyBatis 全局配置文件详解(七)

    MyBatis 配置文件作用 MyBatis配置文件包含影响 MyBatis 框架正常使用的功能设置和属性信息.它的作用好比手机里的设置图标,点击这个图标就可以帮助我们查看手机的属性信息和设置功能.其 ...

  10. Nginx配置配置文件详解

    文章目录 配置文件 nginx.conf配置文件详解 用于调试.定位问题的配置参数 正常运行必备的配置参数 优化性能的配置参数 事件相关配置 Fastcgi相关配置参数 常需要调整的参数 nginx作 ...

随机推荐

  1. 重啓ubuntu后 VNC 自動運行

    Vino-Server是Ubuntu自带的有個缺点:重启后不能自動運行(可能是基於安全吧!) 親身測試对象:windows & ubuntu 10.04已安装图形桌面gnome ***wind ...

  2. struts2 与spring整合

    要把struts2的action交给spring管理,这样spring才干帮struts2注入须要的的bean(一開始action是由struts初始化,所以想注入spring里面的bean是注入不了 ...

  3. android 4.0主线程訪问网络问题

    在4.0下面,在主线程中訪问网络,假设请求超过6s的话,就会报ANR,那么这就会带来一个问题,假设网络慢或者请求的数据过大时,界面会卡顿,造成界面灵敏性非常差,因此网络请求一般不能放在主线程中操作,g ...

  4. 三种常见的编码:ASCII码、UTF-8编码、Unicode编码等字符占领的字节数

    ASCII码: 一个英文字母(不分大写和小写)占一个字节的空间.一个中文汉字占两个字节的空间. 一个二进制数字序列,在计算机中作为一个数字单元,一般为8位二进制数,换算为十进制. 最小值0,最大值25 ...

  5. java学习笔记:Eclipse打开现有项目

    初学JAVA,觉得困难重重. 多年来,已经习惯了微软系列的VS,现在使用Eclipse,觉得差别很大. 比如打开一个现有项目.并没有什么所谓的项目文件,如*.sln,*.cproj什么的.那怎么打开? ...

  6. bzoj1805: [Ioi2007]Sail 船帆

    可以发现旗杆的顺序是没有用的,对于每列,它的答案是它的最大值mx*(mx+1)/2 高度由小到大排序旗杆,问题可以转化为在前h行选k个最小的值 考虑激情splay乱搞(我只会splay......) ...

  7. cookie domain and cookie path

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie Domain=<domain-value> Opt ...

  8. 修改select默认样式

    http://www.qkzone.com/code/2015-11-26/1.html

  9. CodePlus 2017 12 月赛

    这场比赛跟个zz一样 div1卡在了同余方程上 心态崩了去做div2 然后被T1搞崩了 T1: 大模拟 比较像配平方程式 思路: 但是未知物质每种元素系数不能≥10 且不能为空 (如CO2+?=CO2 ...

  10. PCB genesis加尾孔实现方法

    一.为什么增加尾孔呢 看一看下图在panel中增加尾孔的效果;如下图所示,主要有2点原因. 1.孔径大小测量 假设如果不增加尾孔,要检测孔径大小是否符合要求,那么QA检测会选择最后钻的孔进大小进行测量 ...