博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
535cf_CF对象存储
阅读量:2519 次
发布时间:2019-05-11

本文共 11084 字,大约阅读时间需要 36 分钟。

535cf

对象存储2
()

用于对象存储的Cloud Foundry CLI插件 (A Cloud Foundry CLI Plugin for Working With Object Storage)

A new plugin, , is now available.  This plugin provides users with the ability to work with Object Storage directly from the Cloud Foundry CLI. Users can take a look at the containers and objects currently in object storage and access, create and modify them. Object Storage has many great features, but they are not always the easiest to use especially when you want to upload very large files.   So the IBM jStart team has provided this CF CLI plugin to make uploading files and managing object storage contents easier.

新的插件现在可用。 该插件使用户能够直接从Cloud Foundry CLI使用对象存储。 用户可以查看当前在对象存储和访问中的容器和对象,以及创建和修改它们。 对象存储具有许多出色的功能,但并非总是最容易使用,尤其是当您要上传非常大的文件时。 因此,IBM jStart团队提供了此CF CLI插件,以使上传文件和管理对象存储内容更加容易。

In addition to standard objects, Object Storage has two very powerful types of aggregate files, Static Large Objects (SLOs) and Dynamic Large Objects (DLOs). You can find a ton of great information on SLOs and DLOs in . Both types of large objects use a manifest file to allow users to create large files out of small chunks. This is especially useful when trying to upload files greater than OpenStack’s maximum file size, 5GB. Currently, there is not much tooling around the use of large objects. Previously, users needed to upload each individual chunk via an HTTP request which can be quite tedious.

除了标准对象外,对象存储还具有两种非常强大的聚合文件类型:静态大对象(SLO)和动态大对象(DLO)。 在您可以找到有关SLO和DLO的大量重要信息。 两种类型的大对象都使用清单文件来允许用户从小块创建大文件。 当尝试上传大于OpenStack最大文件大小5GB的文件时,此功能特别有用。 当前,围绕大型对象的使用没有太多工具。 以前,用户需要通过HTTP请求上传每个单独的数据块,这可能非常繁琐。

This plugin, CF Object Storage (CFOS), also includes commands to make working with large objects easier than ever. This new Cloud Foundry CLI plugin works on as well as on other Cloud Foundry based platforms.  CFOS provides Cloud Foundry CLI users with sixteen new commands for interacting with OpenStack Object Storage. Specifics on these commands can be found . Now it is possible to fetch authentication credentials as well as upload DLOs, SLOs and standard objects from the CLI. This gets rid of the hassle of HTTP requests as well as the need to go through the long OpenStack authentication process. CFOS takes care of all of that for you.

这个插件CF Object Storage(CFOS)还包含一些命令,这些命令使处理大型对象比以往任何时候都更加容易。 这个新的Cloud Foundry CLI插件可在以及其他基于Cloud Foundry的平台上使用。 CFOS为Cloud Foundry CLI用户提供了十六个新命令,用于与OpenStack对象存储进行交互。 这些命令的详细信息可以在找到。 现在可以从CLI获取身份验证凭据以及上载DLO,SLO和标准对象。 这消除了HTTP请求的麻烦,也省去了漫长的OpenStack身份验证过程。 CFOS会为您解决所有这些问题。

为什么要使用大物体? (Why Use Large Objects?)

Great question, I’m glad you asked! In addition to uploading files that exceed the size limit, large objects have many other uses and benefits. But let’s start there. The main reason users will find themselves creating SLOs and DLOs is because their files are too large to upload directly. Both have the ability to break files into manageable chunks, the main difference being that DLOs provide the ability to add and remove chunks as desired. SLOs, on the other hand, must be provided with a user-generated manifest that defines exactly what chunks to include.

很好的问题,很高兴你问! 除了上传超出大小限制的文件外,大型对象还有许多其他用途和好处。 但是,让我们从这里开始。 用户发现自己创建SLO和DLO的主要原因是因为他们的文件太大而无法直接上传。 两者都有将文件分解为可管理块的能力,主要区别在于DLO提供了根据需要添加和删除块的能力。 另一方面,必须为SLO提供用户生成的清单,该清单准确定义要包括的块。

This strict manifest gives SLOs the advantage of being able to store their chunks across multiple containers. This allows us to exploit parallelism to upload and download large files faster. Because DLO manifests are actually zero-byte files that only define a container and filename prefix, all of their chunks must be located in the same container. This means users can upload chunks after the manifest is generated, but lose the ability to upload to or download from multiple containers at the same time.

这个严格的清单使SLO能够跨多个容器存储其块。 这使我们能够利用并行机制更快地上传和下载大文件。 由于DLO清单实际上是零字节文件,仅定义了容器和文件名前缀,因此它们的所有块都必须位于同一容器中。 这意味着用户可以在清单生成后上传块,但是不能同时上传或从多个容器下载。

How about a concrete example? We could use manifests to create sample subsets of large files without the need for redundant data uploads. This is quite useful when your files are large data sets that you may want to run some preliminary or test analysis on. Multiple manifests can take different sets of chunks (perhaps representing rows of a data set) and make different sample sets of varying sizes. Instead of having a bunch of large subsets of the same data, we just have a couple small manifest files.

一个具体的例子怎么样? 我们可以使用清单创建大型文件的样本子集,而无需冗余数据上传。 当您的文件是大型数据集,可能需要对其进行初步或测试分析时,此功能非常有用。 多个清单可以采用不同的块集(可能代表数据集的行),并制作不同大小的不同样本集。 而不是拥有一堆相同数据的大型子集,我们只有几个小清单文件。

You may also be wondering when to use a large object versus a regular object. You should only use a DLO when you plan on adding more data to the object after its initial upload. Generally, SLOs should only be used when uploading a file larger than 5GB, the maximum object size. There may be other more specialized use cases that could make SLOs useful with files of smaller sizes.

您可能还想知道何时使用大型对象而不是常规对象。 仅在计划在对象上载后向对象添加更多数据时才应使用DLO。 通常,仅当上传大于5GB(最大对象大小)的文件时,才应使用SLO。 可能还有其他更专业的用例,这些用例可能会使SLO对于较小文件的使用很有用。

安装及使用 (Installation and Usage)

The CF Object Storage contains detailed instructions for installation and usage of this plugin. The plugin is not currently supported in one of Cloud Foundry’s official repos, so it must be installed from binary. After downloading the binary from GitHub, running the following command from the binary’s directory will install CFLO.

CF Object Storage 包含有关此插件的安装和使用的详细说明。 Cloud Foundry的官方存储库之一当前不支持该插件,因此必须从二进制文件安装。 从GitHub下载二进制文件后,从二进制文件目录运行以下命令将安装CFLO。

1

1

$ cf install-plugin cf-object-storage

$ cf install-plugin cf-object-storage

Now you can use  cf os help SUBCOMMAND with any of the subcommands detailed on the GitHub page to view the usage details. Here are a few examples:

现在,您可以将cf os help SUBCOMMAND与GitHub页面上详述的任何子命令一起使用,以查看用法详细信息。 这里有一些例子:

USAGE: cf os containers service_name

USAGE: cf os containers service_name

1

1

2

2

3

3

4

4

5

5

6

6

cf os help containers

cf os help containers

NAME:

NAME:

containers – Show all containers in an Object Storage instance

containers – Show all containers in an Object Storage instance

USAGE:

USAGE:

cf os containers service_name

cf os containers service_name

USAGE: cf os put-large-object service_name slo_container slo_name source_file [-m] [-o output_file] [-s chunk_size] [-j num_threads]

USAGE: cf os put-large-object service_name slo_container slo_name source_file [-m] [-o output_file] [-s chunk_size] [-j num_threads]

OPTIONS: -m Only upload missing chunks -o Destination for log data, if desired -s Chunk size, in bytes (defaults to create 1000 chunks) -j Maximum number of uploader threads (defaults to the available number of CPUs)

OPTIONS: -m Only upload missing chunks -o Destination for log data, if desired -s Chunk size, in bytes (defaults to create 1000 chunks) -j Maximum number of uploader threads (defaults to the available number of CPUs)

1

1

2

2

3

3

4

4

5

5

6

6

7

7

8

8

9

9

10

10

11

11

12

12

$ cf os help put-large-object

$ cf os help put-large-object

NAME:

NAME:

put-large-object – Create a Static Large Object in Object Storage

put-large-object – Create a Static Large Object in Object Storage

USAGE:

USAGE:

cf os put-large-object service_name slo_container slo_name source_file [-m] [-o output_file] [-s chunk_size] [-j num_threads]

cf os put-large-object service_name slo_container slo_name source_file [-m] [-o output_file] [-s chunk_size] [-j num_threads]

OPTIONS:

OPTIONS:

-m Only upload missing chunks

-m Only upload missing chunks

-o Destination for log data, if desired

-o Destination for log data, if desired

-s Chunk size, in bytes (defaults to create 1000 chunks)

-s Chunk size, in bytes (defaults to create 1000 chunks)

-j Maximum number of uploader threads (defaults to the available number of CPUs)

-j Maximum number of uploader threads (defaults to the available number of CPUs)

A sample run of  containers  may look something like this.

容器的样本运行可能看起来像这样。

Containers in OS TestOS: [TestC TestD TestE]

Containers in OS TestOS: [TestC TestD TestE]

$ cf os containers TestOS

$ cf os containers TestOS

Working with containers in org yourOrg / space yourSpace as you@example.com…

Working with containers in org yourOrg / space yourSpace as you@example.com…

OK

OK

Containers in OS TestOS: [TestC TestD TestE]

Containers in OS TestOS: [TestC TestD TestE]

If you choose to create an SLO in your object storage, it may look something like this:

如果选择在对象存储中创建一个SLO,则它看起来可能像这样:

$ cf os put-large-object TestOS TestC SloName ~/large-object.txt

$ cf os put-large-object TestOS TestC SloName ~/large-object.txt

Creating SLO in org yourOrg / space yourSpace as you@example.com…

Creating SLO in org yourOrg / space yourSpace as you@example.com…

  *   Uploading SLO

  *   Uploading SLO

Speed 0.26 MB/s |===>      | 32%

Speed 0.26 MB/s |===>      | 32%

Note: This particular invocation of put-large-object  does not use the -s  flag, so the plugin uses the default chunk size, 1GB.

注意: put-large-object的此特定调用不使用-s标志,因此插件使用默认的块大小1GB。

If you have a small file and would like to create a regular object, it could look like this:

如果您的文件很小,并且想创建一个常规对象,则它可能如下所示:

Uploaded object object.txt to container TestC

Uploaded object object.txt to container TestC

$ cf os put-object TestOS TestC ~/object.txt

$ cf os put-object TestOS TestC ~/object.txt

Working with objects in org yourOrg / space yourSpace as you@example.com…

Working with objects in org yourOrg / space yourSpace as you@example.com…

Uploaded object object.txt to container TestC

Uploaded object object.txt to container TestC

Ryan Soley

Ryan began working with the jStart team as a co-op in May 2016. He is currently a senior at Penn State University pursuing his Bachelor’s degree in Computer Science.

Ryan于2016年5月开始与jStart团队合作,目前在宾夕法尼亚州立大学(Penn State University)攻读计算机科学学士学位。

Ryan Soley
Ryan Soley

翻译自:

535cf

转载地址:http://ztqwd.baihongyu.com/

你可能感兴趣的文章
HDU2112 HDU Today 最短路+字符串哈希
查看>>
JPanel重绘
查看>>
图片放大器——wpf
查看>>
SCALA STEP BY STEP
查看>>
cocos2d-x学习笔记
查看>>
MySql中的变量定义
查看>>
Ruby数组的操作
查看>>
hdu1181暴搜
查看>>
解码字符串 Decode String
查看>>
json学习笔记
查看>>
工具:linux 性能监控工具-nmon
查看>>
fatal error C1853
查看>>
Ural 1001 - Reverse Root
查看>>
玩转webpack之webpack的entry output
查看>>
java 操作mongodb查询条件的常用设置
查看>>
黑马程序员_java基础笔记(02)...java语言基础组成
查看>>
关于缓存击穿
查看>>
对innodb 拷贝文件实现数据库的方式(转)
查看>>
python知识点 2014-07-09
查看>>
FloatingActionButton的一点学习感悟
查看>>