blob: 1c721bc91c954185a3653d335b252a95ab0e328a [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/shell.html">
<span>命令行接口</span>
</a>
</li>
<li class="">
<a href="../../zh/interface.html">
<span>编程接口</span>
</a>
</li>
<li class="">
<a href="../../zh/gdpr.html">
<span>GDPR</span>
</a>
</li>
<li class="">
<a href="../../zh/concept.html">
<span>概念</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/shell.html">命令行接口</a></li>
<li class="breadcrumb-item active" aria-current="page">Shell 概述</li>
</ol>
</nav>
<div class="pull-right">
<a href="../../shell/format.html"><span class="label label-success">English</span></a>
</div>
<div class="col-md-9">
<h1>Shell 概述</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.
-->
<p>Ozone shell 的帮助命令既可以在 <em>对象</em> 级别调用,也可以在 <em>操作</em> 级别调用。
比如:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">ozone sh volume --help</code></pre></div>
<p>此命令会列出所有对卷的可能操作。</p>
<p>你也可以通过它查看特定操作的帮助,比如:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">ozone sh volume create --help</code></pre></div>
<p>这条命令会给出 create 命令的命令行选项。</p>
<p></p></p>
<h3 id="通用命令格式">通用命令格式</h3>
<p>Ozone shell 命令都遵照以下格式:</p>
<blockquote>
<p><em>ozone sh object action url</em></p>
</blockquote>
<p><strong>ozone</strong> 脚本用来调用所有 Ozone 子命令,ozone shell 通过 <code>sh</code> 子命令调用。</p>
<p>对象可以是卷、桶或键,操作一般是各种动词,比如 create、list、delete 等等。</p>
<p>Ozone URL 可以指向卷、桶或键,格式如下:</p>
<p><em>[schema][server:port]/volume/bucket/key</em></p>
<p>其中,</p>
<ol>
<li><p><strong>Schema</strong> - 可选,默认为 <code>o3</code>,表示使用原生 RPC 协议来访问 Ozone API。</p></li>
<li><p><strong>Server:Port</strong> - OM 的地址,如果省略了端口, 则使用 ozone-site.xml 中的默认端口。</p></li>
</ol>
<p>根据具体的命令不同,卷名、桶名和键名将用来构成 URL,卷、桶和键命令的文档有更多具体的说明。</p>
<a class="btn btn-success btn-lg" href="../../zh/shell/volumecommands.html">Next >></a>
</div>
</div>
</div>
</div>
</div>
<script src="../../js/jquery-3.4.1.min.js"></script>
<script src="../../js/ozonedoc.js"></script>
<script src="../../js/bootstrap.min.js"></script>
</body>
</html>