You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by xy...@apache.org on 2020/02/02 17:28:34 UTC

[hadoop-ozone] branch master updated: HDDS-2749. interface/S3.md translation (#493)

This is an automated email from the ASF dual-hosted git repository.

xyao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 475b94a  HDDS-2749. interface/S3.md translation (#493)
475b94a is described below

commit 475b94a7a4aed80438338edc6538cea279d9dbb5
Author: Xiang Zhang <mm...@mail.ustc.edu.cn>
AuthorDate: Mon Feb 3 01:28:25 2020 +0800

    HDDS-2749. interface/S3.md translation (#493)
---
 hadoop-hdds/docs/content/interface/S3.zh.md | 130 +++++++++++++++++++++++++++-
 1 file changed, 127 insertions(+), 3 deletions(-)

diff --git a/hadoop-hdds/docs/content/interface/S3.zh.md b/hadoop-hdds/docs/content/interface/S3.zh.md
index 71a607a..077124b 100644
--- a/hadoop-hdds/docs/content/interface/S3.zh.md
+++ b/hadoop-hdds/docs/content/interface/S3.zh.md
@@ -1,7 +1,7 @@
 ---
-title: S3 Protocol(测试)
+title: S3 协议接口
 weight: 3
-summary: Ozone supports Amazon's Simple Storage Service (S3) protocol. In fact, You can use S3 clients and S3 SDK based applications without any modifications with Ozone.
+summary: Ozone 支持 Amazon 的 Simple Storage Service (S3) 协议,事实上,你不需要对基于 S3 客户端和 S3 SDK 的应用做任何修改就可以在 Ozone 上使用。
 ---
 
 <!---
@@ -22,4 +22,128 @@ summary: Ozone supports Amazon's Simple Storage Service (S3) protocol. In fact,
 -->
 
 
-测试页面
+Ozone 提供了兼容 S3 的 REST 接口,你可以使用任何兼容 S3 的工具来操作 Ozone 的对象存储数据。
+
+## 起步
+
+S3 网关是提供兼容 S3 的 API 的独立组件,它应当和普通的 Ozone 组件分别启动。
+
+你可以使用发行包启动一个基于 docker 的集群,其中会包括 S3 网关。
+
+进入 `compose/ozones3` 目录,启动服务:
+
+```bash
+docker-compose up -d
+```
+
+你可以通过 `http://localhost:9878` 访问 S3 网关。
+
+## URL 规范
+
+Ozone S3 网关既支持虚拟主机风格的 URL 作为桶地址(形如:http://bucketname.host:9878),也支持多级路径风格的 URL 作为桶地址(形如 http://host:9878/bucketname)。
+
+默认使用多级路径风格,如果要使用虚拟主机风格的 URL,在 `ozone-site.xml` 中设置你的主域名:
+
+```xml
+<property>
+   <name>ozone.s3g.domain.name</name>
+   <value>s3g.internal</value>
+</property>
+```
+
+## 桶浏览器
+
+在桶的 URL 中加上 `?browser=true`,就可以在浏览器中浏览桶。
+
+比如,`testbucket` 桶中的内容可以在浏览器中用 http://localhost:9878/testbucket?browser=true 来查看。
+
+
+## 已实现的 REST 端点
+
+S3 网关服务的操作:
+
+端点    | 状态      |
+------------|-------------|
+GET 服务 | 已实现 |
+
+桶操作:
+
+端点                            | 状态      | 备注
+------------------------------------|-------------|---------------
+GET 桶(列举对象)第二版  | 已实现 |
+HEAD 桶                         | 已实现 |
+DELETE 桶                       | 已实现 |
+PUT 桶 (创建桶)          | 已实现 |
+Delete 多个对象 (POST)      | 已实现 |
+
+对象操作:
+
+端点                            | 状态          | 备注 
+------------------------------------|-----------------|---------------
+PUT 对象                          | 已实现     |
+GET 对象                          | 已实现     |
+分块上传                    | 已实现     | 但不包括当前分块上传的进度
+DELETE 对象                       | 已实现     |
+HEAD 对象                         | 已实现      |
+
+
+## 安全
+
+如果不启用安全机制,你可以*使用***任何** AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY 来访问 Ozone 的 S3 服务。
+
+在启用了安全机制的情况下,你可以通过 `ozone s3 gesecret` 命令获取 key 和 secret(需要进行 Kerberos 认证)。
+
+```bash
+/etc/security/keytabs/testuser.keytab testuser/scm@EXAMPLE.COM
+ozone s3 getsecret
+awsAccessKey=testuser/scm@EXAMPLE.COM
+awsSecret=c261b6ecabf7d37d5f9ded654b1c724adac9bd9f13e247a235e567e8296d2999
+
+```
+
+现在你可以使用 key 和 secret 来访问 S3 endpoint:
+
+```bash
+export AWS_ACCESS_KEY_ID=testuser/scm@EXAMPLE.COM
+export AWS_SECRET_ACCESS_KEY=c261b6ecabf7d37d5f9ded654b1c724adac9bd9f13e247a235e567e8296d2999
+aws s3api --endpoint http://localhost:9878 create-bucket --bucket bucket1
+```
+
+
+## S3 桶和 Ozone 桶的映射
+
+**注意**: Ozone 对 S3 REST 端点中缺失的卷都做了标记,在底层实现上,S3 的桶名被映射到 Ozone 桶的位置(取决于给定的认证信息)。
+
+要显示一个 S3 桶存储的位置,使用 `ozone s3 path <bucketname>` 命令。
+
+```bash
+aws s3api --endpoint-url http://localhost:9878 create-bucket --bucket=bucket1
+
+ozone s3 path bucket1
+Volume name for S3Bucket is : s3thisisakey
+Ozone FileSystem Uri is : o3fs://bucket1.s3thisisakey
+```
+
+## 客户端
+
+### AWS 命令行接口 
+
+通过指定自定义的 --endpoint 选项,`aws` 命令行接口可以在 Ozone S3 上使用。
+
+```bash
+aws s3api --endpoint http://localhost:9878 create-bucket --bucket buckettest
+```
+
+或者
+
+```bash
+aws s3 ls --endpoint http://localhost:9878 s3://buckettest
+```
+
+### S3 Fuse 驱动(goofys)
+
+Goofys 是一个 S3 FUSE 驱动,可以将 Ozone 的桶挂载到 POSIX 文件系统。
+
+```bash
+goofys --endpoint http://localhost:9878 bucket1 /mount/bucket1
+```


---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org