Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8C933200D5C for ; Fri, 15 Dec 2017 19:39:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8B351160C28; Fri, 15 Dec 2017 18:39:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 83029160C14 for ; Fri, 15 Dec 2017 19:38:59 +0100 (CET) Received: (qmail 95715 invoked by uid 500); 15 Dec 2017 18:38:52 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 95480 invoked by uid 99); 15 Dec 2017 18:38:52 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Dec 2017 18:38:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 35776F2190; Fri, 15 Dec 2017 18:38:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: virajith@apache.org To: common-commits@hadoop.apache.org Date: Fri, 15 Dec 2017 18:39:31 -0000 Message-Id: <65698fb98a634cd1881e482416cf22d3@git.apache.org> In-Reply-To: <2758d1626bbe4b299c3edd88e5cd8512@git.apache.org> References: <2758d1626bbe4b299c3edd88e5cd8512@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [45/50] [abbrv] hadoop git commit: HDFS-12874. Documentation for provided storage. Contributed by Virajith Jalaparti archived-at: Fri, 15 Dec 2017 18:39:00 -0000 HDFS-12874. Documentation for provided storage. Contributed by Virajith Jalaparti Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3b610694 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3b610694 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3b610694 Branch: refs/heads/HDFS-9806 Commit: 3b6106949ec5c370a0450ff910b43d04153a795c Parents: c1bf265 Author: Chris Douglas Authored: Thu Dec 7 17:41:00 2017 -0800 Committer: Virajith Jalaparti Committed: Fri Dec 15 10:25:35 2017 -0800 ---------------------------------------------------------------------- .../src/main/resources/hdfs-default.xml | 2 +- .../src/site/markdown/HdfsProvidedStorage.md | 247 +++++++++++++++++++ 2 files changed, 248 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/3b610694/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml index 3dc583c..7b5ccbc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml @@ -4643,7 +4643,7 @@ The class that is used to specify the input format of the blocks on provided storages. The default is - org.apache.hadoop.hdfs.server.common.TextFileRegionAliasMap which uses + org.apache.hadoop.hdfs.server.common.blockaliasmap.impl.TextFileRegionAliasMap which uses file regions to describe blocks. The file regions are specified as a delimited text file. Each file region is a 6-tuple containing the block id, remote file path, offset into file, length of block, the http://git-wip-us.apache.org/repos/asf/hadoop/blob/3b610694/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsProvidedStorage.md ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsProvidedStorage.md b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsProvidedStorage.md new file mode 100644 index 0000000..7455044 --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsProvidedStorage.md @@ -0,0 +1,247 @@ + + +HDFS Provided Storage +===================== + +Provided storage allows data *stored outside HDFS* to be mapped to and addressed +from HDFS. It builds on [heterogeneous storage](./ArchivalStorage.html) by +introducing a new storage type, `PROVIDED`, to the set of media in a datanode. +Clients accessing data in +`PROVIDED` storages can cache replicas in local media, enforce HDFS invariants +(e.g., security, quotas), and address more data than the cluster could persist +in the storage attached to DataNodes. This architecture is particularly useful +in scenarios where HDFS clusters are ephemeral (e.g., cloud scenarios), and/or +require to read data that lives in other storage systems (e.g., blob stores). + +Provided storage is an experimental feature in HDFS. + + + +Introduction +------------ + +As of this writing, support for mounting external storage as `PROVIDED` blocks +is limited to creating a *read-only image* of a remote namespace that implements the +`org.apache.hadoop.fs.FileSystem` interface, and starting a NameNode +to serve the image. Specifically, reads from a snapshot of a remote namespace are +supported. Adding a remote namespace to an existing/running namenode, refreshing the +remote snapshot, unmounting, and writes are not available in this release. One +can use [ViewFs](./ViewFs.html) and [RBF](HDFSRouterFederation.html) to +integrate namespaces with `PROVIDED` storage into an existing deployment. + +Creating HDFS Clusters with `PROVIDED` Storage +---------------------------------------------- + +One can create snapshots of the remote namespace using the `fs2img` tool. Given +a path to a remote `FileSystem`, the tool creates an _image_ mirroring the +namespace and an _alias map_ that maps blockIDs in the generated image to a +`FileRegion` in the remote filesystem. A `FileRegion` contains sufficient information to +address a fixed sequence of bytes in the remote `FileSystem` (e.g., file, offset, length) +and a nonce to verify that the region is unchanged since the image was generated. + +After the NameNode image and alias map are created, the NameNode and DataNodes +must be configured to consistently reference this address space. When a DataNode +registers with an attached, `PROVIDED` storage, the NameNode considers all the +external blocks to be addressable through that DataNode, and may begin to direct +clients to it. Symmetrically, the DataNode must be able to map every block in +the `PROVIDED` storage to remote data. + +Deployment details vary depending on the configured alias map implementation. + +### `PROVIDED` Configuration + +Each NameNode supports one alias map. When `PROVIDED` storage is enabled, +the storage ID configured on the NameNode and DataNodes must match. +All other details are internal to the alias map implementation. + +The configuration to enable `PROVIDED` storage is as follows. +The configuration options available for the alias map implementations are +available below. + +```xml + + + + dfs.namenode.provided.enabled + true + Enabled provided storage on the Namenode + + + + dfs.datanode.data.dir + [DISK]/local/path/to/blocks/, [PROVIDED]remoteFS://remoteFS-authority/path/to/data/ + + + + dfs.provided.storage.id + DS-PROVIDED + The storage ID used for provided storages in the cluster. + + + + dfs.provided.aliasmap.class + org.apache.hadoop.hdfs.server.common.blockaliasmap.impl.TextFileRegionAliasMap + + + +``` + +### fs2img tool + +The `fs2img` tool "walks" over a remote namespace by recursively enumerating +children of a remote URI to produce an FSImage. Some attributes can be +controlled by plugins, such as owner/group mappings from the remote filesystem +to HDFS and the mapping of files to HDFS blocks. + +The various options available in running the tool are: + +| Option | Property | Default | Description | +|:------------------------|:--------------------------- |:----------------- |:---- | +| `-o`, `--outdir` | dfs.namenode.name.dir | file://${hadoop.tmp.dir}/dfs/name | Output directory | +| `-b`, `--blockclass` | dfs.provided.aliasmap.class | NullBlocksMap | Block output class | +| `-u`, `--ugiclass` | hdfs.image.writer.ugi.class | SingleUGIResolver | UGI resolver class | +| `-i`, `--blockidclass` | hdfs.image.writer.blockresolver.class | FixedBlockResolver | Block resolver class | +| `-c`, `--cachedirs` | hdfs.image.writer.cache.entries | 100 | Max active dirents | +| `-cid`, `--clusterID` | | | Cluster ID | +| `-bpid`, `--blockPoolID`| | | Block pool ID | + +#### Examples + +Assign all files to be owned by "rmarathe", write to gzip compressed text: +``` +hadoop org.apache.hadoop.hdfs.server.namenode.FileSystemImage \ + -Dhdfs.image.writer.ugi.single.user=rmarathe \ + -Ddfs.provided.aliasmap.text.codec=gzip \ + -Ddfs.provided.aliasmap.text.write.dir=file:///tmp/ + -b org.apache.hadoop.hdfs.server.common.blockaliasmap.impl.TextFileRegionAliasMap \ + -u org.apache.hadoop.hdfs.server.namenode.SingleUGIResolver \ + -o file:///tmp/name \ + hdfs://afreast/projects/ydau/onan +``` + +Assign ownership based on a custom `UGIResolver`, in LevelDB: +``` +hadoop org.apache.hadoop.hdfs.server.namenode.FileSystemImage \ + -Ddfs.provided.aliasmap.leveldb.path=file:///path/to/leveldb/map/dingos.db \ + -b org.apache.hadoop.hdfs.server.common.blockaliasmap.impl.LevelDBFileRegionAliasMap \ + -o file:///tmp/name \ + -u CustomResolver \ + hdfs://enfield/projects/ywqmd/incandenza +``` + + +Alias Map Implementations +------------------------- + +The alias map implementation to use is configured using the `dfs.provided.aliasmap.class` parameter. +Currently, the following two types of alias maps are supported. + +### InMemoryAliasMap + +This is a LevelDB-based alias map that runs as a separate server in Namenode. +The alias map itself can be created using the `fs2img` tool using the option +`-Ddfs.provided.aliasmap.leveldb.path=file:///path/to/leveldb/map/dingos.db -o org.apache.hadoop.hdfs.server.common.blockaliasmap.impl.LevelDBFileRegionAliasMap` +as in the example above. + +Datanodes contact this alias map using the `org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMapProtocol` protocol. + +#### Configuration + + +```xml + + + dfs.provided.aliasmap.inmemory.batch-size + 500 + + The batch size when iterating over the database backing the aliasmap + + + + + dfs.provided.aliasmap.inmemory.dnrpc-address + namenode:rpc-port + + The address where the aliasmap server will be running + + + + + dfs.provided.aliasmap.inmemory.leveldb.dir + file:///path/to/leveldb/map/dingos.db + + The directory where the leveldb files will be kept + + + + + dfs.provided.aliasmap.inmemory.enabled + true + Enable the inmemory alias map on the NameNode. Defaults to false. + + + + dfs.provided.aliasmap.class + org.apache.hadoop.hdfs.server.common.blockaliasmap.impl.InMemoryLevelDBAliasMapClient + + +``` + +### TextFileRegionAliasMap + +This alias map implementation stores the mapping from `blockID`s to `FileRegion`s +in a delimited text file. This format is useful for test environments, +particularly single-node. + +#### Configuration +```xml + + + dfs.provided.aliasmap.text.delimiter + , + + The delimiter used when the alias map is specified as + a text file. + + + + + dfs.provided.aliasmap.text.read.file + file:///path/to/aliasmap/blocks_blocPoolID.csv + + The path specifying the alias map as a text file, + specified as a URI. + + + + + dfs.provided.aliasmap.text.codec + + + The codec used to de-compress the alias map. Default value is empty. + + + + + dfs.provided.aliasmap.text.write.dir + file:///path/to/aliasmap/ + + The path to which the alias map should be written as a text + file, specified as a URI. + + + +``` + --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org