免费注册 查看新帖 |

Chinaunix

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

[FastDFS] UPload 失败 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-11-11 11:34 |只看该作者 |倒序浏览
不知道为什么,这几天FAST DFS upload 不行了,但是用HTTP下载是没有问题的。有这样的错误:
[root@localhost src]# java -cp fastdfs_client_v1.8.jar org.csource.fastdfs.TestClient fdfs_client.conf /opt/test1.txt
java.version=1.4.2
network_timeout=20000ms
charset=ISO8859-1
file length: 14
java.lang.Exception: getStoreStorage fail, errno code: 2
   at org.csource.fastdfs.StorageClient.newWritableStorageConnection(StorageClient.java:659)
   at org.csource.fastdfs.StorageClient.do_upload_file(StorageClient.java:143)
   at org.csource.fastdfs.StorageClient.upload_file(StorageClient.java:102)
   at org.csource.fastdfs.TestClient.main(TestClient.java:86)

用http:
[root@localhost src]# /usr/local/bin/fdfs_test /etc/fdfs/storage.conf upload /opt/test1.txt
This is FastDFS client test program v1.21

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.

[2009-11-11 11:30:26] ERROR - file: ../common/ini_file_reader.c, line: 191, include file "http.conf" not exists, line: "#include http.conf"
[2009-11-11 11:30:26] ERROR - load conf file "/etc/fdfs/storage.conf" fail, ret code: 2

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
2 [报告]
发表于 2009-11-11 18:40 |只看该作者

回复 #1 ouqz 的帖子

第一个问题,storage server没有正常运行起来吧?你看一下storage server的日志文件。
另外,建议使用最新的java API,目前版本是V1.11。

第二个问题,配置文件的问题。将storage.conf中的
#include http.conf
前面再加一个#将其注释掉。

估计storage server不能正常启动,也是这个原因。
建议将FastDFS server端升级到V1.22。

论坛徽章:
0
3 [报告]
发表于 2009-11-13 09:30 |只看该作者
[2009-11-13 09:26:12] INFO - FastDFS v1.22, base_path=/home/data/fastdfs, network_timeout=60s, port=22122, bind_addr=, max_connections=256, store_lookup=2, store_group=, store_server=0, store_path=0, reserved_storage_space=2048MB, download_server=0, allow_ip_count=-1, sync_log_buff_interval=10s, check_active_interval=120s, thread_stack_size=1024 KB
[2009-11-13 09:26:12] INFO - HTTP supported: server_port=80, default_content_type=application/octet-stream, anti_steal_token=0, token_ttl=0s, anti_steal_secret_key length=0, token_check_fail content_type=, token_check_fail buff length=0

我把Fast DFS 都升成1.22了,java API也是最新的1.11 但还是上传不了,
   [root@localhost src]# java -cp fastdfs_client_v1.11.jar org.csource.fastdfs.TestClient fdfs_client.conf /opt/test1.txt
Exception in thread "main" java.lang.NoClassDefFoundError: org.csource.fastdfs.TestClient
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
Caused by: java.lang.ClassNotFoundException: org.csource.fastdfs.TestClient not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:fastdfs_client_v1.11.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
是那里出现问题了呢?

论坛徽章:
0
4 [报告]
发表于 2009-11-13 09:38 |只看该作者
配置文件的问题。将storage.conf中的
#include http.conf
前面再加一个#将其注释掉。
  这个早已经是注释了的,原来用http upload 都是可以的,
我看过里面配置也是对的

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
5 [报告]
发表于 2009-11-13 10:33 |只看该作者
原帖由 ouqz 于 2009-11-13 09:30 发表
我把Fast DFS 都升成1.22了,java API也是最新的1.11 但还是上传不了,
   [root@localhost src]# java -cp fastdfs_client_v1.11.jar org.csource.fastdfs.TestClient fdfs_client.conf /opt/test1.txt
Exception in thread "main" java.lang.NoClassDefFoundError: org.csource.fastdfs.TestClient
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
Caused by: java.lang.ClassNotFoundException: org.csource.fastdfs.TestClient not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:fastdfs_client_v1.11.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
是那里出现问题了呢? ...


V1.11开始,对class的存放路径进行了调整。
原来的类名:org.csource.fastdfs.TestClient
新的类名:org.csource.fastdfs.test.TestClient
你的执行脚本改为:
java -cp fastdfs_client_v1.11.jar org.csource.fastdfs.test.TestClient fdfs_client.conf /opt/test1.txt

你参照README中的说明进行操作即可。

论坛徽章:
0
6 [报告]
发表于 2009-11-13 10:41 |只看该作者
哦,原来是这样,
  现在测试可以了,太谢谢fish兄了。都怪自已没有看说明,谢谢!
顺便说一声,大家storage跟tracker或者storage跟storage互联不了,大家注意防火墙。

论坛徽章:
0
7 [报告]
发表于 2009-11-13 10:45 |只看该作者
问一问fish兄,Fast DFS 上传的文件有没有限制大少的呢?几百M的东西能上传吗?

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
8 [报告]
发表于 2009-11-13 11:45 |只看该作者

回复 #7 ouqz 的帖子

对于文件大小,FastDFS本身没有做限制,可以上传的。

论坛徽章:
0
9 [报告]
发表于 2009-11-17 10:06 |只看该作者
好的,知道了,太谢谢你啦
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP