擅长:python、mysql、java
<ol>
<li>您需要将python脚本存储在S3 bucket中</li>
<li>创建安装python和所有依赖项的Shell脚本,将python脚本从S3复制到本地存储并运行它。<a href="https://github.com/awslabs/aws-support-tools/blob/master/DataPipeline/MySqlRdsToPostgreSqlRds/dbconv-mysqlRDS-to-postgresqlRDS.sh" rel="nofollow noreferrer">Shell script example</a>。</li>
<li>将这个shell脚本存储在S3上</li>
<li>使用<a href="http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-object-shellcommandactivity.html" rel="nofollow noreferrer">ShellCommandActivity</a>启动shell脚本。</li>
</ol>
<p>可以使用此模板作为示例:
<a href="http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-template-redshiftrdsfull.html" rel="nofollow noreferrer">http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-template-redshiftrdsfull.html</a>
它使用存储在s3上的python脚本将MySQL模式转换为RedShift模式。</p>
<p>运行python程序的python shell脚本示例:</p>
<pre><code>#!/bin/bash
curl -O https://s3.amazonaws.com/datapipeline-us-east-1/sample-scripts/mysql_to_redshift.py
python mysql_to_redshift.py
</code></pre>