可以RDS快照跨AWS账户被转移? [英] Can RDS snapshots be transferred across AWS accounts?

查看:1319
本文介绍了可以RDS快照跨AWS账户被转移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在自这个问题得到了回答,AWS工具的Powershell已被释放,我基本上有同样的问题:我在一个AWS账户,我想转移到另一个的RDS快照。

In the time since this question was answered, AWS Tools for Powershell has been released and I basically have the same problem: I have an RDS snapshot on one AWS account that I would like to transfer to another.

到目前为止,我已经能够选择,我想与 GET-RDSDBSnapshot cmdlet的快照,我想采取 Amazon.RDS.Model.DBSnapshot 对象,并把它用在其他帐户。

So far I've been able to select the snapshot that I want with the Get-RDSDBSnapshot cmdlet, and I'd like to take that Amazon.RDS.Model.DBSnapshot object and use it in the other account.

我一直在环顾四周,我觉得恢复-RDSDBInstanceFromDBSnapshot 小命令(映射到<一个href="http://docs.aws.amazon.com/AmazonRDS/latest/CommandLineReference/CLIReference-cmd-RestoreDBInstanceFromDBSnapshot.html">rds-restore-db-instance-from-db-snapshot)可能是我在寻找什么,但我不相信,我明白自己的行为 - 可以此cmdlet用于拍摄从我的第一个帐户我的快照,并将其恢复到了第二个帐户的一个实例。

I've been looking around and I think the Restore-RDSDBInstanceFromDBSnapshot cmdlet (maps to rds-restore-db-instance-from-db-snapshot) might be what I'm looking for, but I'm not confident that I understand its behavior -- can this cmdlet be used to take my snapshot from my first account, and restore it to an instance in the second account?

我如果有一个快照对象中的任何帐户的具体细节或将prevent来自全国各地的帐户移动数据cmdlet的处理特别关注。我会好起来的,比PowerShell的更广泛的解决方案,如果有的话。

I'm specifically concerned if there are any account-specific details in a Snapshot object or the handling of the cmdlet that would prevent that data from moving across accounts. I would be okay with a more general solution than powershell, if one exists.

推荐答案

更新2015年10月29号:

AWS增加了原生支持此功能href="https://aws.amazon.com/blogs/aws/amazon-rds-update-cross-account-snapshot-sharing/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A%20AmazonWebServicesBlog%20%28Amazon%20Web%20Services%20Blog%29"相对=nofollow>链接,公告)。这是支持未加密的MySQL,甲骨文,SQL Server和PostgreSQL的。

AWS has added native support for this functionality since my original posting (link to announcement). This is supported for unencrypted MySQL, Oracle, SQL Server, and PostgreSQL.

正在考虑公开分享你的RDS快照选项,或私下(由管理特定的AWS帐户ID有权限查看你的快照)。缺省情况下,快照可私下与多达20个帐户共享

You are given the option to share your RDS snapshot publicly, or privately (by managing specific AWS Account IDs with permission to view your snapshot). By default, snapshots can be privately shared with up to 20 accounts.

这可以从RDS控制台中点击管理快照(左侧导航栏)>分享快照(顶部工具栏),从而导致您到以下界面:

This can be managed from the RDS console by clicking 'Snapshots (left navigation bar) > Share Snapshot (top toolbar)', which leads you to the following UI:

输入图像的描述在这里

这也是RDS API和CLI中可用。

This is also available in the RDS API and CLI.

原来的答案:

我还张贴了这个对AWS开发者论坛,并得到了响应从菲利普@ AWS。这似乎是我们无法通过PowerShell的或其他任何方式都做到这一点。他确实有几个备选建议,虽然:

I also posted this to the AWS Developer Forums, and got a response from PhilP@AWS. It seems like we can't do this at all, via powershell or any other means. He did have a couple of alternate suggestions, though:

这是不可能直接从一个账户共享一个RDS快照   到另一个。不过,我可以让一对夫妇的建议,在这里(视   当前配置):

It's not possible to directly share an RDS Snapshot from one account to another. However I can make a couple of suggestions here (depending on your current configuration):

如果您的RDS实例可公开访问:

If your RDS Instance is publicly accessible:

      
  • 在启动一个新的RDS DB到您的第二个帐户
  •   
  • 在安装相应的数据库管理工具到PC,并给这台电脑的网络同时访问RDS实例(安全组和数据库用户访问读取和写入)
  •   
  • 使用数据库管理工具将数据复制从一个数据库到另一个数据库
  •   
  • Launch a new RDS DB onto your second account
  • Install the appropriate DB management tools onto a PC, and give this PC network access to both RDS instances (security groups and DB user access for read and write)
  • Using the database management tools to copy the data from one DB to the other DB

通过一个EC2实例作为中介的数据复制:

Copy data through an EC2 instance as an intermediary:

      
  • 在启动配置了相应的数据库服务器软件的一个EC2实例
  •   
  • 从您的RDS实例复制的RDS DB数据到你的EC2实例
  •   
  • 然后启动新的RDS实例进入第二个帐户
  •   
  • 在配置适当的访问(安全组和数据库用户访问读取和写入)
  •   
  • 从您的EC2实例的数据库中的数据复制到新创建的RDS实例
  •   
  • Launch an EC2 instance configured with appropriate DB server software
  • Copy the RDS DB Data from your RDS instance up to your EC2 instance
  • Then launch your new RDS instance into the second account
  • Configure appropriate access (security groups and DB user access for read and write)
  • Copy the database data from your EC2 instance to your newly created RDS instance

我的RDS实例不是公开访问,以及他的建议的EC2的解决办法是preferable。我们可以轮流回用mysqldump的,每个服务器故障的解决方案。

My RDS instance isn't publicly accessible, and of his suggestions the EC2 solution would be preferable. We could alternate back to using a mysqldump, per the Server Fault solution.

编辑:我想更新,我已经成功地得以实施EC2中介建议。这可以自动几种方法,但我选择的方案包括通过一个bash脚本到(Linux的AMI)的EC2实例作为用户的数据和数据传输的详细信息将在脚本被处理。

I wanted to update that I've successfully been able to implement the EC2 intermediary suggestion. This can be automated several ways, but the solution I chose involved passing a bash script to the (linux AMI) EC2 instance as user-data, and the details of data transfer were handled in the script.

该解决方案最终成为颇具性价比,有你想要的RDS实例和EC2实例在同一个可用区的警告。这在很大程度上是因为在同一个可用性区域RDS-EC2之间数据传输是免费的使用私有IP地址。

This solution ended up being fairly cost-effective, with the caveat that you want the RDS instance and the EC2 instance to be in the same availability zone. This is in large part because data transfer between RDS-EC2 in the same availability zone is free with a private IP address.

这篇关于可以RDS快照跨AWS账户被转移?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆