您的位置:首页 > 其它

使用多台机器进行S3数据同步

2017-03-14 15:11 190 查看
使用多台机器进行S3数据同步时机器awscli环境的初始化:

---

- hosts: server1

  user: ubuntu

  sudo: yes

  gather_facts: no

  vars:

  tasks:

  - name: update apt repo

    apt: update_cache=yes

  - name: install  python-pip

    apt: name=python-pip state=present

  - name: install awscli

    pip: name=awscli

  - name: aws configure

    script: scripts/aws_configure.sh

    

    

 脚本 scripts/aws_configure.sh:  

#!/bin/sh

echo "<your access key>

<your secret key>

<region>

text

"|su   - ubuntu  -c  "aws configure"

创建syncing session:

ssh  ubuntu@<ip-address>  -C  'screen  -dmS  <session-name>  bash  -c    "aws  s3 sync s3://<bucket1>          s3://<bucket2>" '
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐