• 阿里云OSS上传文件超时 探测工具排查方法


    异常:

    1. 2022-08-09 14:26:35.445 WARN 8 --- [nio-8587-exec-1] com.aliyun.oss : [Client]Unable to execute HTTP request: Read timed out
    2. [ErrorCode]: SocketTimeout
    3. [RequestId]: Unknown
    4. 2022-08-09 14:26:35.448 ERROR 8 --- [nio-8587-exec-1] c.b.b.f.p.service.impl.FileServiceImpl : ossFileUpload Exception
    5. com.aliyun.oss.ClientException: Read timed out
    6. [ErrorCode]: SocketTimeout
    7. [RequestId]: Unknown
    8. at com.aliyun.oss.common.utils.ExceptionFactory.createNetworkException(ExceptionFactory.java:71) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
    9. at com.aliyun.oss.common.comm.DefaultServiceClient.sendRequestCore(DefaultServiceClient.java:137) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
    10. at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:133) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
    11. at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:70) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
    12. at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:83) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
    13. at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:145) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
    14. at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:102) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
    15. at com.aliyun.oss.internal.OSSObjectOperation.writeObjectInternal(OSSObjectOperation.java:1125) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
    16. at com.aliyun.oss.internal.OSSObjectOperation.putObject(OSSObjectOperation.java:130) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
    17. at com.aliyun.oss.OSSClient.putObject(OSSClient.java:491) ~[aliyun-sdk-oss-3.8.0.jar!/:na]

    Windows系统ossutil安装与使用

    1.ossutil工具下载https://gosspublic.alicdn.com/ossutil/1.7.13/ossutil64.zip?spm=a2c63.p38356.0.0.4a9f3782oa16l2&file=ossutil64.zip其他系统版本:下载和安装 - 常用工具| 阿里云

    2.将工具解压,并双击运行ossutil.bat文件。

    3.运行以下命令,生成配置文件

    D:\ossutil64>ossutil64.exe config

    4. 设置配置文件

    1. D:\ossutil64>ossutil64.exe config
    2. 该命令创建将一个配置文件,在其中存储配置信息。
    3. 请输入配置文件名,文件名可以带路径(默认为:C:\\Users\Administrator\.ossutilconfig,回车将使用默认配置文件。如果用户设置为其它文件,在使用命令时需要将--config-file选项设置为该文件):
    4. 未输入配置文件,将使用默认配置文件:C:\\Users\Administrator\.ossutilconfig。
    5. 对于下述配置,回车将跳过相关配置项的设置,配置项的具体含义,请使用"help config"命令查看。
    6. 请输入endpoint:1
    7. 请输入accessKeyID:2
    8. 请输入accessKeySecret:3
    9. 请输入stsToken:4

     如果想修改配置文件,则进入 C:\Users\Administrator\.ossutilconfig 修改

     

    5.使用默认上传方式上传指定文件,并在探测结束后删除该文件,

    将本地根目录下的文件example.txt上传到名为mybucketname的Bucket。命令如下:

    D:\ossutil64>ossutil64.exe probe --upload example.txt --bucketname mybucketname

     输出结果:

    1. begin parse parameters and prepare file...[√]
    2. begin network detection...[√]
    3. begin upload file(normal)...[√]
    4. ************************* upload result *************************
    5. upload file:success
    6. upload file size:1(byte)
    7. upload time consuming:89(ms)
    8. (only the time consumed by probe command)

    本地会多一个log文件:

     logOssProbe20220810142605.log内容:

    1. ************************* system information *************************
    2. operating system:windows_amd64
    3. operating time:2022-08-10 14:26:05
    4. ************************* ping *************************
    5. Command => ping www.aliyun.com
    6. 正在 Ping xxx.alibaba.aliyun.com.gds.alibabadns.com [203.119.214.114] 具有 32 字节的数据:
    7. 来自 203.119.214.114 的回复: 字节=32 时间=44ms TTL=89
    8. 来自 203.119.214.114 的回复: 字节=32 时间=44ms TTL=89
    9. 来自 203.119.214.114 的回复: 字节=32 时间=44ms TTL=89
    10. 来自 203.119.214.114 的回复: 字节=32 时间=44ms TTL=89
    11. 203.119.214.114 的 Ping 统计信息:
    12. 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
    13. 往返行程的估计时间(以毫秒为单位):
    14. 最短 = 44ms,最长 = 44ms,平均 = 44ms
    15. ************************* ping *************************
    16. Command => ping xxx.aliyuncs.com
    17. 正在 Ping xxx.aliyuncs.com [120.77.166.207] 具有 32 字节的数据:
    18. 来自 120.77.166.207 的回复: 字节=32 时间=3ms TTL=91
    19. 来自 120.77.166.207 的回复: 字节=32 时间=3ms TTL=91
    20. 来自 120.77.166.207 的回复: 字节=32 时间=3ms TTL=91
    21. 来自 120.77.166.207 的回复: 字节=32 时间=2ms TTL=91
    22. 120.77.166.207 的 Ping 统计信息:
    23. 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
    24. 往返行程的估计时间(以毫秒为单位):
    25. 最短 = 2ms,最长 = 3ms,平均 = 2ms
    26. ************************* tracert *************************
    27. Command => tracert xxx.aliyuncs.com
    28. 通过最多 30 个跃点跟踪
    29. 到 xxx.aliyuncs.com [120.0.0.1] 的路由:
    30. 1 * * * 请求超时。
    31. 2 <1 毫秒 <1 毫秒 <1 毫秒 192.168.1.1
    32. 3 133 ms 9 ms 9 ms 116.24.1.1
    33. 4 124 ms 3 ms 2 ms 202.105.1.1
    34. 5 * * * 请求超时。
    35. 6 * * * 请求超时。
    36. 7 * * * 请求超时。
    37. 8 5 ms 4 ms 3 ms 183.2.1.1
    38. 9 3 ms 3 ms 3 ms 116.251.1.1
    39. 10 3 ms 3 ms 3 ms 45.112.1.1
    40. 11 * * * 请求超时。
    41. 12 * * * 请求超时。
    42. 13 3 ms 3 ms 2 ms 120.77.1.1
    43. 跟踪完成。
    44. ************************* nslookup *************************
    45. Command => nslookup xxx.aliyuncs.com
    46. 服务器: dc-1.xxx.com
    47. Address: 192.168.1.20
    48. 名称: xxx.aliyuncs.com
    49. Address: 120.0.0.1
    50. ************************* upload result *************************
    51. upload file:success
    52. upload file size:1(byte)
    53. upload time consuming:89(ms)
    54. (only the time consumed by probe command)

    参考:
    probe(探测状态) - 常用工具| 阿里云

    命令行工具ossutil快速入门 - 快速入门| 阿里云

    下载和安装 - 常用工具| 阿里云

    常见问题 - SDK示例| 阿里云 

  • 相关阅读:
    web前端网页设计期末课程大作业:旅游网页主题网站设计——三亚旅游网页设计(6个页面) HTML+CSS+JavaScript
    基于DotNetty实现自动发布 - 实现一键打包发布
    REDIS7.X哨兵模式
    第一课 HelloPython
    Redis(单/多)线程
    「影视解说」三联屏封面超详细制作方法,全网最简单三连视频封面
    小鹏汽车的“未来”故事有点性感
    开源远程桌面软件_RustDesk_(可自建远程桌面服务器)
    java中类中代码的执行顺序,附简繁两个Demo
    如何使用python连接mysql数据库编写爬虫代码。
  • 原文地址:https://blog.csdn.net/Anenan/article/details/126265582