这篇文章最初发表在我们的 社区作者:Mike Fischler,Linode客户支持专家。
你可以使用Linode Object Storage作为你的部署的主要存储。 Nextcloud部署(如果你不熟悉Nextcloud ,它是一个开源的生产力和存储管理平台,类似于Google Drive、OneDrive和Dropbox等闭源服务)。然后,你将能够使用Nextcloud"广泛的应用程序库,为不同的团队设置分组文件夹,为个人用户分配带宽限制,以及更多。
以这种安全的替代方法与Linode对象存储进行互动,而不必担心访问控制列表、桶策略或命令行的问题。在我们开始之前,重要的是要注意,当你使用对象存储作为主存储时,没有元数据(名称、目录结构等)被存储在桶中。元数据只被存储在数据库中,而桶只通过一个唯一的标识符来保存文件内容,所以任何保存在对象存储桶中的东西都不能从Nextcloud 。
首先,为这个项目专门创建一套访问密钥和一个对象存储桶。虽然不是必须的,但如果出现任何安全问题,你可以灵活地撤销密钥和删除存储桶而不影响其他项目。关于这些步骤的帮助,请参考下面的链接。
拥有一个可以指向该Nextcloud 部署的域名也会有帮助。我们的Nextcloud "一键式 "应用程序可以自动配置DNS记录,所以你所需要做的就是确保你的域名能够指向Linode名称服务器。如果需要,你可以在下面找到它们的列表。请记住,名称服务器的变化可能需要48小时来传播。
ns1.linode.com
ns2.linode.com
ns3.linode.com
ns4.linode.com
ns5.linode.com
调出Nextcloud OCA的配套指南,并跟着走,直到你到达 "部署后开始 "部分。当你到达这一点时,试着加载该指南中显示的Nextcloud 设置页面。如果你能看到那个页面,说明安装成功了。我们还没有准备好完成安装过程,所以你可以暂时关闭那个屏幕。在这一点上填写会引起很多问题,所以先不要完成。
接下来,打开一个与Linode的SSH会话,然后cd到/var/www/nextcloud/config目录。在该目录下创建一个名为storage.config.php的文件,并粘贴下面的例子。记住要填入适当的字段。
<?php
$CONFIG = array(
'objectstore' => array(
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' => array(
'bucket' => '<BUCKET_NAME>',
'key' => '<ACCESS_KEY>',
'secret' => '<SECRET_KEY>',
'use_ssl' => true,
'hostname' => '<HOSTNAME_FOR_OBJ_REGION>',
),
),
);
一旦完成,你可以保存该文件,返回到之前的Nextcloud 设置页面,并完成设置过程。为了使这个项目发挥作用,storage.config.php文件必须在你完成设置之前存在。
如果一切工作正常,你应该看到Nextcloud 中心页面,如 "部署后开始 "部分中的步骤4所示。你现在有一个由Linode对象存储桶支持的Nextcloud 服务器。从这里,你可以开始从Nextcloud 库中安装应用程序,并调整这个设置以满足你的特定需求。为了让你开始,我在下面列出了一些我最喜欢的应用。
加入Linode 社区,发表您的问题。如果你的帖子被选中出现在Linode博客上,我们将向你发送一件Linode T恤。
评论 (4)
the link to https://docs.nextcloud.com/server/latest/user_manual/files/quota.html is broken.
any soft/hard file on a single file? I didn’t found it anywhere. I use nextcloud primary on Dedicated server, I have a lot of big > 5 GB
another question, how to move my current data to Linode Object Storage? Any seamless way to do that without transferring data manually?
Thanks for pointing out that broken link – it’s been fixed.
When it comes to large files with Nextcloud and our Object Storage, I wanted to give you some links that go over the hard limits to clarify that for you:
Nextcloud – https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html
Linode Object Storage –
https://www.linode.com/docs/products/storage/object-storage/#storage-limitations
We have different tools for uploading objects into your buckets. If you’re looking for a nice command line tool, I recommend checking out either our CLI or s3cmd. For a GUI, Cyberduck works really well. I suggest checking them all out to find which one is the most ‘seamless’ for your purposes:
Object Storage Tools – https://www.linode.com/docs/products/storage/object-storage/get-started/#object-storage-tools
Some other tools that might be useful to you if you’re looking to automate your uploads:
s3fs – https://linux.die.net/man/1/s3fs
s3ql – http://www.rath.org/s3ql-docs/
Many thanks for the detailed tips – much appreciated.
hi , I followed the above article and after creating the file , i get the below error
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
What happens ?