【问题标题】:In CentOS7 - No package aws-cfn-bootstrap available在 CentOS7 中 - 没有可用的软件包 aws-cfn-bootstrap
【发布时间】:2018-12-15 06:18:41
【问题描述】:

我正在尝试在 Cent OS 7 中使用带有 cfn-signal 的 AWS Cloud Formation 模板。根据documentation,提到使用

进行安装
yum install -y aws-cfn-bootstrap
or using RPM..

但是,它们都没有帮助,只会收到以下错误消息..

没有可用的软件包 aws-cfn-bootstrap。

【问题讨论】:

    标签: amazon-web-services centos7 amazon-cloudformation


    【解决方案1】:

    太好了,从forum.. 找到了一些有用的信息。然后,作为 sudo 用户在 CentOS 7 中尝试了以下操作。

    yum update -y
    yum install -y epel-release
    yum install -y https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.amzn1.noarch.rpm
    ln -s /usr/local/lib/python2.7/site-packages/cfnbootstrap /usr/lib/python2.7/site-packages/cfnbootstrap
    ls /opt/aws/bin/
    

    现在,我可以注意到它已成功安装在 /opt/aws/bin/

    【讨论】:

    • 我认为 epel-release 满足了 aws-cfn-bootstrap 的依赖关系..
    【解决方案2】:

    你应该试试这个:

    rpm -Uvh https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.amzn1.noarch.rpm

    或者

    1. 您也可以下载该文件:

    https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz

    1. 解压: tar -xzvf aws-cfn-bootstrap-latest.tar.gz

    另外,有关详细步骤,请尝试 AWS 论坛的解决方案: https://forums.aws.amazon.com/thread.jspa?messageID=599647

    【讨论】:

      【解决方案3】:

      这是我当前(正在工作!)的用户数据部分,它在 Centos7 中设置 aws-cfn-bootstrap。

      Properties:
        UserData:
          'Fn::Base64':
            !Sub |
             #!/bin/bash
             yum -y update
             yum -y install wget
             yum -y --enablerepo=extras install epel-release
             yum -y install python-pip
             pip install pystache argparse python-daemon requests
             cd /opt
             curl -O https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz
             curl -O https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.amzn1.noarch.rpm
             tar -xvpf aws-cfn-bootstrap-latest.tar.gz
             cd aws-cfn-bootstrap-1.4/
             python setup.py build
             python setup.py install
             ln -s /usr/init/redhat/cfn-hup /etc/init.d/cfn-hup
             chmod 775 /usr/init/redhat/cfn-hup
             mkdir /opt/aws
             mkdir /opt/aws/bin
             ln -s /usr/bin/cfn-hup /opt/aws/bin/cfn-hup
             set -o errexit
             /usr/bin/cfn-init -v --stack ${AWS::StackName} --resource EC2Instance --region ${AWS::Region}
             /usr/bin/cfn-signal --exit-code $? --stack ${AWS::StackName} --resource EC2Instance --region ${AWS::Region}
      

      干杯,祝你好运!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-02-14
        • 2017-06-04
        • 1970-01-01
        • 2017-06-26
        • 2019-05-01
        • 2014-12-26
        • 2023-03-29
        • 1970-01-01
        相关资源
        最近更新 更多