Chinaunix
标题:
开启fastdfs的双机备份时,storage如何能有主从区别
[打印本页]
作者:
wangping1213
时间:
2017-12-29 16:21
标题:
开启fastdfs的双机备份时,storage如何能有主从区别
本帖最后由 wangping1213 于 2017-12-29 16:35 编辑
我的fastdfs中配置了双机备份,分别部署在172.16.0.112,172.16.0.114,其中tracker和storage分别为两台,各自配置如下:
两个tracker.conf配置:
disabled=false
bind_addr=
port=22122
base_path=/root/fdfs/tracker
store_group=group2
store_server=0
store_path=2
复制代码
两个storage.conf配置:
disabled=false
group_name=group1
base_path=/root/fdfs/storage
store_path_count=2
store_path0=/root/fdfs/file0
store_path1=/root/fdfs/file1
tracker_server=172.16.0.112:22122
tracker_server=172.16.0.114:22122
file_distribute_path_mode=1
复制代码
两个mod_fastdfs.conf配置:
base_path=/tmp
storage_server_port=23000
group_name=group1
url_have_group_name = false
store_path_count=2
store_path0=/root/fdfs/file0
store_path1=/root/fdfs/file1
tracker_server=172.16.0.112:22122
tracker_server=172.16.0.114:22122
复制代码
执行命令fdfs_monitor /etc/fdfs/storage.conf如下(两个storage都是Active):
DEBUG - base_path=/root/fdfs/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=1
tracker server is 172.16.0.114:22122
group count: 1
Group 1:
group name = group1
disk total space = 1019600 MB
disk free space = 549952 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 = 2
subdir count per path = 256
current write server index = 0
current trunk file id = 0
Storage 1:
id = 172.16.0.112
ip_addr = 172.16.0.112 (hsn112) ACTIVE
http domain =
version = 5.04
join time = 2017-07-08 22:24:27
up time = 2017-12-29 15:59:51
total storage = 1019600 MB
free storage = 549952 MB
upload priority = 10
store_path_count = 2
subdir_count_per_path = 256
storage_port = 23000
storage_http_port = 8888
current_write_path = 1
source storage id =
if_trunk_server = 0
connection.alloc_count = 256
connection.current_count = 0
connection.max_count = 0
total_upload_count = 161789
success_upload_count = 161789
total_append_count = 136
success_append_count = 136
total_modify_count = 4
success_modify_count = 4
total_truncate_count = 2
success_truncate_count = 2
total_set_meta_count = 18
success_set_meta_count = 18
total_delete_count = 709
success_delete_count = 709
total_download_count = 6
success_download_count = 6
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 = 41283553852
success_upload_bytes = 41283553852
total_append_bytes = 11122718
success_append_bytes = 11122718
total_modify_bytes = 122
success_modify_bytes = 122
stotal_download_bytes = 411383
success_download_bytes = 411383
total_sync_in_bytes = 1836170525
success_sync_in_bytes = 1836170525
total_sync_out_bytes = 0
success_sync_out_bytes = 0
total_file_open_count = 163597
success_file_open_count = 163597
total_file_read_count = 6
success_file_read_count = 6
total_file_write_count = 292975
success_file_write_count = 292975
last_heart_beat_time = 2017-12-29 16:00:29
last_source_update = 2017-12-29 15:52:44
last_sync_update = 2017-12-29 15:58:54
last_synced_timestamp = 2017-12-29 15:59:25 (0s delay)
Storage 2:
id = 172.16.0.114
ip_addr = 172.16.0.114 (localhost) ACTIVE
http domain =
version = 5.04
join time = 2017-06-13 17:18:54
up time = 2017-12-29 16:00:03
total storage = 1019344 MB
free storage = 837218 MB
upload priority = 10
store_path_count = 2
subdir_count_per_path = 256
storage_port = 23000
storage_http_port = 8888
current_write_path = 1
source storage id =
if_trunk_server = 0
connection.alloc_count = 256
connection.current_count = 1
connection.max_count = 1
total_upload_count = 1661
success_upload_count = 1661
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 = 8
success_set_meta_count = 8
total_delete_count = 48
success_delete_count = 48
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 = 1837672341
success_upload_bytes = 1837672341
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 = 39558938462
success_sync_in_bytes = 39549332780
total_sync_out_bytes = 0
success_sync_out_bytes = 0
total_file_open_count = 162810
success_file_open_count = 162810
total_file_read_count = 0
success_file_read_count = 0
total_file_write_count = 285795
success_file_write_count = 285795
last_heart_beat_time = 2017-12-29 16:00:34
last_source_update = 2017-12-29 15:59:25
last_sync_update = 2017-12-29 15:53:28
last_synced_timestamp = 2017-12-29 15:52:44 (0s delay)
复制代码
但是在java客户端中加入主从文件时(格式如下):
http://172.16.0.112/M00/00/10/rBAAclpFt5mAV7mpAAcWEvcU_U4615.png
http://172.16.0.112/M00/00/10/rBAAclpFt5mAV7mpAAcWEvcU_U4615_thumb.png
http://172.16.0.112/M00/00/10/rBAAclpFt5mAV7mpAAcWEvcU_U4615_preview.png
复制代码
在172.16.0.114上storage的错误日志为(有时候实在172.16.0.112上storage的错误日志文件出现的):
ERROR - file: storage_service.c, line: 5271, client ip: 192.168.3.10, stat logic file M00/00/10/rBAAclpFt5mAV7mpAAcWEvcU.png fail, errno: 2, error info: No such file or directory.
复制代码
我猜测是因为两台storage服务器没有主从区别是随机的缘故,但是我在storage.conf文件加入了
file_distribute_path_mode=1,但是貌似还是没用呢,各位大大能帮忙看看不
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2