1. 程式人生 > >AWS常見問題

AWS常見問題

fig ifcfg-eth pri 顯示 com blog base 3.1 amazon

  • 我的網站為何顯示空白頁面?
    ELB/ALB 有一個參數Idle timeout,默認為60秒,當執行一個請求時,如果後臺執行超時就會顯示空白頁面。

  • Disconnected: No supported authentication methods available(server sent: publickey,gssapi-keyex,gssapi-with-mic)
    用Centos 7 AMI創建了EC2 Instance,Putty連接時報這個錯誤,原因是用戶名錯了,Centos 7的用戶名不是ec2-user,也不是root,是centos。
  • Error: Host key not found, Permission denied (publickey), or Authentication failed, permission denied

    1. Redhat 7 如何設置DNS
      編輯文件 /etc/sysconfig/network-scripts/ifcfg-eth0
      修改其中的PEERDNS項
      PEERDNS="no"

    然後增加DNS,如:
    DNS1="10.184.13.14"
    DNS2="10.184.13.4"

    重啟系統後,文件/etc/resolv.conf中會自動增加DNS配置(如只在此文件中配置DNS,重啟後會丟失)

    4.Install CFN script for Centos7

    #!/bin/bash  
    # Setup CentOS 7 host as AMI  
    
    # Update base OS update, and install EPEL repo and Python Pip  
    sudo yum -y update  
    sudo yum –y install epel-release  
    sudo yum -y install python-pip  
    
    # Install Python add-ons:  
    sudo pip install pystache   
    sudo pip install argparse  
    sudo pip install python-daemon  
    sudo pip install requests  
    
    # Install CFN-BootStrap from source  
    curl -sSL https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | sudo tar -xpf -C - /opt  
    cd /opt/aws-cfn-bootstrap-1.4/  
    sudo python setup.py build  
    sudo python setup.py install  
    # Configure CFN  
    sudo ln -s /usr/init/redhat/cfn-hup /etc/init.d/cfn-hup  
    sudo chmod 775 /usr/init/redhat/cfn-hup  
    cd /opt  
    sudo mkdir aws  
    cd aws  
    sudo mkdir bin  
    ln -s /usr/bin/cfn-hup /opt/aws/bin/cfn-hup

    用easy_install更簡單:

    # easy_install --script-dir /opt/aws/bin https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz

    安裝新版本的easy_install

    # curl -O https://bootstrap.pypa.io/ez_setup.py
    # python ez_setup.py

    Adding aws-cfn-bootstrap (CloudFormation helper scripts) to custom Linux AMIs

    1. 使用CloudFormation創建Security Group,能否設置Group Name?
      目前還不能。目前支持自定義Name的資源類型請參見Name Type

    Making an Amazon EBS Volume Available for Use
    What are the optimal settings for using Apache as a back-end server for ELB?
    How do I assign a static hostname to a private Amazon EC2 instance running RHEL 7 or Centos 7?
    Migrate Your Procedural SQL Code with the AWS Schema Conversion Tool
    SQLines SQL Converter

    AWS常見問題