无法使用Python脚本检索RedShift群集容量详细信息,如存储,内存

时间:2017-04-22 17:01:48

标签: amazon-redshift

我试图获取RedShift群集详细信息。我能够看到有关群集的许多细节,但很少有细节被遗漏。

对于Ex: - 详情存储内存

以下是代码: -

redshiftClient = boto3.client('redshift', aws_access_key_id = role.credentials.access_key,
    aws_secret_access_key = role.credentials.secret_key, aws_session_token = role.credentials.session_token, region_name='us-west-2')

#Getting all the clusters
clusters = redshiftClient.describe_clusters()

请你检查提供它的方法。

感谢。

1 个答案:

答案 0 :(得分:0)

describe-clusters命令不返回该类型的信息。该命令的输出是:

{
   "Clusters": [
   {
      "NodeType": "dw.hs1.xlarge",
      "Endpoint": {
         "Port": 5439,
         "Address": "mycluster.coqoarplqhsn.us-east-1.redshift.amazonaws.com"
      },
      "ClusterVersion": "1.0",
      "PubliclyAccessible": "true",
      "MasterUsername": "adminuser",
      "ClusterParameterGroups": [
         {
            "ParameterApplyStatus": "in-sync",
            "ParameterGroupName": "default.redshift-1.0"
         } ],
      "ClusterSecurityGroups": [
         {
            "Status": "active",
            "ClusterSecurityGroupName": "default"
         } ],
      "AllowVersionUpgrade": true,
      "VpcSecurityGroups": \[],
      "AvailabilityZone": "us-east-1a",
      "ClusterCreateTime": "2013-01-22T21:59:29.559Z",
      "PreferredMaintenanceWindow": "sat:03:30-sat:04:00",
      "AutomatedSnapshotRetentionPeriod": 1,
      "ClusterStatus": "available",
      "ClusterIdentifier": "mycluster",
      "DBName": "dev",
      "NumberOfNodes": 2,
      "PendingModifiedValues": {}
   } ],
   "ResponseMetadata": {
      "RequestId": "65b71cac-64df-11e2-8f5b-e90bd6c77476"
   }
}

您需要从Amazon CloudWatch检索内存和存储统计信息。

请参阅另一个问题:Amazon CloudWatch is not returning Redshift metrics

如果您确实想要检索有关标准群集的信息(即分配给每个节点的存储量和内存量,而不是当前内存和存储使用量),那么API调用无法获取该信息。请参阅:Amazon Redshift Clusters