异常:
- 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
- [ErrorCode]: SocketTimeout
- [RequestId]: Unknown
- 2022-08-09 14:26:35.448 ERROR 8 --- [nio-8587-exec-1] c.b.b.f.p.service.impl.FileServiceImpl : ossFileUpload Exception
-
- com.aliyun.oss.ClientException: Read timed out
- [ErrorCode]: SocketTimeout
- [RequestId]: Unknown
- at com.aliyun.oss.common.utils.ExceptionFactory.createNetworkException(ExceptionFactory.java:71) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
- at com.aliyun.oss.common.comm.DefaultServiceClient.sendRequestCore(DefaultServiceClient.java:137) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
- at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:133) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
- at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:70) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
- at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:83) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
- at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:145) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
- at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:102) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
- at com.aliyun.oss.internal.OSSObjectOperation.writeObjectInternal(OSSObjectOperation.java:1125) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
- at com.aliyun.oss.internal.OSSObjectOperation.putObject(OSSObjectOperation.java:130) ~[aliyun-sdk-oss-3.8.0.jar!/:na]
- 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. 设置配置文件
- D:\ossutil64>ossutil64.exe config
- 该命令创建将一个配置文件,在其中存储配置信息。
-
- 请输入配置文件名,文件名可以带路径(默认为:C:\\Users\Administrator\.ossutilconfig,回车将使用默认配置文件。如果用户设置为其它文件,在使用命令时需要将--config-file选项设置为该文件):
- 未输入配置文件,将使用默认配置文件:C:\\Users\Administrator\.ossutilconfig。
-
- 对于下述配置,回车将跳过相关配置项的设置,配置项的具体含义,请使用"help config"命令查看。
- 请输入endpoint:1
- 请输入accessKeyID:2
- 请输入accessKeySecret:3
- 请输入stsToken:4
如果想修改配置文件,则进入 C:\Users\Administrator\.ossutilconfig 修改

5.使用默认上传方式上传指定文件,并在探测结束后删除该文件,
将本地根目录下的文件example.txt上传到名为mybucketname的Bucket。命令如下:
D:\ossutil64>ossutil64.exe probe --upload example.txt --bucketname mybucketname

输出结果:
- begin parse parameters and prepare file...[√]
- begin network detection...[√]
- begin upload file(normal)...[√]
-
- ************************* upload result *************************
- upload file:success
- upload file size:1(byte)
- upload time consuming:89(ms)
- (only the time consumed by probe command)
本地会多一个log文件:

logOssProbe20220810142605.log内容:
- ************************* system information *************************
- operating system:windows_amd64
- operating time:2022-08-10 14:26:05
-
-
- ************************* ping *************************
- Command => ping www.aliyun.com
-
- 正在 Ping xxx.alibaba.aliyun.com.gds.alibabadns.com [203.119.214.114] 具有 32 字节的数据:
- 来自 203.119.214.114 的回复: 字节=32 时间=44ms TTL=89
- 来自 203.119.214.114 的回复: 字节=32 时间=44ms TTL=89
- 来自 203.119.214.114 的回复: 字节=32 时间=44ms TTL=89
- 来自 203.119.214.114 的回复: 字节=32 时间=44ms TTL=89
-
- 203.119.214.114 的 Ping 统计信息:
- 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
- 往返行程的估计时间(以毫秒为单位):
- 最短 = 44ms,最长 = 44ms,平均 = 44ms
-
-
- ************************* ping *************************
- Command => ping xxx.aliyuncs.com
-
- 正在 Ping xxx.aliyuncs.com [120.77.166.207] 具有 32 字节的数据:
- 来自 120.77.166.207 的回复: 字节=32 时间=3ms TTL=91
- 来自 120.77.166.207 的回复: 字节=32 时间=3ms TTL=91
- 来自 120.77.166.207 的回复: 字节=32 时间=3ms TTL=91
- 来自 120.77.166.207 的回复: 字节=32 时间=2ms TTL=91
-
- 120.77.166.207 的 Ping 统计信息:
- 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
- 往返行程的估计时间(以毫秒为单位):
- 最短 = 2ms,最长 = 3ms,平均 = 2ms
-
-
- ************************* tracert *************************
- Command => tracert xxx.aliyuncs.com
-
- 通过最多 30 个跃点跟踪
- 到 xxx.aliyuncs.com [120.0.0.1] 的路由:
-
- 1 * * * 请求超时。
- 2 <1 毫秒 <1 毫秒 <1 毫秒 192.168.1.1
- 3 133 ms 9 ms 9 ms 116.24.1.1
- 4 124 ms 3 ms 2 ms 202.105.1.1
- 5 * * * 请求超时。
- 6 * * * 请求超时。
- 7 * * * 请求超时。
- 8 5 ms 4 ms 3 ms 183.2.1.1
- 9 3 ms 3 ms 3 ms 116.251.1.1
- 10 3 ms 3 ms 3 ms 45.112.1.1
- 11 * * * 请求超时。
- 12 * * * 请求超时。
- 13 3 ms 3 ms 2 ms 120.77.1.1
-
- 跟踪完成。
-
-
- ************************* nslookup *************************
- Command => nslookup xxx.aliyuncs.com
- 服务器: dc-1.xxx.com
- Address: 192.168.1.20
-
- 名称: xxx.aliyuncs.com
- Address: 120.0.0.1
-
-
- ************************* upload result *************************
- upload file:success
- upload file size:1(byte)
- upload time consuming:89(ms)
- (only the time consumed by probe command)
-