fastDFS在虚拟机里面装好并测试通过,但是用javaAPI的时候报SocketTimeoutException: connect timed out异常
爱情过夜 2016-03-10 05:57:59 [root@localhost conf]# /usr/bin/fdfs_test /etc/fdfs/client.conf upload anti-steal.jpg
This is FastDFS client test program v5.08
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.
[2016-03-10 01:20:23] DEBUG - base_path=/export/fastdfs/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=192.168.80.132, port=23000
group_name=group1, ip_addr=192.168.80.132, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKhQhFbhPFeAR8vmAABdrZgsqUU060.jpg
source ip address: 192.168.80.132
file timestamp=2016-03-10 01:20:23
file size=23981
file crc32=2553063749
example file url: http://192.168.80.132/group1/M00/00/00/wKhQhFbhPFeAR8vmAABdrZgsqUU060.jpg
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKhQhFbhPFeAR8vmAABdrZgsqUU060_big.jpg
source ip address: 192.168.80.132
file timestamp=2016-03-10 01:20:23
file size=23981
file crc32=2553063749
example file url: http://192.168.80.132/group1/M00/00/00/wKhQhFbhPFeAR8vmAABdrZgsqUU060_big.jpg
上面是我在虚拟机里面安装好fastDFS和nginx后测试结果,在本地浏览器里面能看到上传的这张图片。
但是用javaAPI的时候报SocketTimeoutException: connect timed out异常,代码:
ClientGlobal.init("D:\\study_taotao\\work_space\\taotao-manager\\taotao-manager-web\\src\\main\\resources\\resource\\client.conf");
TrackerClient trackerClient = new TrackerClient();
TrackerServer trackerServer = trackerClient.getConnection();
StorageServer storageServer=null;
StorageClient storageClient = new StorageClient(trackerServer, storageServer);
String[] upload_file = storageClient.upload_file("C:\\Users\\Public\\Pictures\\Sample Pictures\\Koala.jpg","jpg", null);
for (String string : upload_file) {
System.out.println(string);
}
我有一个地方不懂,就是在安装fastDFS的时候,tracker.conf、storage.conf、client.conf里面都有http.server_port节点,我怀疑是这个我配置的有问题,我都是配置成nginx的监听端口。