ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

SequoiaDB巨杉数据库S3实例的连接

2021-03-19 18:02:24  阅读:231  来源: 互联网

标签:SequoiaDB name S3 bucket s3cmd s3 巨杉 my


本文档主要介绍如何通过 s3cmd 进行连接。

配置和连接

  • 配置 Access Key, Secret Key, S3 Endpoint, HTTPS protocol 和 DNS-style
$ ./s3cmd --configure

Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.
Access Key: ABCDEFGHIJKLMNOPQRST
Secret Key: abcdefghijklmnopqrstuvwxyz0123456789ABCD
Default Region [US]: CHN

Use "s3.amazonaws.com" for S3 Endpoint and not modify it to the target Amazon S3.
S3 Endpoint [s3.amazonaws.com]: 127.0.0.1:8002

Use "%(bucket)s.s3.amazonaws.com" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used
if the target S3 system supports dns based buckets.
DNS-style bucket+hostname:port template for accessing a bucket [%(bucket)s.s3.amazonaws.com]: mybucket.127.0.0.1:8002

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password: 
Path to GPG program [/usr/bin/gpg]: 

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP, and can only be proxied with Python 2.7 or newer
Use HTTPS protocol [Yes]: No 

On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can't connect to S3 directly
HTTP Proxy server name: 

New settings:
  Access Key: ABCDEFGHIJKLMNOPQRST
  Secret Key: abcdefghijklmnopqrstuvwxyz0123456789ABCD
  Default Region: CHN
  S3 Endpoint: 127.0.0.1:8002
  DNS-style bucket+hostname:port template for accessing a bucket: mybucket.127.0.0.1:8002
  Encryption password: 
  Path to GPG program: /usr/bin/gpg
  Use HTTPS protocol: False
  HTTP Proxy server name: 
  HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] 
Please wait, attempting to list all buckets...
Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...
Not configured. Never mind.

Save settings? [y/N] y  
Configuration saved to '/home/sdbadmin/.s3cfg'

操作桶和对象

  • 列举所有 bucket(bucket 相当于根文件夹)
s3cmd ls
  • 创建 bucket,且 bucket 名称是唯一的,不能重复
s3cmd mb s3://my-bucket-name
  • 删除空 bucket
s3cmd rb s3://my-bucket-name
  • 列举 bucket 中的内容
s3cmd ls s3://my-bucket-name
  • 上传 file.txt 到某个 bucket
s3cmd put file.txt s3://my-bucket-name/file.txt
  • 上传并将权限设置为所有人可读
s3cmd put --acl-public file.txt s3://my-bucket-name/file.txt
  • 批量上传文件
s3cmd put ./* s3://my-bucket-name/
  • 下载文件
s3cmd get s3://my-bucket-name/file.txt file.txt
  • 批量下载
s3cmd get s3://my-bucket-name/* ./
  • 删除文件
s3cmd del s3://my-bucket-name/file.txt
  • 获取对应的bucket所占用的空间大小
s3cmd du -H s3://my-bucket-name

点击巨杉数据库官网文档中心了解更多。

标签:SequoiaDB,name,S3,bucket,s3cmd,s3,巨杉,my
来源: https://blog.csdn.net/weixin_38515299/article/details/115012359

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有