blob: 12181392759f614a1c206ec15eae2b63e21a002a [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Hadoop Ozone Documentation">
<title>Documentation for Apache Hadoop Ozone</title>
<link href="../../css/bootstrap.min.css" rel="stylesheet">
<link href="../../css/ozonedoc.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="#" class="navbar-left" style="height: 50px; padding: 5px 5px 5px 0;">
<img src="../../ozone-logo-small.png" width="40"/>
</a>
<a class="navbar-brand hidden-xs" href="#">
Apache Hadoop Ozone/HDDS documentation
</a>
<a class="navbar-brand visible-xs-inline" href="#">Hadoop Ozone</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/apache/hadoop-ozone">Source</a></li>
<li><a href="https://hadoop.apache.org">Apache Hadoop</a></li>
<li><a href="https://apache.org">ASF</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-2 col-md-2 sidebar" id="sidebar">
<ul class="nav nav-sidebar">
<li class="">
<a href="../../zh/">
<span>概述</span>
</a>
</li>
<li class="">
<a href="../../zh/start.html">
<span>快速入门</span>
</a>
</li>
<li class="">
<a href="../../zh/interface.html">
<span>编程接口</span>
</a>
</li>
<li class="">
<a href="../../zh/feature.html">
<span>GDPR</span>
</a>
</li>
<li class="">
<a href="../../zh/security.html">
<span>安全</span>
</a>
</li>
<li class="">
<a href="../../zh/concept.html">
<span>概念</span>
</a>
</li>
<li class="">
<a href="../../zh/tools.html">
<span>工具</span>
</a>
</li>
<li class="">
<a href="../../zh/recipe.html">
<span>使用配方</span>
</a>
</li>
<li><a href="../../design.html"><span><b>Design docs</b></span></a></li>
<li class="visible-xs"><a href="#">References</a>
<ul class="nav">
<li><a href="https://github.com/apache/hadoop"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> Source</a></li>
<li><a href="https://hadoop.apache.org"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> Apache Hadoop</a></li>
<li><a href="https://apache.org"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> ASF</a></li>
</ul></li>
</ul>
</div>
<div class="col-sm-10 col-sm-offset-2 col-md-10 col-md-offset-2 main">
<div class="col-md-9">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="../../">Home</a></li>
<li class="breadcrumb-item" aria-current="page"><a href="../../zh/concept.html">概念</a></li>
<li class="breadcrumb-item active" aria-current="page">Ozone Manager</li>
</ol>
</nav>
<div class="pull-right">
<a href="../../concept/ozonemanager.html"><span class="label label-success">English</span></a>
</div>
<div class="col-md-9">
<h1>Ozone Manager</h1>
<!---
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="alert alert-warning">
<p>注意:本页面翻译的信息可能滞后,最新的信息请参看英文版的相关页面。</p>
</div>
<p>Ozone Manager(OM)管理 Ozone 的命名空间。</p>
<p>当向 Ozone 写入数据时,你需要向 OM 请求一个块,OM 会返回一个块并记录下相关信息。当你想要读取那个文件时,你也需要先通过 OM 获取那个块的地址。</p>
<p>OM 允许用户在卷和桶下管理键,卷和桶都是命名空间的一部分,也由 OM 管理。</p>
<p>每个卷都是 OM 下的一个独立命名空间的根,这一点和 HDFS 不同,HDFS 提供的是单个根目录的文件系统。</p>
<p>与 HDFS 中单根的树状结构相比,Ozone 的命名空间是卷的集合,或者可以看作是个森林,因此可以非常容易地部署多个 OM 来进行扩展。</p>
<h2 id="ozone-manager-元数据">Ozone Manager 元数据</h2>
<p>OM 维护了卷、桶和键的列表。它为每个用户维护卷的列表,为每个卷维护桶的列表,为每个桶维护键的列表。</p>
<p>OM 使用 Apache Ratis(Raft 协议的一种实现)来复制 OM 的状态,这为 Ozone 提供了高可用性保证。</p>
<h2 id="ozone-manager-和-storage-container-manager">Ozone Manager 和 Storage Container Manager</h2>
<p>为了方便理解 OM 和 SCM 之间的关系,我们来看看写入键和读取键的过程。</p>
<h3 id="写入键">写入键</h3>
<ul>
<li>
<p>为了向 Ozone 中的某个卷下的某个桶的某个键写入数据,用户需要先向 OM 发起写请求,OM 会判断该用户是否有权限写入该键,如果权限许可,OM 分配一个块用于 Ozone 客户端数据写入。</p>
</li>
<li>
<p>OM 通过 SCM 请求分配一个块(SCM 是数据节点的管理者),SCM 选择三个数据节点,分配新块并向 OM 返回块标识。</p>
</li>
<li>
<p>OM 在自己的元数据中记录下块的信息,然后将块和块 token(带有向该块写数据的授权)返回给用户。</p>
</li>
<li>
<p>用户使用块 token 证明自己有权限向该块写入数据,并向对应的数据节点写入数据。</p>
</li>
<li>
<p>数据写入完成后,用户会更新该块在 OM 中的信息。</p>
</li>
</ul>
<h3 id="读取键">读取键</h3>
<ul>
<li>
<p>键读取相对比较简单,用户首先向 OM 请求该键的块列表。</p>
</li>
<li>
<p>OM 返回块列表以及对应的块 token。</p>
</li>
<li>
<p>用户连接数据节点,出示块 token,然后读取键数据。</p>
</li>
</ul>
<a class="btn btn-success btn-lg" href="../../zh/concept/storagecontainermanager.html">Next >></a>
</div>
</div>
</div>
</div>
</div>
<script src="../../js/jquery-3.5.1.min.js"></script>
<script src="../../js/ozonedoc.js"></script>
<script src="../../js/bootstrap.min.js"></script>
</body>
</html>