2018-05-22 17:49:10 +00:00
|
|
|
---
|
2018-09-17 17:46:28 +00:00
|
|
|
title: Ozone CLI
|
|
|
|
menu:
|
|
|
|
main:
|
|
|
|
parent: Client
|
|
|
|
weight: 1
|
2019-04-29 20:28:19 +00:00
|
|
|
identifier: OzoneShell
|
2018-05-22 17:49:10 +00:00
|
|
|
---
|
2017-06-20 04:29:18 +00:00
|
|
|
<!---
|
2018-09-17 23:21:10 +00:00
|
|
|
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
|
2017-06-20 04:29:18 +00:00
|
|
|
|
2018-09-17 23:21:10 +00:00
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
2017-06-20 04:29:18 +00:00
|
|
|
|
|
|
|
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
|
2018-09-17 23:21:10 +00:00
|
|
|
limitations under the License.
|
2017-06-20 04:29:18 +00:00
|
|
|
-->
|
2018-09-17 17:46:28 +00:00
|
|
|
|
|
|
|
Ozone has a set of command line tools that can be used to manage ozone.
|
|
|
|
|
|
|
|
All these commands are invoked via the ```ozone``` script.
|
|
|
|
|
|
|
|
The commands supported by ozone are:
|
|
|
|
|
|
|
|
* **classpath** - Prints the class path needed to get the hadoop jar and the
|
|
|
|
required libraries.
|
2019-04-05 21:14:42 +00:00
|
|
|
* **dtutil** - Operations related to delegation tokens
|
2018-09-17 17:46:28 +00:00
|
|
|
* **fs** - Runs a command on ozone file system.
|
|
|
|
* **datanode** - Via daemon command, the HDDS data nodes can be started or
|
|
|
|
stopped.
|
|
|
|
* **envvars** - Display computed Hadoop environment variables.
|
|
|
|
* **freon** - Runs the ozone load generator.
|
|
|
|
* **genesis** - Developer Only, Ozone micro-benchmark application.
|
2018-10-10 00:52:06 +00:00
|
|
|
* **getconf** - Reads ozone config values from configuration.
|
2018-09-17 17:46:28 +00:00
|
|
|
* **jmxget** - Get JMX exported values from NameNode or DataNode.
|
|
|
|
* **om** - Ozone Manager, via daemon command can be started or stopped.
|
|
|
|
* **sh** - Primary command line interface for ozone.
|
|
|
|
* **scm** - Storage Container Manager service, via daemon can be
|
|
|
|
stated or stopped.
|
|
|
|
* **scmcli** - Developer only, Command Line Interface for the Storage
|
|
|
|
Container Manager.
|
|
|
|
* **version** - Prints the version of Ozone and HDDS.
|
|
|
|
* **genconf** - Generate minimally required ozone configs and output to
|
|
|
|
ozone-site.xml.
|
|
|
|
|
|
|
|
## Understanding Ozone command shell
|
|
|
|
The most used command when working with Ozone is the Ozone command shell.
|
|
|
|
Ozone command shell gives a command shell interface to work against
|
|
|
|
Ozone.
|
|
|
|
|
|
|
|
The Ozone shell commands take the following format.
|
|
|
|
|
|
|
|
> _ozone sh object action url_
|
|
|
|
|
|
|
|
**ozone** script is used to invoke all Ozone sub-commands. The ozone shell is
|
|
|
|
invoked via ```sh``` command.
|
|
|
|
|
|
|
|
The object can be a volume, bucket or a key. The action is various verbs like
|
|
|
|
create, list, delete etc.
|
|
|
|
|
|
|
|
|
|
|
|
Ozone URL can point to a volume, bucket or keys in the following format:
|
|
|
|
|
|
|
|
_\[scheme\]\[server:port\]/volume/bucket/key_
|
|
|
|
|
|
|
|
|
|
|
|
Where,
|
|
|
|
|
2019-03-01 01:09:05 +00:00
|
|
|
1. Scheme - This should be `o3` which is the native RPC protocol to access
|
|
|
|
Ozone API. The usage of the schema is optional.
|
2018-09-17 17:46:28 +00:00
|
|
|
|
|
|
|
2. Server:Port - This is the address of the Ozone Manager. This can be server
|
|
|
|
only, in that case, the default port is used. If this value is omitted
|
|
|
|
then the defaults specified in the ozone-site.xml will be used for Ozone
|
|
|
|
Manager address.
|
|
|
|
|
|
|
|
Depending on the call, the volume/bucket/key names will be part of the URL.
|
|
|
|
Please see volume commands, bucket commands, and key commands section for more
|
|
|
|
detail.
|
|
|
|
|
|
|
|
## Invoking help
|
|
|
|
|
|
|
|
Ozone shell help can be invoked at _object_ level or at _action_ level.
|
|
|
|
For example:
|
|
|
|
|
|
|
|
{{< highlight bash >}}
|
|
|
|
ozone sh volume --help
|
|
|
|
{{< /highlight >}}
|
|
|
|
|
|
|
|
This will show all possible actions for volumes.
|
|
|
|
|
|
|
|
or it can be invoked to explain a specific action like
|
|
|
|
{{< highlight bash >}}
|
|
|
|
ozone sh volume create --help
|
|
|
|
{{< /highlight >}}
|
|
|
|
This command will give you command line options of the create command.
|