要解决AWS Redshift无服务器数据目录自动挂载无法正常工作的问题,可以尝试以下解决方法:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RedshiftS3Access",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::your-bucket-name/*",
"arn:aws:s3:::your-bucket-name"
]
},
{
"Sid": "RedshiftAccess",
"Effect": "Allow",
"Action": [
"redshift:DescribeClusters",
"redshift:CreateClusterParameterGroup",
"redshift:ModifyCluster",
"redshift:DescribeClusterParameters",
"redshift:DescribeClusterParameterGroups",
"redshift:ModifyClusterParameterGroup",
"redshift:ResetClusterParameterGroup",
"redshift:DeleteClusterParameterGroup"
],
"Resource": "*"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RedshiftAccess",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::your-account-id:role/your-redshift-role-name"
},
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::your-bucket-name/*",
"arn:aws:s3:::your-bucket-name"
]
}
]
}
enable_user_activity_logging参数设置为true。可以使用以下SQL语句检查和修改参数组:-- 检查参数组设置
SELECT name, value FROM pg_settings WHERE name = 'enable_user_activity_logging';
-- 修改参数组设置(如果需要)
ALTER SYSTEM SET enable_user_activity_logging TO true;
aws redshift reboot-cluster --cluster-identifier your-cluster-identifier
以上是解决AWS Redshift无服务器数据目录自动挂载无法正常工作的一些常见方法和代码示例。根据具体情况,可能需要对代码示例进行适当修改。