minio对象存储原理

Object storage is amazingly versatile. We normally associate it with AWS S3, but Object Storage can also be run on your private network with MinIO. In this article, I’ll show you how to install MinIO using Docker and also on a Mac using homebrew.

对象存储功能异常强大。 我们通常将其与AWS S3关联,但是对象存储也可以使用MinIO在您的专用网络上运行。 在本文中,我将向您展示如何使用Docker以及在Mac上使用自制软件安装MinIO。

MinIO has an API which is compatible with Amazon S3. This will allow you to develop applications locally and later, easily port them to AWS or you can use MinIO as your primary object store in production.

MinIO具有与Amazon S3兼容的API。 这将使您能够在本地和以后开发应用程序,轻松地将它们移植到AWS上,或者可以将MinIO用作生产中的主要对象存储。

先决条件 (Prerequisites)

You can code along with this tutorial on any operating system If you have Docker and docker-compose.

如果您拥有Docker和docker-compose,则可以与本教程一起在任何操作系统上进行编码。

If you have a Mac you will optionally have to have homebrew installed.

如果您使用Mac,则可以选择必须安装自制软件。

If you want to run the demo application at the end of the tutorial, you will need NodeJS installed.

如果要在本教程的结尾运行演示应用程序,则需要安装NodeJS。

安装 (Installation)

使用Homebrew安装MinIO (Install MinIO using Homebrew)

Homebrew is the fastest way to get MinIO up and running if you have a Mac. If you don’t have a Mac, follow the Docker tutorial below.

如果您使用Mac,Homebrew是启动和运行MinIO的最快方法。 如果您没有Mac,请遵循以下Docker教程。

brew install minio/stable/minio

I’m also going to install the mc CLI tool

我还将安装mc CLI工具

brew install minio/stable/mc

创建一个MinIO服务器实例 (Create a MinIO server instance)

Creating a new server instance is quite simple. Run the command below in a terminal.

创建一个新的服务器实例非常简单。 在终端中运行以下命令。

minio server /path/to/some/dir

The first time you run this command, you’re going to get nagged about default ACCESS_KEY and SECRET_KEY. Let’s change them now.

第一次运行此命令时,您将对默认的ACCESS_KEYSECRET_KEY ACCESS_KEY了解。 让我们现在更改它们。

Hit Ctrl+c to shut down the server.

Ctrl+c关闭服务器。

export ACCESS_KEY=adminexport ACCESS_SECRET=password

Now run the server again

现在再次运行服务器

minio server /path/to/some/dir

使用Docker安装MinIO (Installing MinIO using Docker)

This is my favoured approach. I have a Synology NAS, which I use to host Docker Containers and more. For MinIO it gives me plenty of storage space and access to S3 across my network.

这是我最喜欢的方法。 我有一个Synology NAS,可用来托管Docker容器等。 对于MinIO,它为我提供了足够的存储空间,并可以通过我的网络访问S3。

In this tutorial, I will use a docker-compose file so my instructions will work on any operating system you may be running. If you don’t have Docking installed, take a look at https://www.docker.com/

在本教程中,我将使用docker-compose文件,因此我的说明将在您可能正在运行的任何操作系统上运行。 如果您尚未安装扩展坞,请访问https://www.docker.com/

Create a new folder and create a docker-compose.yml file with the following contents.

创建一个新文件夹并创建一个包含以下内容docker-compose.yml文件。

Save the file and then the terminal, inside the same folder where the docker-compose file is located; run

保存文件,然后将终端保存在docker-compose文件所在的同一文件夹内; 跑

docker-compose up

The above command will bring 4 MinIO containers as a cluster. Each will have admin/password as credentials and the web interface accessible on

上面的命令将把4个MinIO容器作为一个群集。 每个人都将使用admin/password作为凭据,并可以通过以下网址访问网络界面

http://localhost:9001http://localhost:9002http://localhost:9003http://localhost:9004

Any data that is written or deleted from any one of the above instances will be replicated to the other 3.

从上述任一实例写入或删除的任何数据都将被复制到其他3。

In the subsequent sections, I will discuss accessing MinIO on port 9000 as that is the port created when installed using homebrew. If you have installed MinIO using Docker, just change port 9000 for one of the ports listed above.

在接下来的部分中,我将讨论在端口9000上访问MinIO,因为这是使用homebrew安装时创建的端口。 如果您使用Docker安装了MinIO,只需将端口9000更改为上面列出的端口之一。

其他作业系统 (Other operating systems)

The MinIO docker hub repo contains further details for installing MinIO. It also covers other operating systems such as Linux and Windows. https://registry.hub.docker.com/r/minio/minio/

MinIO泊坞中心存储库包含有关安装MinIO的更多详细信息。 它还涵盖其他操作系统,例如Linux和Windows。 https://registry.hub.docker.com/r/minio/minio/

MinIO Web界面 (The MinIO Web Interface)

This section of the tutorial assumes you used homebrew to install MinIO. If you used Docker, simply change the port number 9000 to 9001

本教程的这一部分假定您使用自制软件安装MinIO。 如果您使用的是Docker,只需将端口号9000更改为9001

In the terminal window where you started the MinIO server, you will see a list of web endpoints. You can use any of them. I will use http://localhost:9000 Visit this address in your browser.

在启动MinIO服务器的终端窗口中,您将看到Web端点列表。 您可以使用其中任何一个。 我将使用http://localhost:9000在浏览器中访问此地址。

MinIO Web UI login screen
MinIO Web UI登录屏幕

Enter admin/password for the ACCESS Key/Secret Key

输入admin/password作为ACCESS Key/Secret Key

MinIO Web Browser Interface
MinIO Web浏览器界面

The red button at the bottom right allows you to create new Buckets and upload files. I am going to create a new bucket called testing and upload a file.

右下方的红色按钮可让您创建新的存储桶并上传文件。 我将创建一个称为testing的新存储桶并上传文件。

MinIO Web Browser after creating a bucket and file
创建存储桶和文件后的MinIO Web浏览器

The file I uploaded is from https://www.bensound.com. I don’t think I need to give credit in this case, but I think it’s polite.

我上传的文件来自https://www.bensound.com 。 在这种情况下,我认为我无需赞扬,但我认为这很客气。

The ellipse to the right of the file allows Downloading, Deleting and time-limited link sharing.

文件右侧的椭圆允许DownloadingDeletingtime-limited link sharing

mc CLI工具 (mc CLI tool)

Let’s take a look at the MinIO CLI tool, mc

让我们看一下MinIO CLI工具mc

创建一个别名 (Creating an alias)

Before we can use mc, we need to create an alias to the MinIO server endpoint.

在使用mc之前,我们需要为MinIO服务器端点创建一个别名。

In the same terminal where your MinIO instance is running hit Ctrl+c to close the server. Then enter the following command in the terminal

在运行MinIO实例的同一终端中,按Ctrl + c关闭服务器。 然后在终端输入以下命令

mc alias set localS3 http://192.168.30.100:9000

I have used localS3 as the alias to the MinIO instance URL. You will need to change the IP address or use http://localhost:9000

我已经使用localS3作为MinIO实例URL的别名。 您将需要更改IP地址或使用http://localhost:9000

Now start the server again

现在再次启动服务器

在CLI中列出存储桶和文件 (Listing buckets and files in the CLI)

Keep the server running and open another terminal window.

保持服务器运行,并打开另一个终端窗口。

Enter the following command

输入以下命令

mc ls localS3

You should see the bucket testing that was created in the browser. The above command lists everything in the root of the data store.

您应该看到在浏览器中创建的存储桶testing 。 上面的命令列出了数据存储根目录中的所有内容。

Listing buckets
上市桶

To view the file that was uploaded

查看上载的文件

mc ls localS3/testing

and you should see

你应该看到

Listing files inside buckets
列出存储桶中的文件

使用mc删除文件和存储桶 (Deleting files and buckets with mc)

The two commands used to remove buckets and files are

用于删除存储桶和文件的两个命令是

  • rm : Removes a file

    rm :删除文件

  • rb : Removes a bucket

    rb :删除一个桶

I am going to remove the file first

我要先删除文件

mc rm locals3/testing/bensound-goinghigher.mp3
removing a file from a bucket
从存储桶中删除文件

and now to remove the bucket

现在要删除水桶

mc rb localS3/testing
removing a bucket
卸下水桶

If you again issue the command mc ls localS3 you will find that no results are returned.

如果再次发出命令mc ls localS3您将发现未返回任何结果。

Further mc commands and built in help (Further mc commands and built in help)

There is a lot more you can do with mc the built-in documentation is really helpful. To access the docs simply type mc —-help to get help on a specific command like ls type mc ls --help

mc还可以做很多事情,内置文档确实很有帮助。 要访问文档,只需键入mc —-help即可获得有关ls等特定命令的帮助,请键入mc ls --help

结合使用AWS-SDK和MinIO (Using AWS-SDK with MinIO)

As MinIO has an API compatible with AWS, it’s possible to use the AWS-SDK in your code. Even if your planning to use MinIO in production, using the AWS-SDK allows for a seamless transition to AWS at a future date.

由于MinIO具有与AWS兼容的API,因此可以在代码中使用AWS-SDK 。 即使您计划在生产中使用MinIO,使用AWS-SDK仍可在将来无缝过渡到AWS。

I’m going to demo the AWS-SDK in a small node app.

我将在一个小型节点应用程序中演示AWS-SDK。

In a terminal, issue the following commands

在终端中,发出以下命令

mkdir minio_democd minio_demonpm init -ynpm install aws-sdk

Create a new file app.js, open it in your editor, and add the following code.

创建一个新文件app.js ,在编辑器中将其打开,然后添加以下代码。

Change the endpoint to suit your MinIO store, if you followed the Docker section you can use any port between 9001 and 9004

更改端点以适合您的MinIO存储,如果您遵循Docker部分,则可以使用90019004之间的任何端口

If you run the app with the following command

如果您使用以下命令运行该应用程序

node app.js

You should get the following result.

您应该得到以下结果。

The result from running the demo node app
运行演示节点应用程序的结果

The above code creates a new bucket called awstest. It then creates an object with the contents Hello from MinIO! and uploads it to the bucket.

上面的代码创建了一个名为awstest的新存储桶。 然后,它创建一个包含Hello from MinIO!内容的对象Hello from MinIO! 并将其上传到存储桶。

After creating the bucket and object, the SDK is used again to download the object and save it to a local file in your app folder. Take a look, there should be a file called test_from_minio.txt

创建存储桶和对象后,将再次使用SDK下载对象并将其保存到您的应用文件夹中的本地文件中。 看一下,应该有一个名为test_from_minio.txt的文件

摘要 (Summary)

You have learned that MinIO is an Object Storage server with an AWS compatible API.

您已经了解到MinIO是具有AWS兼容API的对象存储服务器。

You can now install MinIO using Docker or homebrew on a Mac

您现在可以在Mac上使用Docker或Homebrew安装MinIO

You have installed mc the MinIO CLI and seen how it can be used to manage your MinIO instance.

您已经安装了mc MinIO CLI,并了解了如何将其用于管理MinIO实例。

You have seen how the aws-sdk can be used in a NodeJS script to interact with MinIO

您已经了解了如何在NodeJS脚本中使用aws-sdk与MinIO进行交互

翻译自: https://medium.com/the-innovation/running-s3-object-storage-locally-with-minio-f50540ffc239

minio对象存储原理


http://www.taodudu.cc/news/show-4293706.html

相关文章:

  • 《别看了,你学不会的》——Redis原理与实战(一)
  • 数据库技术之MySQL高级
  • SpringBoot 2 访问 Neo4j 图数据库
  • home brew php71安装,php,_mac home-brew 安装 php 失败,php - phpStudy
  • 半小时学会LevelDB原理及应用
  • 《数据库系统概念》一二章学习笔记
  • MongoDB报错 -【已解决】:Error: couldn‘t connect to server 127.0.0.1:27017, connection attempt failed:
  • 使用Spring Data访问MongoDB数据库
  • MongoDB安装、群集原理
  • NoSql数据库简介及Redis学习
  • brew | brew cask | yum | apt-get
  • 〖Python 数据库开发实战 - MongoDB篇②〗- Mac环境下的MongoDB数据库安装
  • redis 基本原理及安装
  • 文档型非关系数据库MongoDB经验总结
  • linux下进程管理的原理,Linux进程管理:supervisor和nohup原理及使用
  • 有关权重练习
  • CSS优先级权重练习
  • 关于修改WIFI代理后手机部分APP无法使用的解决办法
  • 【网络安全】练习与复习十二
  • bugku-misc练习(一)
  • selenium/requess爬取京东手机商品的详细信息1~selenium练习版
  • 嵌入式基础知识练习
  • 软件测试,软件测试练习题
  • 测试用例编写练习(二)
  • 小白都能懂的设计模式 java版 抽象工厂模式 实战练习(超详细)
  • PHP钓鱼教程,记录一次wifi钓鱼的调试 ——新手
  • 移动端测试介绍和练习
  • html实践手机调试
  • 【测试用例练习】二、手机app测试点
  • 用手机版python爬虫_Python爬虫也能用手机进行抓包?没错!这个技巧我只告诉你...

minio对象存储原理_使用MinIO在本地运行S3对象存储相关推荐

  1. ceph存储原理_【理论研究】漫谈传统IT基础设施10-存储(04)

    01-按照存储类型分类 01.独享式存储 指由单台存储设备提供服务,且相同的一块存储区域同一时间只能被单台设备访问(读写). 如DAS,块存储,SAN网络下的存储,具体产品包括磁盘阵列,硬盘. 此种存 ...

  2. ceph存储原理_赠书 | Linux 开源存储全栈详解——从Ceph到容器存储

    // 留言点赞赠书我有书,你有故事么?留言说出你的存储故事留言点赞前两名,免费送此书截止日期12.27号12.30号公布名单 // 内容简介 本书致力于帮助读者形成有关Linux开源存储世界的细致的拓 ...

  3. python程序运行原理_谈谈 Python 程序的运行原理

    因为我的个人网站 restran.net 已经启用,博客园的内容已经不再更新.请访问我的个人网站获取这篇文章的最新内容,谈谈 Python 程序的运行原理 这篇文章准确说是『Python 源码剖析』的 ...

  4. 【Kotlin】Kotlin 中使用 Lambda 表达式替代对象表达式原理分析 ( 尾随 Lambda - Trailing Lambda 语法 | 接口对象表达式 = 接口#函数类型对象 )

    文章目录 一.尾随 Lambda - Trailing Lambda 语法 二.Kotlin 中使用 Lambda 表达式替代对象表达式原理 1.Lambda 替换对象表达式 2.原理分析 3.示例分 ...

  5. ceph存储原理_热门的分布式存储系统ceph入门介绍

    一.什么是ceph ceph是当前最热门的分布式存储系统之一,是软件定义存储(SDS,SoftwareDefinedStorage)解决方案中的典范.其具备良好的可靠性.可扩展性,应用范围包括块存储( ...

  6. flink运行原理_浅谈Flink分布式运行时和数据流图的并行化

    本文将以WordCount的案例为主线,主要介绍Flink的设计和运行原理.关于Flink WordCount程序可以参考我之前的文章:读取Kafka实时数据流,实现Flink WordCount.阅 ...

  7. python查看对象占用内存_『Python』内存分析_List对象内存占用分析

    list声明后结构大体分为3部分,变量名称--list对象(结构性数据+指针数组)--list内容,其中id表示的是list对象的位置, v引用变量名称,v[:]引用list对象,此规则对python ...

  8. python中存储坐标_最好使用元组或numpy数组来存储坐标

    在内存消耗方面,numpy数组比Python元组更紧凑. numpy数组使用一个连续的内存块.numpy数组的所有元素必须是声明的类型(例如32位或64位float).Python tuple不一定使 ...

  9. mysql内置多个数据存储引擎_一个mysql数据库,既有myisam存储引擎,又有innodb存储引擎,参数如...

    key_buffer_size - 这对MyISAM表往说十分紧张.假设只是利用MyISAM表,可以把它设置为可用内存的 30-40%.合理的值取决于索引大年夜小.数据量和背载 -- 记住,MyISA ...

最新文章

  1. Uber无人车撞人视频公布,究竟哪儿出问题了?
  2. 一个项目中能提出哪些数据库优化_如何有效进行项目集管理?
  3. Nginx域名访问与访问控制
  4. php限制下载文件格式,php下载文件 强制任意文件格式下载
  5. 2018 年视频监控企业竞争力分析 海康威视连续七年蝉联全球第一
  6. 散列算法,Remal使用散列算法
  7. java——Runtime
  8. linux ftp验证指令,linux FTP常用指令说明
  9. 灰度共生矩阵GLCM及其matlab实现
  10. shell脚本加密教程
  11. 博科Brocade 6505光纤交换机
  12. fms安装教程 linux_[AS3]linux64下安装FMS5.0的方法
  13. ONLYOFFICE权限开发之二
  14. 【MVO TSP】基于matlab灰狼算法求解旅行商问题【含Matlab源码 1327期】
  15. cocos creator 学习随笔 day03 节点和组件属性
  16. 怎样制作GIF拼图?教你一键在线拼图
  17. 力扣 345. 反转字符串中的元音字母
  18. 化妆行业网站建设方案
  19. Appium 不懂就问,Appium 小白,在微信切换 webview 时遇到 Original error: unknown error: Failed to get PID for
  20. Mysql Workbench汉化

热门文章

  1. 信号量(Semaphore)、闭锁(Latch)、栅栏(Barrier)
  2. java实现附件预览(openoffice+swftools+flexpaper)
  3. 苹果开放降级通道_苹果出手,关闭降级系统iOS13验证,iOS14再也回不去了!
  4. (2)二叉树由后序(LRD)和中序(LDR)得到前序(DLR)
  5. Python基础之什么是字典?
  6. 科银资本 Jayden Wei 专访:全球首个区块链经济特区即将诞生
  7. Oracle PLSQL单行数据的处理
  8. Python挑战游戏( PythonChallenge)闯关之路Level- 4
  9. 数据结构与算法之美(一):概论
  10. 二阶常系数非齐次线性微分方程特解的设定规则