首页   注册   登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
华为云
V2EX  ›  问与答

FastDFS 同一组内的文件不同步

  •  
  •   chuanqirenwu · 129 天前 · 456 次点击
    这是一个创建于 129 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我在 5 台服务器上部署了一个 fastdfs 文件集群,分配如下:

    tracker1:117.48.231.77 tracker2:117.48.231.99

    [group1] 117.48.231.94 117.48.231.88

    [group2] 117.48.231.84

    可以上传文件到两个 group 的 storage 里。 但现在的问题是,如果传文件到[group1],集群只会把文件传到 117.48.231.88 ,而 117.48.231.94 的文件不会同步,集群也不会传文件到 117.48.231.94 。但按照 fastdfs 上传文件的机制,[group1]中的 storage 应该都有机会被选中,而文件上传后两台存储的文件应该自动同步。

    相关的日志如下:

    [2018-07-13 09:09:53] DEBUG - base_path=/fastdfs/storage, connect_timeout=30, network_timeout=60, tracker_server_count=2, 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
    
    server_count=2, server_index=0
    
    tracker server is 117.48.231.77:22122
    
    group count: 2
    
    Group 1:
    group name = group1
    disk total space = 40252 MB
    disk free space = 36654 MB
    trunk free space = 0 MB
    storage server count = 2
    active server count = 2
    storage server port = 23000
    storage HTTP port = 8888
    store path count = 1
    subdir count per path = 256
    current write server index = 0
    current trunk file id = 0
    
    	Storage 1:
    		id = 117.48.231.88
    		ip_addr = 117.48.231.88  ACTIVE
    		http domain = 
    		version = 5.05
    		join time = 2018-07-12 14:33:29
    		up time = 2018-07-13 08:40:09
    		total storage = 40252 MB
    		free storage = 36654 MB
    		upload priority = 10
    		store_path_count = 1
    		subdir_count_per_path = 256
    		storage_port = 23000
    		storage_http_port = 8888
    		current_write_path = 0
    		source storage id = 
    		if_trunk_server = 0
    		connection.alloc_count = 256
    		connection.current_count = 2
    		connection.max_count = 2
    		total_upload_count = 9
    		success_upload_count = 9
    		total_append_count = 0
    		success_append_count = 0
    		total_modify_count = 0
    		success_modify_count = 0
    		total_truncate_count = 0
    		success_truncate_count = 0
    		total_set_meta_count = 0
    		success_set_meta_count = 0
    		total_delete_count = 0
    		success_delete_count = 0
    		total_download_count = 0
    		success_download_count = 0
    		total_get_meta_count = 0
    		success_get_meta_count = 0
    		total_create_link_count = 0
    		success_create_link_count = 0
    		total_delete_link_count = 0
    		success_delete_link_count = 0
    		total_upload_bytes = 1478178
    		success_upload_bytes = 1478178
    		total_append_bytes = 0
    		success_append_bytes = 0
    		total_modify_bytes = 0
    		success_modify_bytes = 0
    		stotal_download_bytes = 0
    		success_download_bytes = 0
    		total_sync_in_bytes = 165052
    		success_sync_in_bytes = 0
    		total_sync_out_bytes = 0
    		success_sync_out_bytes = 0
    		total_file_open_count = 9
    		success_file_open_count = 9
    		total_file_read_count = 0
    		success_file_read_count = 0
    		total_file_write_count = 9
    		success_file_write_count = 9
    		last_heart_beat_time = 2018-07-13 09:09:24
    		last_source_update = 2018-07-12 17:01:48
    		last_sync_update = 2018-07-12 17:01:53
    		last_synced_timestamp = 1970-01-01 08:00:00 
    	Storage 2:
    		id = 117.48.231.94
    		ip_addr = 117.48.231.94  ACTIVE
    		http domain = 
    		version = 5.05
    		join time = 2018-07-12 17:23:33
    		up time = 2018-07-13 08:40:09
    		total storage = 40252 MB
    		free storage = 36656 MB
    		upload priority = 10
    		store_path_count = 1
    		subdir_count_per_path = 256
    		storage_port = 23000
    		storage_http_port = 8888
    		current_write_path = 0
    		source storage id = 117.48.231.88
    		if_trunk_server = 0
    		connection.alloc_count = 256
    		connection.current_count = 2
    		connection.max_count = 2
    		total_upload_count = 0
    		success_upload_count = 0
    		total_append_count = 0
    		success_append_count = 0
    		total_modify_count = 0
    		success_modify_count = 0
    		total_truncate_count = 0
    		success_truncate_count = 0
    		total_set_meta_count = 0
    		success_set_meta_count = 0
    		total_delete_count = 0
    		success_delete_count = 0
    		total_download_count = 0
    		success_download_count = 0
    		total_get_meta_count = 0
    		success_get_meta_count = 0
    		total_create_link_count = 0
    		success_create_link_count = 0
    		total_delete_link_count = 0
    		success_delete_link_count = 0
    		total_upload_bytes = 0
    		success_upload_bytes = 0
    		total_append_bytes = 0
    		success_append_bytes = 0
    		total_modify_bytes = 0
    		success_modify_bytes = 0
    		stotal_download_bytes = 0
    		success_download_bytes = 0
    		total_sync_in_bytes = 0
    		success_sync_in_bytes = 0
    		total_sync_out_bytes = 0
    		success_sync_out_bytes = 0
    		total_file_open_count = 0
    		success_file_open_count = 0
    		total_file_read_count = 0
    		success_file_read_count = 0
    		total_file_write_count = 0
    		success_file_write_count = 0
    		last_heart_beat_time = 2018-07-13 09:09:26
    		last_source_update = 1970-01-01 08:00:00
    		last_sync_update = 1970-01-01 08:00:00
    		last_synced_timestamp = 1970-01-01 08:00:00 (never synced)
    
    Group 2:
    group name = group2
    disk total space = 40252 MB
    disk free space = 36603 MB
    trunk free space = 0 MB
    storage server count = 1
    active server count = 1
    storage server port = 23000
    storage HTTP port = 8888
    store path count = 1
    subdir count per path = 256
    current write server index = 0
    current trunk file id = 0
    
    	Storage 1:
    		id = 117.48.231.84
    		ip_addr = 117.48.231.84  ACTIVE
    		http domain = 
    		version = 5.05
    		join time = 2018-07-12 14:33:30
    		up time = 2018-07-13 08:40:09
    		total storage = 40252 MB
    		free storage = 36603 MB
    		upload priority = 10
    		store_path_count = 1
    		subdir_count_per_path = 256
    		storage_port = 23000
    		storage_http_port = 8888
    		current_write_path = 0
    		source storage id = 
    		if_trunk_server = 0
    		connection.alloc_count = 256
    		connection.current_count = 1
    		connection.max_count = 1
    		total_upload_count = 8
    		success_upload_count = 8
    		total_append_count = 0
    		success_append_count = 0
    		total_modify_count = 0
    		success_modify_count = 0
    		total_truncate_count = 0
    		success_truncate_count = 0
    		total_set_meta_count = 0
    		success_set_meta_count = 0
    		total_delete_count = 0
    		success_delete_count = 0
    		total_download_count = 0
    		success_download_count = 0
    		total_get_meta_count = 0
    		success_get_meta_count = 0
    		total_create_link_count = 0
    		success_create_link_count = 0
    		total_delete_link_count = 0
    		success_delete_link_count = 0
    		total_upload_bytes = 1313936
    		success_upload_bytes = 1313936
    		total_append_bytes = 0
    		success_append_bytes = 0
    		total_modify_bytes = 0
    		success_modify_bytes = 0
    		stotal_download_bytes = 0
    		success_download_bytes = 0
    		total_sync_in_bytes = 164962
    		success_sync_in_bytes = 0
    		total_sync_out_bytes = 0
    		success_sync_out_bytes = 0
    		total_file_open_count = 8
    		success_file_open_count = 8
    		total_file_read_count = 0
    		success_file_read_count = 0
    		total_file_write_count = 8
    		success_file_write_count = 8
    		last_heart_beat_time = 2018-07-13 09:09:24
    		last_source_update = 2018-07-12 17:01:49
    		last_sync_update = 2018-07-12 17:01:53
    		last_synced_timestamp = 1970-01-01 08:00:00 
    

    group1 两台存储器的日志:

    [2018-07-13 08:48:09] ERROR - file: storage_ip_changed_dealer.c, line: 180, connect to tracker server 117.48.231.99:22122 fail, errno: 111, error info: Connection refused
    [2018-07-13 08:48:24] 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
    [2018-07-13 08:48:24] INFO - file: storage_func.c, line: 254, tracker_client_ip: 192.168.0.3, my_server_id_str: 192.168.0.3, g_server_id_in_filename: 50374848
    [2018-07-13 08:48:24] ERROR - file: tracker_proto.c, line: 48, server: 117.48.231.77:22122, response status 2 != 0
    [2018-07-13 08:48:24] ERROR - file: tracker_proto.c, line: 48, server: 117.48.231.99:22122, response status 2 != 0
    [2018-07-13 08:48:24] INFO - local_host_ip_count: 2,  127.0.0.1  192.168.0.3
    [2018-07-13 08:48:24] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 117.48.231.77:22122, as a tracker client, my ip is 192.168.0.3
    [2018-07-13 08:48:24] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 117.48.231.99:22122, as a tracker client, my ip is 192.168.0.3
    [2018-07-13 08:48:24] INFO - file: storage_sync.c, line: 2698, successfully connect to storage server 117.48.231.88:23000
    [2018-07-13 08:48:24] INFO - file: storage_sync.c, line: 2698, successfully connect to storage server 117.48.231.94:23000
    
    [2018-07-13 08:48:09] ERROR - file: storage_ip_changed_dealer.c, line: 180, connect to tracker server 117.48.231.99:22122 fail, errno: 111, error info: Connection refused
    [2018-07-13 08:48:24] 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
    [2018-07-13 08:48:24] INFO - file: storage_func.c, line: 254, tracker_client_ip: 192.168.0.3, my_server_id_str: 192.168.0.3, g_server_id_in_filename: 50374848
    [2018-07-13 08:48:24] ERROR - file: tracker_proto.c, line: 48, server: 117.48.231.77:22122, response status 2 != 0
    [2018-07-13 08:48:24] ERROR - file: tracker_proto.c, line: 48, server: 117.48.231.99:22122, response status 2 != 0
    [2018-07-13 08:48:24] INFO - local_host_ip_count: 2,  127.0.0.1  192.168.0.3
    [2018-07-13 08:48:24] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 117.48.231.77:22122, as a tracker client, my ip is 192.168.0.3
    [2018-07-13 08:48:24] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 117.48.231.99:22122, as a tracker client, my ip is 192.168.0.3
    [2018-07-13 08:48:24] INFO - file: storage_sync.c, line: 2698, successfully connect to storage server 117.48.231.88:23000
    [2018-07-13 08:48:55] INFO - file: storage_sync.c, line: 2698, successfully connect to storage server 117.48.231.94:23000
    

    两台 tracker 的日志

    [2018-07-13 09:14:37] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    [2018-07-13 09:14:41] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    [2018-07-13 09:14:44] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    [2018-07-13 09:14:48] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    [2018-07-13 09:14:52] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    [2018-07-13 09:14:53] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    [2018-07-13 09:15:01] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    [2018-07-13 09:15:11] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    [2018-07-13 09:15:14] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    [2018-07-13 09:15:19] INFO - file: tracker_relationship.c, line: 383, selecting leader...
    
    3 回复  |  直到 2018-07-17 16:40:19 +08:00
        1
    wqsfree   129 天前
    最好把你的配置文件粘贴出来,还有 storage 的数据目录下有没有 sync 目录 ,以及 sync 目录下有没有这样的文件 IP.mark 以及 binlog 的文件
        2
    wqsfree   129 天前
    last_heart_beat_time = 2018-07-13 09:09:24
    last_source_update = 2018-07-12 17:01:48
    last_sync_update = 2018-07-12 17:01:53
    last_synced_timestamp = 1970-01-01 08:00:00


    last_heart_beat_time = 2018-07-13 09:09:26
    last_source_update = 1970-01-01 08:00:00
    last_sync_update = 1970-01-01 08:00:00
    last_synced_timestamp = 1970-01-01 08:00:00 (never synced)
        3
    chuanqirenwu   125 天前
    @wqsfree 谢谢,问题解决了,怀疑是网络问题,周末休息后发现文件已经同步了。。。
    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   3255 人在线   最高记录 3821   ·  
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.1 · 24ms · UTC 09:48 · PVG 17:48 · LAX 01:48 · JFK 04:48
    ♥ Do have faith in what you're doing.
    沪ICP备16043287号-1