【问题标题】:AWS DMS can not start migrationAWS DMS 无法开始迁移
【发布时间】:2017-10-25 01:06:58
【问题描述】:

我为 AWS DMS 创建了一个堆栈,另一个用于两个测试 Postgres dbs AWS::RDS::DBInstancecfn-sphere 两个堆栈都已成功创建,我能够在源数据库中创建一个表并将数据加载到其中。

我试过start the replication task with boto3

client = boto3.client('dms')
response = client.start_replication_task(
    ReplicationTaskArn=replication_task_arn,
    StartReplicationTaskType='start-replication'
)

但它不起作用,我得到了错误:

botocore.errorfactory.InvalidResourceStateFault:发生错误 (InvalidResourceStateFault) 调用 StartReplicationTask 时 操作:复制实例(url)的测试连接应该是 复制任务启动成功

我试图从网站触发它,但我收到一条错误消息:

AWSDatabaseMigrationService:复制实例的测试连接 并且端点应该可以成功启动复制任务

不幸的是,复制实例和目标点之间的连接在网站上不起作用(我的帐户具有完全访问权限)。但它在我的命令行与 boto3 dms 客户端 test_connection 一起工作。

我的安全组规则是:

  SecurityGroupIngress:
    Type: 'AWS::EC2::SecurityGroupIngress'
    Properties:
      GroupId: !Ref dbSecurityGroup
      IpProtocol: tcp
      FromPort: '5432'
      ToPort: '5432'
      CidrIp: //my public ip

谁能指导我在哪里寻找以及如何解决它? (这是我的第一个 AWS 任务)

【问题讨论】:

    标签: amazon-web-services amazon-rds amazon-cloudformation boto3 aws-dms


    【解决方案1】:

    1) 确保复制实例和目标端点在同一个 vpc 中。否则,您必须执行 vpc 对等互连。两者也应该在同一地区。

    2) 将复制实例的安全组添加到目标数据库安全组的入站规则中。

    Type: AWS::EC2::SecurityGroup
    Properties: 
      GroupName: "target-endpoint-sg"
      GroupDescription: "security group of target db server"
      VpcId: <provide your vpc id>
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: '5432'
          ToPort: '5432'
          SourceSecurityGroupId: <sec-grp of ReplicationInstance>
    

    3) 如果您的目标数据库已经创建,则提供完整的服务器名称(例如:target-database-name.xxxxxxxxxxx.us-east-1.rds.amazonaws.com),当您创建目标端点时,用户名和密码值正确。在 aws 控制台中,转到 DMS -&gt; Endpoints -&gt; Select your endpoint checkbox -&gt; Test connection 以验证连接。

    如果成功,则在boto3客户端配置中使用相同用户的角色并使用test_connection方法进行测试。

    【讨论】:

      猜你喜欢
      • 2021-06-17
      • 2021-07-06
      • 1970-01-01
      • 2017-09-01
      • 1970-01-01
      • 2018-09-19
      • 1970-01-01
      • 1970-01-01
      • 2018-07-24
      相关资源
      最近更新 更多