当前位置: 首页 > news >正文

长沙房地产新闻做seo网站公司哪家好

长沙房地产新闻,做seo网站公司哪家好,徐州seo网站推广,营销型网站推广项目场景:国产中标麒麟操作系统部署MinIO正常启动后发现图片能正常上传,但是匿名浏览该图片的时候无法查看。通过网络查询解决方案,得出的结论是:需要把当前上传文件的桶设置为public,由于创建桶默认是private且不可通过浏览器进行…

项目场景:国产中标麒麟操作系统部署MinIO正常启动后发现图片能正常上传,但是匿名浏览该图片的时候无法查看。通过网络查询解决方案,得出的结论是:需要把当前上传文件的桶设置为public,由于创建桶默认是private且不可通过浏览器进行修改,最后决定通过使用java代码的方式进行桶权限的修改,在修改过程中遇到一些网络问题,在此总结。


问题一的描述

MinIO图片可正常上传,但无法进行在线浏览,在线修改桶权限自动退出页面,通过java代码进行桶权限修改。
一、MinIO图片可正常上传,但无法进行在线浏览
在这里插入图片描述二、查看MinIO网页确定图片已上传成功
在这里插入图片描述三、查看MinIO网页图片所属桶权限为private,需要把桶权限修改为public,使用超级管理员进行浏览器修改权限却自动退出登入,看有专业人士博客说是8.0后的版本都不可以通过浏览器进行桶权限修改。
在这里插入图片描述

问题一的解决方案:

	public static void main(String[] args) {String sb = "{\"Version\":\"2012-10-17\"," +"\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":" +"{\"AWS\":[\"*\"]},\"Action\":[\"s3:ListBucket\",\"s3:ListBucketMultipartUploads\"," +"\"s3:GetBucketLocation\"],\"Resource\":[\"arn:aws:s3:::" + BucketName +"\"]},{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"*\"]},\"Action\":[\"s3:PutObject\",\"s3:AbortMultipartUpload\",\"s3:DeleteObject\",\"s3:GetObject\",\"s3:ListMultipartUploadParts\"],\"Resource\":[\"arn:aws:s3:::" +BucketName +"/*\"]}]}";MinioClient minioClient = MinioClient.builder().endpoint(MinIO地址).credentials(登入名, 密码).build();try {minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(BucketName).config(sb).build());} catch (ErrorResponseException e) {e.printStackTrace();} catch (InsufficientDataException e) {e.printStackTrace();} catch (InternalException e) {e.printStackTrace();} catch (InvalidKeyException e) {e.printStackTrace();} catch (InvalidResponseException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();} catch (NoSuchAlgorithmException e) {e.printStackTrace();} catch (ServerException e) {e.printStackTrace();} catch (XmlParserException e) {e.printStackTrace();}}

问题二的描述

一、通过上述的描述已经可以解决我在互联网云服务器部署MinIO出现的问题,当我把上面代码运用在我那台政务互联网环境下国产麒麟服务器时,又报错了。
Exception in thread “main” java.io.IOException: unexpected end of stream on http://IP:9000/…
at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:236)
at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
at okhttp3.RealCall.execute(RealCall.java:81)
at io.minio.MinioClient.execute(MinioClient.java:635)
at io.minio.MinioClient.execute(MinioClient.java:564)
at io.minio.MinioClient.executePut(MinioClient.java:903)
at io.minio.MinioClient.setBucketPolicy(MinioClient.java:3001)
at org.springblade.modules.system.controller.SetBucketPolicy.main(SetBucketPolicy.java:31)
Caused by: java.io.EOFException: \n not found: limit=0 content=…
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:240)
at okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.java:242)
at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:213)
… 21 more

问题二的原因分析:

我咨询了人工智能,他认为可能网络、防火墙、OkHttp版本问题或服务器配置的问题


问题二的解决方案:

我思考了一下,在云服务器下可正常调用并成功修改桶权限那么该方法逻辑肯定是没有问题的,那我是否可以把我的java代码写成一个无需授权的GET接口,然后使用curl去调用该接口。

接下来对我的接口进行一些修改,注意我这里是特意修改IP为localhost,如果你和我问题一直,这个参数可以与我保持一致。然后使用 curl -X GET 127.0.0.1:java服务端口/当前服务的路径/setBucketPolicy命令执行,查看日志未报错,成功修改桶为public。

	@GetMapping("/setBucketPolicy")public void setBucketPolicy(){String sb = "{\"Version\":\"2012-10-17\"," +"\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":" +"{\"AWS\":[\"*\"]},\"Action\":[\"s3:ListBucket\",\"s3:ListBucketMultipartUploads\"," +"\"s3:GetBucketLocation\"],\"Resource\":[\"arn:aws:s3:::" + BucketName +"\"]},{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"*\"]},\"Action\":[\"s3:PutObject\",\"s3:AbortMultipartUpload\",\"s3:DeleteObject\",\"s3:GetObject\",\"s3:ListMultipartUploadParts\"],\"Resource\":[\"arn:aws:s3:::" +BucketName +"/*\"]}]}";MinioClient minioClient = MinioClient.builder().endpoint("http://localhost:9000").credentials(登入名, 密码).build();try {minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(BucketName).config(sb).build());} catch (ErrorResponseException e) {e.printStackTrace();} catch (InsufficientDataException e) {e.printStackTrace();} catch (InternalException e) {e.printStackTrace();} catch (InvalidKeyException e) {e.printStackTrace();} catch (InvalidResponseException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();} catch (NoSuchAlgorithmException e) {e.printStackTrace();} catch (ServerException e) {e.printStackTrace();} catch (XmlParserException e) {e.printStackTrace();}}

在这里插入图片描述 在这里插入图片描述
在这里插入图片描述
中标麒麟国产服务器安装MinIO地址:http://t.csdnimg.cn/zqXSk

http://www.yayakq.cn/news/173774/

相关文章:

  • 工业园做网站的公司谷歌网站提交
  • php源码 个人网站无锡网站排名优化公司
  • 天水市秦州区建设局网站php企业网站开发实训报告
  • 苏州网站开发网站建立费用深圳手机网站建设报价
  • 北京游戏网站建设关键词排名
  • 北京做网站开发公司哪家好成都设计公司排行
  • 培训教育网站建设关于网页设计
  • 先备案 做网站网站分哪几类
  • 网站安全评估报告广西网站设计公司排行榜
  • 无锡网站建设公司地址公关公司的主要业务
  • ppt制作网站精品课程网站建设 公司
  • 做公司网站的南宁公司上海建设网站哪家好
  • seo网站地图怎么做企业网站建设的实验报告
  • 开展农业信息网站建设工作网站开发工具有哪些
  • 一个网站的建设需要什么手续费自己做电影网站可以赚钱吗
  • 优质聊城做网站费用wordpress手机插件怎么用
  • 网站建设项目管理可以查企业信息的软件
  • 天河建设网站技术精品手机网站案例
  • 互联网众筹网站怎样建设做海报素材网站推荐
  • 网站开发建设工资多少网站做营销推广公司
  • dw网站模板免费下载建设银行app
  • 免费网站做seo酒泉建设局造价官网站
  • 青岛做网站推广公司哪家好网站建设数据库模板
  • 淘宝网站建设概要上海环球金融中心简介
  • 做彩票网站代理违法吗wordpress与typecho
  • 国内做网站最大的公司有哪些北京学做网站
  • 上海建站网络科技国内最大的猎头公司
  • 如何免费建设网站上海装饰公司排名百强
  • 唐山专业做网站公司synology建设网站
  • 做网站售后好的公司企业外贸网站推广