-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
是否有替换 MinIO 为 阿里云OSS 的方法? || Is there a way to replace MinIO with Alibaba Cloud OSS? #104
Comments
阿里云oss协议不兼容minio解决方案,你可以考虑替换为aws s3. 如果一定要支持各种国内oss的话每家都需要单独开发一套。欢迎pr The Alibaba Cloud oss protocol is not compatible with the minio solution, you may consider replacing it with aws s3. If it is necessary to support various domestic oss, each company needs to develop a separate set. Welcome pr |
我发现阿里云oss支持s3兼容协议。你可以尝试把 I found that Alibaba Cloud oss supports the S3 compatible protocol. You can try to replace |
配置完后上传图片报错: |
https://blog.xgblack.cn/alioss-image-back-to-the-source-failure-solution/ 看看这个呢? |
之前看过,但这个是 CDN 回源的问题,我目前是不能上传成功。 |
另外,目前的实现是先把图片上传到服务器,服务器再上传到 oss 吗?如果是这样的话也有问题,需要重新实现一下客户端直传。 In addition, the current implementation is to upload the picture to the server first, and then the server uploads it to oss? If this is the case, there is also a problem, and it is necessary to re-implement the direct transmission of the client. |
问题是什么? 服务器做中转的目的是隐藏对象存储的端口与连接细节。传输是通过流式传输 |
|
说白了就是除了网络没有缺点。 等到网络是缺点的时候,你的用户已经达到一个非常夸张的数量级了,短期内应该不会遇到这个瓶颈 另外就是通过应用服务器时应用服务器会记录一些文件信息用于后续维护,直传的话会数据存在不可信的问题。 To put it bluntly, there is no disadvantage except the network. When the network is a shortcoming, your users have reached a very exaggerated order of magnitude, and you should not encounter this bottleneck in the short term In addition, when passing through the application server, the application server will record some file information for subsequent maintenance. If the data is transmitted directly, the data will be untrustworthy. |
我比较关心是否跑通了oss存储,因为我没有使用阿里云没法测试。 I am more concerned about whether the oss storage is running through, because I do not use Alibaba Cloud and cannot test it. |
|
|
理解,只是在我们的常规架构里没使用过服务端代传的模式(不值得在服务器端花费额外的性能和带宽),客户端直传是已经比较成熟的解决方案,后续如果实现了会提PR。
I understand, it’s just that we haven’t used the server-side transfer mode in our regular architecture (it’s not worth spending extra performance and bandwidth on the server side), client-side direct transfer is a relatively mature solution, and if it is implemented in the future, it will improve PR. |
有任何人跟进此线程吗?我对 nodejs 和 minio 不是很熟悉。 如果不带协议头 https:// 那么会被 301 Move 从而导致程序终止(看起来似乎是没有 region 导致的?或者客户端使用了http而不是https?)
如果带协议头,那么就会抛出
|
@SanQianQVQ 请检查文档,确保每个环境变量都是正确的。特别是 @SanQianQVQ Please check the documentation to make sure every environment variable is correct. Especially for |
@moonrailgun 根据 Cloudflare 的文档和 Tailchat 的文档 我在 docker-compose.env 是这样写的:
然后抛出的错误为
在 Cloudflare 文档的描述中,region 可以传递空值,所以我想应该不是region的问题? |
这个就不清楚了,看上去是r2返回了301 |
因为我看示例是带https的 Because I see that the example is with https |
带上https会返回 getaddrinfo ENOTFOUND https |
@moonrailgun
|
尝试检索了一下报错给出的文件路径和行数,会不会是因为构造的请求是 HTTP:// , 但 R2 是必须 HTTPS:// ,所以产生了301跳转 tailchat/server/packages/sdk/src/services/mixins/minio.mixin.ts Lines 581 to 722 in 84db4a2
I tried to retrieve the file path and line number given in the error report. Could it be because the constructed request is HTTP://, but R2 requires HTTPS://, so a 301 jump was generated? tailchat/server/packages/sdk/src/services/mixins/minio.mixin.ts Lines 581 to 722 in 84db4a2
|
这一串代码关闭了useSSL tailchat/server/services/core/file.service.ts Lines 41 to 50 in 84db4a2
This string of code turns off useSSL tailchat/server/services/core/file.service.ts Lines 41 to 50 in 84db4a2
|
@SanQianQVQ 感谢你的review @SanQianQVQ thank you for your review |
我不是编译运行的,而是通过 docker-compose,然后就会出现非常尴尬的局面——没法修改docker容器内的文件,因为就算docker exec进去修改参数,但只要重新启动docker,修改就会被覆盖 I did not compile and run it, but through docker-compose, and then a very embarrassing situation would arise - the files in the docker container could not be modified, because even if docker exec went in to modify the parameters, as long as docker was restarted, the modifications would be Override |
你可以通过docker restart 重启而不是docker compose up -d 重启 You can restart via docker restart instead of docker compose up -d |
好,看起来编译后的应该是在 tailchat-service-core-1 这里? |
yes |
@moonrailgun
也就是,之前的301确实是因为协议不正确,应该使用 https,但是minio使用了http导致的,但是新的问题是看起来 minio 使用的 SSL/TLS 协议不被 R2 认可,猜测可能使用了不安全的 TLS1.0? |
想确认一下是否在服务器上启用了代理之类的中转服务? Want to confirm whether a relay service such as a proxy is enabled on the server? |
没有,服务器位于芬兰,因此与 Cloudflare 连接不需要通过 Proxy, 只有 docker 网桥和宿主机的交换 |
确实很奇怪。我没有r2账号也没办法复现。 你可以尝试在使用useSSL: true的情况下分别加上https:// 和 http:// 和 不加任何协议头 来尝试 Strange indeed. I don’t have an r2 account and I can’t reproduce it. You can try using useSSL: true and adding https:// and http:// respectively without adding any protocol headers to try |
我明白了,查阅了 minio 的文档和 Stackoverflow 后,这一部分控制的实质上是 minio 本身。由于 docker-compose.yml 里是非标端口+无cert配置,所以才在初始化阶段就抛出了 SSL 错误。而修改之前是可以正常初始化客户端的,只是在 handle 过程中出现了301导致退出... 也就是这一部分控制的应该是 minio 的客户端初始化,而不是初始化之后与 S3 类服务的连接... 问题又回到了原点 (SAD) tailchat/server/services/core/file.service.ts Lines 41 to 50 in 84db4a2
|
协议头无法添加,只要在env中添加就会抛出
|
这很奇怪,如果你不介意的话能否开一个测试桶然后在tailchat nightly 私信给我呢?我来看下
This is weird. If you don't mind, could you open a test bucket and send me a private message on tailchat nightly? Let me take a look |
@SanQianQVQ 佬,请问您配置好r2了吗,我迁移之后一直出问题,发现文件结构不一样,不知道您怎么解决的 @SanQianQVQ Guys, have you configured r2? I kept having problems after the migration and found that the file structure was different. I don’t know how you solved it |
环境变量里没看到相关可以配置的,是否已经有替换的功能?还是需要单独开发?感谢🙏
I don’t see anything that can be configured in the environment variables. Is there a replacement function? Or does it need to be developed separately? Thanks 🙏
The text was updated successfully, but these errors were encountered: