Chinaunix

标题: FastDFS 支持跨网上传文件吗? [打印本页]

作者: sawaelon    时间: 2014-05-15 10:39
标题: FastDFS 支持跨网上传文件吗?
请问我的 client 和 fastDFS 不在同一个网内,storage 和 tracker 都在同一个网,可以通过 client 向 FastDFS 上传文件到 storage 上吗?
作者: lifeblood    时间: 2014-05-15 10:42
可以的,的,的,的,的
作者: sawaelon    时间: 2014-05-15 10:48
请问我该怎么配置呢?多谢
作者: sawaelon    时间: 2014-05-15 11:00
回复 2# lifeblood

一下是启动 fdfs_test 上传一个 mp4 文件:
./fdfs_test /home/work/fastdfs/conf/client.conf upload /home/work/RS_DATA/event-video/1/0/2014-05-14/20140514182014-53734362e4b05ca4ea1fa2f7.mp4
This is FastDFS client test program v4.07

Copyright (C) 2008, Happy Fish / YuQing

FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.csource.org/
for more detail.

[2014-05-15 10:54:00] DEBUG - base_path=/home/work/fdfs_client, 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

tracker_query_storage_store_list_without_group:
        server 1. group_name=, ip_addr=10.130.66.68, port=23000

group_name=group0, ip_addr=10.130.66.68, port=23000
[2014-05-15 10:54:30] ERROR - file: ../common/connection_pool.c, line: 84, connect to 10.130.66.68:23000 fail, errno: 110, error info: Connection timed out

本身 client 端所在的局域网内网地址为 10.101.10.210 ,tracker 和 storage 在跑在同一台机器上,在另一个网,内网地址为 10.130.66.68
通过 tracker 返回的 storage 地址为内网地址, client 无法连接

请问我该怎么配置,能实现这种跨网的传输?  多谢各位大神指教
作者: sawaelon    时间: 2014-05-15 11:09
回复 2# lifeblood


    连接 tracker 时,在 client.conf 配置文件里配置的是公网IP ,所以 client 可以连接上 tracker ,但 tracker 返回的是其内网 IP

试过在 storage.conf 配置公网 IP 的话,storage 无法启动,会报如下 ERROR:

[2014-05-15 10:00:46] ERROR - file: ../common/sockopt.c, line: 742, bind port 0 failed, errno: 99, error info: Cannot assign requested address.
[2014-05-15 10:00:46] ERROR - file: ../common/sockopt.c, line: 742, bind port 0 failed, errno: 99, error info: Cannot assign requested address.
[2014-05-15 10:00:46] INFO - file: storage_param_getter.c, line: 187, 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=0 GB, trunk_init_check_occupying=0, trunk_init_reload_from_binlog=0, store_slave_file_use_link=0
[2014-05-15 10:00:46] INFO - file: storage_func.c, line: 174, tracker_client_ip: 10.130.66.68, my_server_id_str: 10.130.66.68, g_server_id_in_filename: 1145209354
[2014-05-15 10:00:46] ERROR - file: ../common/sockopt.c, line: 742, bind port 0 failed, errno: 99, error info: Cannot assign requested address.
[2014-05-15 10:00:46] ERROR - file: ../common/sockopt.c, line: 742, bind port 23000 failed, errno: 99, error info: Cannot assign requested address.
[2014-05-15 10:00:46] CRIT - exit abnormally!

作者: sawaelon    时间: 2014-05-15 16:55
请问鱼大和各位,怎么跨网传文件呀?
作者: k3aaapk    时间: 2014-05-16 12:41
网络拓补都不说清楚 大家怎么回答你呢?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2