Can provisioned Redshift clusters and Serverless Redshift clusters share data when they are in the same region and under the same account?

huangapple go评论55阅读模式
英文:

Can provisioned Redshift clusters and Serverless Redshift clusters share data when they are in the same region and under the same account?

问题

Provisioned Redshift clusters and Serverless Redshift clusters can share data when they are in the same region and under the same account.

在相同地区且在同一AWS账户下,已配置的Redshift集群和无服务器Redshift集群可以共享数据。

I created a data share in the provisioned Redshift cluster and entered the Namespace ID information of Serverless Redshift as the Consumer Namespace ID.

我在已配置的Redshift集群中创建了一个数据共享,并将Serverless Redshift的Namespace ID信息输入为消费者Namespace ID。

When I run the SHOW DATASHARES command in the Serverless Redshift query console, I get a list of data shares created in the provisioned Redshift cluster. In this case, share_type is INBOUND. However, when I use the following command, the list of schemas and tables registered for data sharing are not retrieved. The command is:

当我在Serverless Redshift查询控制台中运行SHOW DATASHARES命令时,我会获得在已配置的Redshift集群中创建的数据共享列表。在这种情况下,share_type为INBOUND。然而,当我使用以下命令时,未检索到用于数据共享的架构和表的列表。命令如下:

DESC DATASHARE {MY-DATASHARE-NAME} OF NAMESPACE '{NAMESPACE-ID}' ;

I tried running all of the following commands in the serverless Redshift query console:

我尝试在Serverless Redshift查询控制台中运行以下所有命令:

DESC DATASHARE temp_datashare OF NAMESPACE '{Provisioned Redshift cluster namespace ID}' ;
or,
DESC DATASHARE temp_datashare OF NAMESPACE '{Serverless Redshift cluster namespace ID}' ;

我还尝试使用与创建数据共享的相反命令删除然后重新创建权限和数据共享列表。

但它没有起作用。

[Documents I referenced]
[我参考的文档]
https://docs.aws.amazon.com/ko_kr/redshift/latest/dg/within-account.html

英文:

Can provisioned Redshift clusters and Serverless Redshift clusters share data when they are in the same region and under the same account?

I created a data share in the provisioned Redshift cluster and entered the Namespace ID information of Serverless Redshift as the Consumer Namespace ID.

When I run the SHOW DATASHARES command in the Serverless Redshift query console, I get a list of data shares created in the provisioned Redshift cluster. In this case, share_type is INBOUND. However, when I use the following command, the list of schemas and tables registered for data sharing are not retrieved. The command is:

DESC DATASHARE {MY-DATASHARE-NAME} OF NAMESPACE '{NAMESPACE-ID}' ;

I tried running all of the following commands in the serverless Redshift query console:

DESC DATASHARE temp_datashare OF NAMESPACE '{Provisioned Redshift cluster namespace ID}' ;
or,
DESC DATASHARE temp_datashare OF NAMESPACE '{Serverless Redshift cluster namespace ID}' ;

I've also tried deleting and then recreating both the permissions and datashare list using the reverse command to create the data share.

But it didn't work.

[Documents I referenced]
https://docs.aws.amazon.com/ko_kr/redshift/latest/dg/within-account.html

答案1

得分: 0

在Amazon Redshift中,确实可以在预配的集群和无服务器命名空间之间共享数据。如果在描述数据共享时无法看到数据共享对象,可能是以下情况之一:

加密:生产者和消费者都应加密以启用数据共享。Redshift无服务器默认为加密,因此您需要确保您的生产者也已加密。

公开访问设置:如果消费者端点是公开访问的,但数据共享不是,那么无法进行数据共享。一般建议只在必要时才启用公开访问。要解决此问题,您可以禁用消费者端点的公开访问,或者使数据共享公开访问。在生产者端,您可以使用以下语句将数据共享设为公开访问:

ALTER DATASHARE temp_datashare SET PUBLICACCESSIBLE = TRUE;

排序规则:如果生产者具有特定的排序规则设置,请确保消费者使用相同的排序规则设置。
如果已满足这些要求,您可以继续在消费者端创建一个数据库,使用以下数据共享:

CREATE DATABASE consumer_db_test FROM DATASHARE temp_datashare OF NAMESPACE 'producer-namespace-id';

创建数据库后,您可以查询数据共享内的表:

SELECT * FROM consumer_db_test.test_schema.test_table;

如果数据共享未正常运作,错误消息将指示潜在问题。例如,错误可能表明公开访问的消费者无法访问数据库中的对象。

英文:

Sharing data between provisioned clusters and serverless namespaces in Amazon Redshift is indeed possible. If you're unable to see datashare objects when describing the datashare, it could be due to one of the following scenarios:

Encryption: Both the producer and consumer should be encrypted to enable data sharing. Redshift serverless is encrypted by default, so you need to ensure that your producer is also encrypted.

Publicly accessibile setting: If the consumer endpoint is publicly accessible but the datashare is not, data sharing won't be possible. It's generally recommended to avoid public accessibility unless necessary. To resolve this, you can either disable public accessibility for the consumer endpoint or make the datashare publicly accessible. On the producer end, you can use the following statement to make the datashare publicly accessible:

ALTER DATASHARE temp_datashare SET PUBLICACCESSIBLE = TRUE;

Collation: If the producer has specific collation settings, ensure that the consumer uses the same collation settings.
If you have addressed these requirements, you can proceed to create a database in the consumer using the datashare:

CREATE DATABASE consumer_db_test FROM DATASHARE temp_datashare OF NAMESPACE 'producer-namespace-id';

After creating the database, you can query a table within the datashare:

SELECT * FROM consumer_db_test.test_schema.test_table;

If there are any issues with the datashare not functioning properly, an error message will indicate the underlying problem. For example, an error may state that a publicly accessible consumer cannot access an object in the database.

huangapple
  • 本文由 发表于 2023年4月4日 15:42:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/75926708.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定