默认账号:minioadmin
默认密码:minioadmin
启动minio,
在minio的目录下启动命令行
D:\Minio>minio server /Data
Status: 1 Online, 0 Offline.
S3-API: http://10.247.157.72:9000 http://192.168.184.1:9000 http://192.168.92.1:9000 http://127.0.0.1:9000
RootUser: minioadmin
RootPass: minioadmin
复制第二行的其中一个ip地址访问 登录
然后通过java后台 实现文件的上传
package huizhi.miniotest;
import io.minio.MinioClient;
import io.minio.UploadObjectArgs;
public class ExerciseDemo1 {
public static void main(String[] args) throws Exception {
MinioClient minioClient =
MinioClient.builder()
.endpoint("http://192.168.92.1:9000")
.credentials("minioadmin", "minioadmin")
.build();
minioClient.uploadObject(
UploadObjectArgs.builder()
.bucket("test2")
.object("T1.jpg")
.filename("C:\\Users\\Administrator\\Pictures\\T1.jpg")
.build());
System.out.println(
"'/home/user/Photos/asiaphotos.zip' is successfully uploaded as "
+ "object 'asiaphotos-2015.zip' to bucket 'asiatrip'.");
}
}