阿里云OSS连接失败

一切都按服务手册安装好了企业版在阿里云ECS上,使用也正常
尝试按以下文件连OSS重启seafile.sh和seahub.sh后web界面就无法登陆了:

在阿里云OSS服务界面创建了commit-seafile, fs-seafile, block-seafile三个bucket,
添加以下代码到seafile.conf以后无法登陆,去掉重启之后就可以使用web界面

[commit_object_backend]
name = oss
bucket = commit-seafile
key_id =
key =
region = hangzhou
memcached_options = --SERVER=127.0.0.1 --POOL-MIN=10 --POOL-MAX=100

[fs_object_backend]
name = oss
bucket = fs-seafile
key_id =
key =
region = hangzhou
memcached_options = --SERVER=127.0.0.1 --POOL-MIN=10 --POOL-MAX=100

[block_backend]
name = oss
bucket = block-seafile
key_id =
key =
region = hangzhou
memcached_options = --SERVER=127.0.0.1 --POOL-MIN=10 --POOL-MAX=100

第一次用linux 求解

谢谢!

看看 logs/seafile.log 里面有没有报错吧

不知道哪里出了问题

[03/22/2017 08:10:27 PM] …/common/mq-mgr.c(61): [mq client] mq cilent is started
[03/22/2017 08:10:27 PM] filelock-mgr.c(917): Cleaning expired file locks.
[03/22/2017 08:12:34 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:c110ca00d775876d77db5cae17588ec60b276bdc: Couldn’t connect to server.
[03/22/2017 08:12:58 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:d8890cf40e7870a39294c4c0df0a2e517dfa56e0: Couldn’t connect to server.
[03/22/2017 08:13:03 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:d8890cf40e7870a39294c4c0df0a2e517dfa56e0: Couldn’t connect to server.
[03/22/2017 08:13:07 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:34d2ebd6f1f8bfa1128a4172f23df840c7f38e16: Couldn’t connect to server.
[03/22/2017 08:14:42 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:c110ca00d775876d77db5cae17588ec60b276bdc: Couldn’t connect to server.
[03/22/2017 08:15:05 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:d8890cf40e7870a39294c4c0df0a2e517dfa56e0: Couldn’t connect to server.
[03/22/2017 08:15:10 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:d8890cf40e7870a39294c4c0df0a2e517dfa56e0: Couldn’t connect to server.
[03/22/2017 08:15:14 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:34d2ebd6f1f8bfa1128a4172f23df840c7f38e16: Couldn’t connect to server.
[03/22/2017 08:16:49 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:c110ca00d775876d77db5cae17588ec60b276bdc: Couldn’t connect to server.
[03/22/2017 08:16:49 PM] repo-mgr.c(928): Commit b012a1b5-2c6f-4aa3-ad28-6cd7b4b78eae:c110ca00d775876d77db5cae17588ec60b276bdc is missing
[03/22/2017 08:16:49 PM] seafile-session.c(484): Failed to get system default repo. Create a new one.
[03/22/2017 08:17:12 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:d8890cf40e7870a39294c4c0df0a2e517dfa56e0: Couldn’t connect to server.
[03/22/2017 08:17:12 PM] repo-mgr.c(928): Commit e71c52b6-eead-4edb-9b68-c3e97c1a880a:d8890cf40e7870a39294c4c0df0a2e517dfa56e0 is missing
[03/22/2017 08:17:18 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:d8890cf40e7870a39294c4c0df0a2e517dfa56e0: Couldn’t connect to server.
[03/22/2017 08:17:18 PM] repo-mgr.c(928): Commit e71c52b6-eead-4edb-9b68-c3e97c1a880a:d8890cf40e7870a39294c4c0df0a2e517dfa56e0 is missing
[03/22/2017 08:17:21 PM] …/common/oss-client.c(310): [OSS] libcurl failed to get commit-seafile:34d2ebd6f1f8bfa1128a4172f23df840c7f38e16: Couldn’t connect to server.
[03/22/2017 08:17:21 PM] repo-mgr.c(928): Commit 513d8013-d6c9-4026-a3a5-b5bbd6ce23fa:34d2ebd6f1f8bfa1128a4172f23df840c7f38e16 is missing
[03/22/2017 08:18:40 PM] Disconnected from daemon

还有我的ECS开通的是VPC网络

就是 VPC 的问题,目前 Seafile 还只支持使用经典网络下的 OSS,VPC 和经典网络的 OSS 地址是不一样的。下个版本我们会支持。

我重新开了一个经典网络的ECS 还是提示一样的消息:
[03/26/2017 10:00:41 PM] …/common/oss-client.c(444): [OSS] libcurl failed to put commit-seafile:04b458736cffcf6519e01cc3e37986ea4201f954: Couldn’t resolve host name.
[03/26/2017 10:00:41 PM] …/common/oss-client.c(444): [OSS] libcurl failed to put commit-seafile:04b458736cffcf6519e01cc3e37986ea4201f954: Couldn’t resolve host name.
[03/26/2017 10:00:41 PM] …/common/oss-client.c(444): [OSS] libcurl failed to put commit-seafile:04b458736cffcf6519e01cc3e37986ea4201f954: Couldn’t resolve host name.
[03/26/2017 10:00:41 PM] repo-mgr.c(5678): Failed to add commit.
[03/26/2017 10:01:19 PM] filelock-mgr.c(917): Cleaning expired file locks.
[03/26/2017 10:04:36 PM] Disconnected from daemon
[03/26/2017 10:04:42 PM] …/common/mq-mgr.c(61): [mq client] mq cilent is started
[03/26/2017 10:04:42 PM] filelock-mgr.c(917): Cleaning expired file locks.
[03/26/2017 10:04:42 PM] …/common/oss-client.c(444): [OSS] libcurl failed to put commit-seafile:7b7503e85239a83984dd205bb594790f3901850c: Couldn’t resolve host name.
[03/26/2017 10:04:42 PM] …/common/oss-client.c(444): [OSS] libcurl failed to put commit-seafile:7b7503e85239a83984dd205bb594790f3901850c: Couldn’t resolve host name.
[03/26/2017 10:04:42 PM] …/common/oss-client.c(444): [OSS] libcurl failed to put commit-seafile:7b7503e85239a83984dd205bb594790f3901850c: Couldn’t resolve host name.
[03/26/2017 10:04:42 PM] repo-mgr.c(5678): Failed to add commit.
[03/26/2017 10:04:42 PM] seafile-session.c(501): Failed to create system default repo.
[03/26/2017 10:05:20 PM] …/common/oss-client.c(444): [OSS] libcurl failed to put commit-seafile:e5d9dbee204b307144636696bcee18ea49f34a70: Couldn’t resolve host name.
[03/26/2017 10:05:20 PM] …/common/oss-client.c(444): [OSS] libcurl failed to put commit-seafile:e5d9dbee204b307144636696bcee18ea49f34a70: Couldn’t resolve host name.
[03/26/2017 10:05:20 PM] …/common/oss-client.c(444): [OSS] libcurl failed to put commit-seafile:e5d9dbee204b307144636696bcee18ea49f34a70: Couldn’t resolve host name.
[03/26/2017 10:05:20 PM] repo-mgr.c(5678): Failed to add commit.

你创建的 OSS bucket 是在 VPC 里面的吧?

不是在VPC里面 不用自动脚本手动安装成功,但是有了两个新问题:

  1. seahub如果已fastcgi启动总是在127.0.0.1上启动,无法连接服务器
    更新: 开启https后可以已fastcgi启动了

  2. 客户端及web界面的下载速度只有150kb左右,非常的慢,但是上传速度非常快,不知道是哪个设置出现了问题, 是否应该在nginx设置中添加阿里云oss的代理?

谢谢

下载速度的问题可能是网络原因吧,nginx 里面没想到有什么需要设置的。

我试了很多网络了 200M的宽带也一样只有150kb左右的下载速度。。。

阿里云oss做后端是不是还是从ecs里面走的流量?跟我买的实例带宽有关系?有方法从oss的内网域名里直接读取吗?

嗯,是走 ECS 的流量。没有办法直接读 oss。

明白了 只能去升级带宽 谢谢

region = hangzhou 删除修改为
endpoint = oss-cn-hangzhou.aliyuncs.com 这样就不会ECS 了吧。

已经改成内网endpoint了 还是走ecs 好像无解

我试了VPC网络,一样速度,还是走ECS,这就浪费了oss的速度了啊。

直接访问 oss 的网络速度和通过 ECS 访问是一样的。这里主要是需要权限检查,所以不能直接访问 oss。

ECS获取oss文件快,但之后的下载受限于ECS带宽,默认只有坑爹的1M。直接访问oss确实不便权限检查。

跨区的OSS 是否就可解决这问题?