免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 12701 | 回复: 3
打印 上一主题 下一主题

[FastDFS] FastDFS同步问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-08-11 15:42 |只看该作者 |倒序浏览
本帖最后由 hudingchen 于 2017-08-11 16:36 编辑

安装了FastDFS环境,可以正常上传下载文件,但是同一group的storage始终不同步,显示 WAIT_SYNC,请问什么问题??
  1. fdfs_monitor /etc/fdfs/client.conf
  2. [2017-08-11 15:31:23] DEBUG - base_path=/home/fastdfs, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0

  3. server_count=1, server_index=0

  4. tracker server is 49.4.104.16:22122

  5. group count: 1

  6. Group 1:
  7. group name = group1
  8. disk total space = 36156 MB
  9. disk free space = 31637 MB
  10. trunk free space = 0 MB
  11. storage server count = 2
  12. active server count = 1
  13. storage server port = 23000
  14. storage HTTP port = 8888
  15. store path count = 1
  16. subdir count per path = 256
  17. current write server index = 0
  18. current trunk file id = 0

  19.         Storage 1:
  20.                 id = 49.4.104.18
  21.                 ip_addr = 49.4.104.18  ACTIVE
  22.                 http domain =
  23.                 version = 5.12
  24.                 join time = 2017-08-11 13:33:44
  25.                 up time = 2017-08-11 13:33:44
  26.                 total storage = 39061 MB
  27.                 free storage = 35056 MB
  28.                 upload priority = 10
  29.                 store_path_count = 1
  30.                 subdir_count_per_path = 256
  31.                 storage_port = 23000
  32.                 storage_http_port = 8888
  33.                 current_write_path = 0
  34.                 source storage id =
  35.                 if_trunk_server = 0
  36.                 connection.alloc_count = 256
  37.                 connection.current_count = 0
  38.                 connection.max_count = 1
  39.                 total_upload_count = 2
  40.                 success_upload_count = 2
  41.                 total_append_count = 0
  42.                 success_append_count = 0
  43.                 total_modify_count = 0
  44.                 success_modify_count = 0
  45.                 total_truncate_count = 0
  46.                 success_truncate_count = 0
  47.                 total_set_meta_count = 2
  48.                 success_set_meta_count = 2
  49.                 total_delete_count = 0
  50.                 success_delete_count = 0
  51.                 total_download_count = 0
  52.                 success_download_count = 0
  53.                 total_get_meta_count = 0
  54.                 success_get_meta_count = 0
  55.                 total_create_link_count = 0
  56.                 success_create_link_count = 0
  57.                 total_delete_link_count = 0
  58.                 success_delete_link_count = 0
  59.                 total_upload_bytes = 16
  60.                 success_upload_bytes = 16
  61.                 total_append_bytes = 0
  62.                 success_append_bytes = 0
  63.                 total_modify_bytes = 0
  64.                 success_modify_bytes = 0
  65.                 stotal_download_bytes = 0
  66.                 success_download_bytes = 0
  67.                 total_sync_in_bytes = 0
  68.                 success_sync_in_bytes = 0
  69.                 total_sync_out_bytes = 0
  70.                 success_sync_out_bytes = 0
  71.                 total_file_open_count = 2
  72.                 success_file_open_count = 2
  73.                 total_file_read_count = 0
  74.                 success_file_read_count = 0
  75.                 total_file_write_count = 2
  76.                 success_file_write_count = 2
  77.                 last_heart_beat_time = 2017-08-11 15:31:22
  78.                 last_source_update = 2017-08-11 14:40:12
  79.                 last_sync_update = 1970-01-01 08:00:00
  80.                 last_synced_timestamp = 1970-01-01 08:00:00
  81.         Storage 2:
  82.                 id = 49.4.104.21
  83.                 ip_addr = 49.4.104.21  WAIT_SYNC
  84.                 http domain =
  85.                 version = 5.12
  86.                 join time = 2017-08-11 14:30:44
  87.                 up time = 2017-08-11 14:33:23
  88.                 total storage = 36156 MB
  89.                 free storage = 31637 MB
  90.                 upload priority = 10
  91.                 store_path_count = 1
  92.                 subdir_count_per_path = 256
  93.                 storage_port = 23000
  94.                 storage_http_port = 8888
  95.                 current_write_path = 0
  96.                 source storage id = 49.4.104.18
  97.                 if_trunk_server = 0
  98.                 connection.alloc_count = 256
  99.                 connection.current_count = 0
  100.                 connection.max_count = 0
  101.                 total_upload_count = 0
  102.                 success_upload_count = 0
  103.                 total_append_count = 0
  104.                 success_append_count = 0
  105.                 total_modify_count = 0
  106.                 success_modify_count = 0
  107.                 total_truncate_count = 0
  108.                 success_truncate_count = 0
  109.                 total_set_meta_count = 0
  110.                 success_set_meta_count = 0
  111.                 total_delete_count = 0
  112.                 success_delete_count = 0
  113.                 total_download_count = 0
  114.                 success_download_count = 0
  115.                 total_get_meta_count = 0
  116.                 success_get_meta_count = 0
  117.                 total_create_link_count = 0
  118.                 success_create_link_count = 0
  119.                 total_delete_link_count = 0
  120.                 success_delete_link_count = 0
  121.                 total_upload_bytes = 0
  122.                 success_upload_bytes = 0
  123.                 total_append_bytes = 0
  124.                 success_append_bytes = 0
  125.                 total_modify_bytes = 0
  126.                 success_modify_bytes = 0
  127.                 stotal_download_bytes = 0
  128.                 success_download_bytes = 0
  129.                 total_sync_in_bytes = 0
  130.                 success_sync_in_bytes = 0
  131.                 total_sync_out_bytes = 0
  132.                 success_sync_out_bytes = 0
  133.                 total_file_open_count = 0
  134.                 success_file_open_count = 0
  135.                 total_file_read_count = 0
  136.                 success_file_read_count = 0
  137.                 total_file_write_count = 0
  138.                 success_file_write_count = 0
  139.                 last_heart_beat_time = 2017-08-11 15:31:19
  140.                 last_source_update = 1970-01-01 08:00:00
  141.                 last_sync_update = 1970-01-01 08:00:00
  142.                 last_synced_timestamp = 1970-01-01 08:00:00 (never synced)
复制代码

环境配置说明:
fastdfs     v5.12
fastdfs-nginx-module    v1.16
nginx    v1.10.3
3台服务器(1个tracker+2个storage)

tracker-server     49.4.104.16
storage1-server    49.4.104.18
storage2-server    49.4.104.21
storage1 storage.conf
  1. vim /etc/fdfs/storage.conf
复制代码
  1. # is this config file disabled
  2. # false for enabled
  3. # true for disabled
  4. disabled=false

  5. # the name of the group this storage server belongs to
  6. #
  7. # comment or remove this item for fetching from tracker server,
  8. # in this case, use_storage_id must set to true in tracker.conf,
  9. # and storage_ids.conf must be configed correctly.
  10. group_name=group1

  11. # bind an address of this host
  12. # empty for bind all addresses of this host
  13. bind_addr=

  14. # if bind an address of this host when connect to other servers
  15. # (this storage server as a client)
  16. # true for binding the address configed by above parameter: "bind_addr"
  17. # false for binding any address of this host
  18. client_bind=true

  19. # the storage server port
  20. port=23000

  21. # connect timeout in seconds
  22. # default value is 30s
  23. connect_timeout=30

  24. # network timeout in seconds
  25. # default value is 30s
  26. network_timeout=60

  27. # heart beat interval in seconds
  28. heart_beat_interval=30

  29. # disk usage report interval in seconds
  30. stat_report_interval=60

  31. # the base path to store data and log files
  32. base_path=/home/fastdfs

  33. # max concurrent connections the server supported
  34. # default value is 256
  35. # more max_connections means more memory will be used
  36. max_connections=256

  37. # the buff size to recv / send data
  38. # this parameter must more than 8KB
  39. # default value is 64KB
  40. # since V2.00
  41. buff_size = 256KB

  42. # accept thread count
  43. # default value is 1
  44. # since V4.07
  45. accept_threads=1

  46. # work thread count, should <= max_connections
  47. # work thread deal network io
  48. # default value is 4
  49. # since V2.00
  50. work_threads=4

  51. # if disk read / write separated
  52. ##  false for mixed read and write
  53. ##  true for separated read and write
  54. # default value is true
  55. # since V2.00
  56. disk_rw_separated = true

  57. # disk reader thread count per store base path
  58. # for mixed read / write, this parameter can be 0
  59. # default value is 1
  60. # since V2.00
  61. disk_reader_threads = 1

  62. # disk writer thread count per store base path
  63. # for mixed read / write, this parameter can be 0
  64. # default value is 1
  65. # since V2.00
  66. disk_writer_threads = 1

  67. # when no entry to sync, try read binlog again after X milliseconds
  68. # must > 0, default value is 200ms
  69. sync_wait_msec=50

  70. # after sync a file, usleep milliseconds
  71. # 0 for sync successively (never call usleep)
  72. sync_interval=0

  73. # storage sync start time of a day, time format: Hour:Minute
  74. # Hour from 0 to 23, Minute from 0 to 59
  75. sync_start_time=00:00

  76. # storage sync end time of a day, time format: Hour:Minute
  77. # Hour from 0 to 23, Minute from 0 to 59
  78. sync_end_time=23:59

  79. # write to the mark file after sync N files
  80. # default value is 500
  81. write_mark_file_freq=500

  82. # path(disk or mount point) count, default value is 1
  83. store_path_count=1

  84. # store_path#, based 0, if store_path0 not exists, it's value is base_path
  85. # the paths must be exist
  86. store_path0=/home/fastdfs/storage0
  87. #store_path1=/home/yuqing/fastdfs2

  88. # subdir_count  * subdir_count directories will be auto created under each
  89. # store_path (disk), value can be 1 to 256, default value is 256
  90. subdir_count_per_path=256

  91. # tracker_server can ocur more than once, and tracker_server format is
  92. #  "host:port", host can be hostname or ip address
  93. tracker_server=49.4.104.16:22122

  94. #standard log level as syslog, case insensitive, value list:
  95. ### emerg for emergency
  96. ### alert
  97. ### crit for critical
  98. ### error
  99. ### warn for warning
  100. ### notice
  101. ### info
  102. ### debug
  103. log_level=info

  104. #unix group name to run this program,
  105. #not set (empty) means run by the group of current user
  106. run_by_group=

  107. #unix username to run this program,
  108. #not set (empty) means run by current user
  109. run_by_user=

  110. # allow_hosts can ocur more than once, host can be hostname or ip address,
  111. # "*" (only one asterisk) means match all ip addresses
  112. # we can use CIDR ips like 192.168.5.64/26
  113. # and also use range like these: 10.0.1.[0-254] and host[01-08,20-25].domain.com
  114. # for example:
  115. # allow_hosts=10.0.1.[1-15,20]
  116. # allow_hosts=host[01-08,20-25].domain.com
  117. # allow_hosts=192.168.5.64/26
  118. allow_hosts=*

  119. # the mode of the files distributed to the data path
  120. # 0: round robin(default)
  121. # 1: random, distributted by hash code
  122. file_distribute_path_mode=0

  123. # valid when file_distribute_to_path is set to 0 (round robin),
  124. # when the written file count reaches this number, then rotate to next path
  125. # default value is 100
  126. file_distribute_rotate_count=100

  127. # call fsync to disk when write big file
  128. # 0: never call fsync
  129. # other: call fsync when written bytes >= this bytes
  130. # default value is 0 (never call fsync)
  131. fsync_after_written_bytes=0

  132. # sync log buff to disk every interval seconds
  133. # must > 0, default value is 10 seconds
  134. sync_log_buff_interval=10

  135. # sync binlog buff / cache to disk every interval seconds
  136. # default value is 60 seconds
  137. sync_binlog_buff_interval=10

  138. # sync storage stat info to disk every interval seconds
  139. # default value is 300 seconds
  140. sync_stat_file_interval=300

  141. # thread stack size, should >= 512KB
  142. # default value is 512KB
  143. thread_stack_size=512KB

  144. # the priority as a source server for uploading file.
  145. # the lower this value, the higher its uploading priority.
  146. # default value is 10
  147. upload_priority=10

  148. # the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a
  149. # multi aliases split by comma. empty value means auto set by OS type
  150. # default values is empty
  151. if_alias_prefix=

  152. # if check file duplicate, when set to true, use FastDHT to store file indexes
  153. # 1 or yes: need check
  154. # 0 or no: do not check
  155. # default value is 0
  156. check_file_duplicate=0

  157. # file signature method for check file duplicate
  158. ## hash: four 32 bits hash code
  159. ## md5: MD5 signature
  160. # default value is hash
  161. # since V4.01
  162. file_signature_method=hash

  163. # namespace for storing file indexes (key-value pairs)
  164. # this item must be set when check_file_duplicate is true / on
  165. key_namespace=FastDFS

  166. # set keep_alive to 1 to enable persistent connection with FastDHT servers
  167. # default value is 0 (short connection)
  168. keep_alive=0

  169. # you can use "#include filename" (not include double quotes) directive to
  170. # load FastDHT server list, when the filename is a relative path such as
  171. # pure filename, the base path is the base path of current/this config file.
  172. # must set FastDHT server list when check_file_duplicate is true / on
  173. # please see INSTALL of FastDHT for detail
  174. ##include /home/yuqing/fastdht/conf/fdht_servers.conf

  175. # if log to access log
  176. # default value is false
  177. # since V4.00
  178. use_access_log = false

  179. # if rotate the access log every day
  180. # default value is false
  181. # since V4.00
  182. rotate_access_log = false

  183. # rotate access log time base, time format: Hour:Minute
  184. # Hour from 0 to 23, Minute from 0 to 59
  185. # default value is 00:00
  186. # since V4.00
  187. access_log_rotate_time=00:00

  188. # if rotate the error log every day
  189. # default value is false
  190. # since V4.02
  191. rotate_error_log = false

  192. # rotate error log time base, time format: Hour:Minute
  193. # Hour from 0 to 23, Minute from 0 to 59
  194. # default value is 00:00
  195. # since V4.02
  196. error_log_rotate_time=00:00

  197. # rotate access log when the log file exceeds this size
  198. # 0 means never rotates log file by log file size
  199. # default value is 0
  200. # since V4.02
  201. rotate_access_log_size = 0

  202. # rotate error log when the log file exceeds this size
  203. # 0 means never rotates log file by log file size
  204. # default value is 0
  205. # since V4.02
  206. rotate_error_log_size = 0

  207. # keep days of the log files
  208. # 0 means do not delete old log files
  209. # default value is 0
  210. log_file_keep_days = 0

  211. # if skip the invalid record when sync file
  212. # default value is false
  213. # since V4.02
  214. file_sync_skip_invalid_record=false

  215. # if use connection pool
  216. # default value is false
  217. # since V4.05
  218. use_connection_pool = false

  219. # connections whose the idle time exceeds this time will be closed
  220. # unit: second
  221. # default value is 3600
  222. # since V4.05
  223. connection_pool_max_idle_time = 3600

  224. # use the ip address of this storage server if domain_name is empty,
  225. # else this domain name will ocur in the url redirected by the tracker server
  226. http.domain_name=

  227. # the port of the web server on this storage server
  228. http.server_port=8888
复制代码

storage2 storage.conf
  1. # is this config file disabled
  2. # false for enabled
  3. # true for disabled
  4. disabled=false

  5. # the name of the group this storage server belongs to
  6. #
  7. # comment or remove this item for fetching from tracker server,
  8. # in this case, use_storage_id must set to true in tracker.conf,
  9. # and storage_ids.conf must be configed correctly.
  10. group_name=group1

  11. # bind an address of this host
  12. # empty for bind all addresses of this host
  13. bind_addr=

  14. # if bind an address of this host when connect to other servers
  15. # (this storage server as a client)
  16. # true for binding the address configed by above parameter: "bind_addr"
  17. # false for binding any address of this host
  18. client_bind=true

  19. # the storage server port
  20. port=23000

  21. # connect timeout in seconds
  22. # default value is 30s
  23. connect_timeout=30

  24. # network timeout in seconds
  25. # default value is 30s
  26. network_timeout=60

  27. # heart beat interval in seconds
  28. heart_beat_interval=30

  29. # disk usage report interval in seconds
  30. stat_report_interval=60

  31. # the base path to store data and log files
  32. base_path=/home/fastdfs

  33. # max concurrent connections the server supported
  34. # default value is 256
  35. # more max_connections means more memory will be used
  36. max_connections=256

  37. # the buff size to recv / send data
  38. # this parameter must more than 8KB
  39. # default value is 64KB
  40. # since V2.00
  41. buff_size = 256KB

  42. # accept thread count
  43. # default value is 1
  44. # since V4.07
  45. accept_threads=1

  46. # work thread count, should <= max_connections
  47. # work thread deal network io
  48. # default value is 4
  49. # since V2.00
  50. work_threads=4

  51. # if disk read / write separated
  52. ##  false for mixed read and write
  53. ##  true for separated read and write
  54. # default value is true
  55. # since V2.00
  56. disk_rw_separated = true

  57. # disk reader thread count per store base path
  58. # for mixed read / write, this parameter can be 0
  59. # default value is 1
  60. # since V2.00
  61. disk_reader_threads = 1

  62. # disk writer thread count per store base path
  63. # for mixed read / write, this parameter can be 0
  64. # default value is 1
  65. # since V2.00
  66. disk_writer_threads = 1

  67. # when no entry to sync, try read binlog again after X milliseconds
  68. # must > 0, default value is 200ms
  69. sync_wait_msec=50

  70. # after sync a file, usleep milliseconds
  71. # 0 for sync successively (never call usleep)
  72. sync_interval=0

  73. # storage sync start time of a day, time format: Hour:Minute
  74. # Hour from 0 to 23, Minute from 0 to 59
  75. sync_start_time=00:00

  76. # storage sync end time of a day, time format: Hour:Minute
  77. # Hour from 0 to 23, Minute from 0 to 59
  78. sync_end_time=23:59

  79. # write to the mark file after sync N files
  80. # default value is 500
  81. write_mark_file_freq=500

  82. # path(disk or mount point) count, default value is 1
  83. store_path_count=1

  84. # store_path#, based 0, if store_path0 not exists, it's value is base_path
  85. # the paths must be exist
  86. store_path0=/home/fastdfs/storage0
  87. #store_path1=/home/yuqing/fastdfs2

  88. # subdir_count  * subdir_count directories will be auto created under each
  89. # store_path (disk), value can be 1 to 256, default value is 256
  90. subdir_count_per_path=256

  91. # tracker_server can ocur more than once, and tracker_server format is
  92. #  "host:port", host can be hostname or ip address
  93. tracker_server=49.4.104.16:22122

  94. #standard log level as syslog, case insensitive, value list:
  95. ### emerg for emergency
  96. ### alert
  97. ### crit for critical
  98. ### error
  99. ### warn for warning
  100. ### notice
  101. ### info
  102. ### debug
  103. log_level=info

  104. #unix group name to run this program,
  105. #not set (empty) means run by the group of current user
  106. run_by_group=

  107. #unix username to run this program,
  108. #not set (empty) means run by current user
  109. run_by_user=

  110. # allow_hosts can ocur more than once, host can be hostname or ip address,
  111. # "*" (only one asterisk) means match all ip addresses
  112. # we can use CIDR ips like 192.168.5.64/26
  113. # and also use range like these: 10.0.1.[0-254] and host[01-08,20-25].domain.com
  114. # for example:
  115. # allow_hosts=10.0.1.[1-15,20]
  116. # allow_hosts=host[01-08,20-25].domain.com
  117. # allow_hosts=192.168.5.64/26
  118. allow_hosts=*

  119. # the mode of the files distributed to the data path
  120. # 0: round robin(default)
  121. # 1: random, distributted by hash code
  122. file_distribute_path_mode=0

  123. # valid when file_distribute_to_path is set to 0 (round robin),
  124. # when the written file count reaches this number, then rotate to next path
  125. # default value is 100
  126. file_distribute_rotate_count=100

  127. # call fsync to disk when write big file
  128. # 0: never call fsync
  129. # other: call fsync when written bytes >= this bytes
  130. # default value is 0 (never call fsync)
  131. fsync_after_written_bytes=0

  132. # sync log buff to disk every interval seconds
  133. # must > 0, default value is 10 seconds
  134. sync_log_buff_interval=10

  135. # sync binlog buff / cache to disk every interval seconds
  136. # default value is 60 seconds
  137. sync_binlog_buff_interval=10

  138. # sync storage stat info to disk every interval seconds
  139. # default value is 300 seconds
  140. sync_stat_file_interval=300

  141. # thread stack size, should >= 512KB
  142. # default value is 512KB
  143. thread_stack_size=512KB

  144. # the priority as a source server for uploading file.
  145. # the lower this value, the higher its uploading priority.
  146. # default value is 10
  147. upload_priority=10

  148. # the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a
  149. # multi aliases split by comma. empty value means auto set by OS type
  150. # default values is empty
  151. if_alias_prefix=

  152. # if check file duplicate, when set to true, use FastDHT to store file indexes
  153. # 1 or yes: need check
  154. # 0 or no: do not check
  155. # default value is 0
  156. check_file_duplicate=0

  157. # file signature method for check file duplicate
  158. ## hash: four 32 bits hash code
  159. ## md5: MD5 signature
  160. # default value is hash
  161. # since V4.01
  162. file_signature_method=hash

  163. # namespace for storing file indexes (key-value pairs)
  164. # this item must be set when check_file_duplicate is true / on
  165. key_namespace=FastDFS

  166. # set keep_alive to 1 to enable persistent connection with FastDHT servers
  167. # default value is 0 (short connection)
  168. keep_alive=0

  169. # you can use "#include filename" (not include double quotes) directive to
  170. # load FastDHT server list, when the filename is a relative path such as
  171. # pure filename, the base path is the base path of current/this config file.
  172. # must set FastDHT server list when check_file_duplicate is true / on
  173. # please see INSTALL of FastDHT for detail
  174. ##include /home/yuqing/fastdht/conf/fdht_servers.conf

  175. # if log to access log
  176. # default value is false
  177. # since V4.00
  178. use_access_log = false

  179. # if rotate the access log every day
  180. # default value is false
  181. # since V4.00
  182. rotate_access_log = false

  183. # rotate access log time base, time format: Hour:Minute
  184. # Hour from 0 to 23, Minute from 0 to 59
  185. # default value is 00:00
  186. # since V4.00
  187. access_log_rotate_time=00:00

  188. # if rotate the error log every day
  189. # default value is false
  190. # since V4.02
  191. rotate_error_log = false

  192. # rotate error log time base, time format: Hour:Minute
  193. # Hour from 0 to 23, Minute from 0 to 59
  194. # default value is 00:00
  195. # since V4.02
  196. error_log_rotate_time=00:00

  197. # rotate access log when the log file exceeds this size
  198. # 0 means never rotates log file by log file size
  199. # default value is 0
  200. # since V4.02
  201. rotate_access_log_size = 0

  202. # rotate error log when the log file exceeds this size
  203. # 0 means never rotates log file by log file size
  204. # default value is 0
  205. # since V4.02
  206. rotate_error_log_size = 0

  207. # keep days of the log files
  208. # 0 means do not delete old log files
  209. # default value is 0
  210. log_file_keep_days = 0

  211. # if skip the invalid record when sync file
  212. # default value is false
  213. # since V4.02
  214. file_sync_skip_invalid_record=false

  215. # if use connection pool
  216. # default value is false
  217. # since V4.05
  218. use_connection_pool = false

  219. # connections whose the idle time exceeds this time will be closed
  220. # unit: second
  221. # default value is 3600
  222. # since V4.05
  223. connection_pool_max_idle_time = 3600

  224. # use the ip address of this storage server if domain_name is empty,
  225. # else this domain name will ocur in the url redirected by the tracker server
  226. http.domain_name=

  227. # the port of the web server on this storage server
  228. http.server_port=8888
复制代码

storage1 /usr/local/nginx/conf/nginx.conf 追加了如下
  1. server {
  2.     listen 8888;
  3.     server_name 49.4.104.18;

  4.     location /group1/M00 {
  5.         ngx_fastdfs_module;
  6.     }
  7. }
复制代码

storage2 /usr/local/nginx/conf/nginx.conf 追加了如下

  1. server {
  2.     listen 8888;
  3.     server_name 49.4.104.21;

  4.     location /group1/M00 {
  5.         ngx_fastdfs_module;
  6.     }
  7. }
复制代码

storage1 /etc/fdfs/mod_fastdfs.conf
  1. # connect timeout in seconds
  2. # default value is 30s
  3. connect_timeout=2

  4. # network recv and send timeout in seconds
  5. # default value is 30s
  6. network_timeout=30

  7. # the base path to store log files
  8. base_path=/home/fastdfs

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

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

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

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

  30. # FastDFS tracker_server can ocur more than once, and tracker_server format is
  31. #  "host:port", host can be hostname or ip address
  32. # valid only when load_fdfs_parameters_from_tracker is true
  33. tracker_server=49.4.104.16:22122

  34. # the port of the local storage server
  35. # the default value is 23000
  36. storage_server_port=23000

  37. # the group name of the local storage server
  38. group_name=group1

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

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

  47. # store_path#, based 0, if store_path0 not exists, it's value is base_path
  48. # the paths must be exist
  49. # must same as storage.conf
  50. store_path0=/home/fastdfs/storage0
  51. #store_path1=/home/yuqing/fastdfs1

  52. # standard log level as syslog, case insensitive, value list:
  53. ### emerg for emergency
  54. ### alert
  55. ### crit for critical
  56. ### error
  57. ### warn for warning
  58. ### notice
  59. ### info
  60. ### debug
  61. log_level=info

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

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

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

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


  77. # if support flv
  78. # default value is false
  79. # since v1.15
  80. flv_support = true

  81. # flv file extension name
  82. # default value is flv
  83. # since v1.15
  84. flv_extension = flv


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

  92. # group settings for group #1
  93. # since v1.14
  94. # when support multi-group, uncomment following section
  95. #[group1]
  96. #group_name=group1
  97. #storage_server_port=23000
  98. #store_path_count=2
  99. #store_path0=/home/yuqing/fastdfs
  100. #store_path1=/home/yuqing/fastdfs1

  101. # group settings for group #2
  102. # since v1.14
  103. # when support multi-group, uncomment following section as neccessary
  104. #[group2]
  105. #group_name=group2
  106. #storage_server_port=23000
  107. #store_path_count=1
  108. #store_path0=/home/yuqing/fastdfs
复制代码
  1. # connect timeout in seconds
  2. # default value is 30s
  3. connect_timeout=2

  4. # network recv and send timeout in seconds
  5. # default value is 30s
  6. network_timeout=30

  7. # the base path to store log files
  8. base_path=/home/fastdfs

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

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

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

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

  30. # FastDFS tracker_server can ocur more than once, and tracker_server format is
  31. #  "host:port", host can be hostname or ip address
  32. # valid only when load_fdfs_parameters_from_tracker is true
  33. tracker_server=49.4.104.16:22122

  34. # the port of the local storage server
  35. # the default value is 23000
  36. storage_server_port=23000

  37. # the group name of the local storage server
  38. group_name=group1

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

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

  47. # store_path#, based 0, if store_path0 not exists, it's value is base_path
  48. # the paths must be exist
  49. # must same as storage.conf
  50. store_path0=/home/fastdfs/storage0
  51. #store_path1=/home/yuqing/fastdfs1

  52. # standard log level as syslog, case insensitive, value list:
  53. ### emerg for emergency
  54. ### alert
  55. ### crit for critical
  56. ### error
  57. ### warn for warning
  58. ### notice
  59. ### info
  60. ### debug
  61. log_level=info

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

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

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

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


  77. # if support flv
  78. # default value is false
  79. # since v1.15
  80. flv_support = true

  81. # flv file extension name
  82. # default value is flv
  83. # since v1.15
  84. flv_extension = flv


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

  92. # group settings for group #1
  93. # since v1.14
  94. # when support multi-group, uncomment following section
  95. #[group1]
  96. #group_name=group1
  97. #storage_server_port=23000
  98. #store_path_count=2
  99. #store_path0=/home/yuqing/fastdfs
  100. #store_path1=/home/yuqing/fastdfs1

  101. # group settings for group #2
  102. # since v1.14
  103. # when support multi-group, uncomment following section as neccessary
  104. #[group2]
  105. #group_name=group2
  106. #storage_server_port=23000
  107. #store_path_count=1
  108. #store_path0=/home/yuqing/fastdfs
复制代码
storage2 /etc/fdfs/mod_fastdfs.conf
  1. # connect timeout in seconds
  2. # default value is 30s
  3. connect_timeout=2

  4. # network recv and send timeout in seconds
  5. # default value is 30s
  6. network_timeout=30

  7. # the base path to store log files
  8. base_path=/home/fastdfs

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

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

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

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

  30. # FastDFS tracker_server can ocur more than once, and tracker_server format is
  31. #  "host:port", host can be hostname or ip address
  32. # valid only when load_fdfs_parameters_from_tracker is true
  33. tracker_server=49.4.104.16:22122

  34. # the port of the local storage server
  35. # the default value is 23000
  36. storage_server_port=23000

  37. # the group name of the local storage server
  38. group_name=group1

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

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

  47. # store_path#, based 0, if store_path0 not exists, it's value is base_path
  48. # the paths must be exist
  49. # must same as storage.conf
  50. store_path0=/home/fastdfs/storage0
  51. #store_path1=/home/yuqing/fastdfs1

  52. # standard log level as syslog, case insensitive, value list:
  53. ### emerg for emergency
  54. ### alert
  55. ### crit for critical
  56. ### error
  57. ### warn for warning
  58. ### notice
  59. ### info
  60. ### debug
  61. log_level=info

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

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

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

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


  77. # if support flv
  78. # default value is false
  79. # since v1.15
  80. flv_support = true

  81. # flv file extension name
  82. # default value is flv
  83. # since v1.15
  84. flv_extension = flv


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

  92. # group settings for group #1
  93. # since v1.14
  94. # when support multi-group, uncomment following section
  95. #[group1]
  96. #group_name=group1
  97. #storage_server_port=23000
  98. #store_path_count=2
  99. #store_path0=/home/yuqing/fastdfs
  100. #store_path1=/home/yuqing/fastdfs1

  101. # group settings for group #2
  102. # since v1.14
  103. # when support multi-group, uncomment following section as neccessary
  104. #[group2]
  105. #group_name=group2
  106. #storage_server_port=23000
  107. #store_path_count=1
  108. #store_path0=/home/yuqing/fastdfs
复制代码
storage1 /home/fastdfs/logs/storaged.log
  1. mkdir data path: FE ...
  2. mkdir data path: FF ...
  3. data path: /home/fastdfs/storage0/data, mkdir sub dir done.
  4. [2017-08-11 13:33:52] INFO - file: storage_param_getter.c, line: 191, use_storage_id=0, id_type_in_filename=ip, storage_ip_changed_auto_adjust=1, store_path=0, reserved_storage_space=10.00%, use_trunk_file=0, slot_min_size=256, slot_max_size=16 MB, trunk_file_size=64 MB, trunk_create_file_advance=0, trunk_create_file_time_base=02:00, trunk_create_file_interval=86400, trunk_create_file_space_threshold=20 GB, trunk_init_check_occupying=0, trunk_init_reload_from_binlog=0, trunk_compress_binlog_min_interval=0, store_slave_file_use_link=0
  5. [2017-08-11 13:33:52] INFO - file: storage_func.c, line: 257, tracker_client_ip: 192.168.0.8, my_server_id_str: 192.168.0.8, g_server_id_in_filename: 134260928
  6. [2017-08-11 13:33:52] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 49.4.104.16:22122, as a tracker client, my ip is 192.168.0.8
复制代码
storage2 /home/fastdfs/logs/storaged.log
  1. [2017-08-11 14:33:23] INFO - FastDFS v5.12, base_path=/home/fastdfs, store_path_count=1, subdir_count_per_path=256, group_name=group1, run_by_group=, run_by_user=, connect_timeout=30s, network_timeout=60s, port=23000, bind_addr=, client_bind=1, max_connections=256, accept_threads=1, work_threads=4, disk_rw_separated=1, disk_reader_threads=1, disk_writer_threads=1, buff_size=256KB, heart_beat_interval=30s, stat_report_interval=60s, tracker_server_count=1, sync_wait_msec=50ms, sync_interval=0ms, sync_start_time=00:00, sync_end_time=23:59, write_mark_file_freq=500, allow_ip_count=-1, file_distribute_path_mode=0, file_distribute_rotate_count=100, fsync_after_written_bytes=0, sync_log_buff_interval=10s, sync_binlog_buff_interval=10s, sync_stat_file_interval=300s, thread_stack_size=512 KB, upload_priority=10, if_alias_prefix=, check_file_duplicate=0, file_signature_method=hash, FDHT group count=0, FDHT server count=0, FDHT key_namespace=, FDHT keep_alive=0, HTTP server port=8888, domain name=, use_access_log=0, rotate_access_log=0, access_log_rotate_time=00:00, rotate_error_log=0, 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=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s
  2. [2017-08-11 14:33:23] INFO - file: storage_param_getter.c, line: 191, use_storage_id=0, id_type_in_filename=ip, storage_ip_changed_auto_adjust=1, store_path=0, reserved_storage_space=10.00%, use_trunk_file=0, slot_min_size=256, slot_max_size=16 MB, trunk_file_size=64 MB, trunk_create_file_advance=0, trunk_create_file_time_base=02:00, trunk_create_file_interval=86400, trunk_create_file_space_threshold=20 GB, trunk_init_check_occupying=0, trunk_init_reload_from_binlog=0, trunk_compress_binlog_min_interval=0, store_slave_file_use_link=0
  3. [2017-08-11 14:33:23] INFO - file: storage_func.c, line: 257, tracker_client_ip: 192.168.0.6, my_server_id_str: 192.168.0.6, g_server_id_in_filename: 100706496
  4. [2017-08-11 14:33:23] ERROR - file: tracker_proto.c, line: 48, server: 49.4.104.16:22122, response status 2 != 0
  5. [2017-08-11 14:33:23] ERROR - file: tracker_client_thread.c, line: 2377, fdfs_recv_response fail, result: 2
  6. [2017-08-11 14:33:23] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 49.4.104.16:22122, as a tracker client, my ip is 192.168.0.6
复制代码

论坛徽章:
0
2 [报告]
发表于 2017-08-15 13:48 |只看该作者
问题解决了,搞了两天,切换到旧版的fastdfs后,可以正常同步,貌似新版的bug

论坛徽章:
0
3 [报告]
发表于 2017-10-16 17:31 |只看该作者

论坛徽章:
0
4 [报告]
发表于 2018-08-01 09:52 |只看该作者
您好  初次接触fast  同步  您第一个配置 是在哪个文件啊  两个外网机器如何实现同步
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP