使用数据共享 ,您可以在 Amazon Redshift 集群或 AWS 账户或 AWS 区域之间相对安全、轻松地共享实时数据,以用于读取目的。
数据共享 可以提高组织的敏捷性。它使您可以即时、精细、高性能地访问 Amazon Redshift 集群中的数据,而无需手动复制或移动数据,从而实现此目的。通过数据共享,您可以实时访问数据,以便您的用户可以在 Amazon Redshift 集群中查看更新的最新、最一致的信息。
1、创建新集群consumer cluster
按文档redshift使用手册 操作,创建新集群
2、使用控制台连接数据库创建数据共享
在 Cluster details(集群详细信息)页面上,从数据共享 选项卡中,在我的命名空间中创建的数据共享 中点击连接到数据库
在连接到数据库后,点击create datashare按钮,创建数据共享
添加数据使用者(Namespace为第1步中创建的新集群的名称)
3、接收数据共享
在新集群的数据共享 选项卡中,来自其他命名空间和 AWS 账户的数据共享 中点击连接到数据库
数据库连接成功后,可在列表中看到步骤2中创建的数据共享
4、查询共享数据
打开查询编辑器v2,连接新集群,可看到共享数据库
返回技术博客
With data sharing , you can securely and easily share live data across Amazon Redshift clusters, AWS accounts, or AWS Regions for read purposes.
Data sharing improves organizational agility by providing instant, granular, and high-performance access to data in Amazon Redshift clusters without the need to manually copy or move data. Through data sharing, users can access real-time data and always see the most up-to-date, consistent information across clusters.
1. Create a New Consumer Cluster
Follow the Redshift User Guide to create a new cluster.
2. Connect to the Database via Console and Create a Datashare
On the Cluster details page, go to the Datashares tab. Under Datashares created in my namespace , click Connect to database .
After connecting to the database, click the Create datashare button.
Add data consumers (set the Namespace to the name of the new cluster created in Step 1).
Once the datashare is created, it will appear in the list.
3. Receive the Datashare
On the new cluster's Datashares tab, under Datashares from other namespaces and AWS accounts , click Connect to database .
After the database connection is established, the datashare created in Step 2 will appear in the list.
Create a database from the datashare.
4. Query Shared Data
Open Query Editor v2, connect to the new cluster, and you will see the shared database.
Back to Tech Blog