AWS常见问题

1. 我的网站为何显示空白页面?

ELB/ALB 有一个参数Idle timeout,默认为60秒,当执行一个请求时,如果后台执行超时就会显示空白页面。

2. 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

3. 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

5. 使用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

猜你喜欢

转载自billben.iteye.com/blog/2343089