小编Jee*_*gre的帖子

无法连接到 AWS EC2 实例 - “主机密钥验证失败”

我已经设置了一个带有 Rails 包的 Ubuntu 实例,部署了我的应用程序,它运行良好。

但是,当我尝试做SSH,这不是让我对远程登录并抛出这样的错误:Host key verification failed

问题似乎一直存在。我已将弹性 IP 附加到该实例,但无法看到公共 DNS。

我的实例在新加坡地区运行。

ssh 调试输出:

OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 46.137.253.231 [46.137.253.231] port 22.
debug1: Connection established.
debug1: identity file st.pem type -1
debug1: identity file st.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-4ubuntu6
debug1: match: OpenSSH_5.5p1 Debian-4ubuntu6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0 …
Run Code Online (Sandbox Code Playgroud)

ssh authentication amazon-ec2

16
推荐指数
2
解决办法
3万
查看次数

实例已连续失败至少 Unhealthy Threshold 次数的健康检查

我正在尝试自动缩放我当前的实例,我现在正在运行一个中等实例并使用小型实例自动缩放。我使用命令行工具来配置设置,这是我用来扩展的配置,除了我的常规实例之外,我至少运行了一个实例,这意味着还有一个实例,并且我已附加到负载均衡器。

s-create-auto-scaling-group groupname --launch-configuration launchconfig --availability-zones ap-southeast-1a --min-size 1 --max-size 5 --load-balancers prod

但是当我检查负载均衡器时,它显示“停止服务”的原因“实例至少连续失败了不健康阈值的健康检查次数”。如何使用其公共 DNS 解决此问题,但由于键值对未附加到新创建的实例,因此我无法从实例获得任何响应,也无法通过 ssh 连接到它。

这是什么问题。我该如何解决。

请帮我解决它的小紧急,因为我从近 2 天开始就被打动了。

as-describe-launch-configs --show-long --headers



testLC,ami-e8c4bdba,t1.micro,(nil),(nil),(nil),(nil),default,2012-02-03T07:14:54.461Z,true,arn:aws:autoscaling:ap-southeast-1:346266270015:launchConfiguration:175a16db-1f6a-4514-9233-ac7cb34bca90:launchConfigurationName/testLC

as-describe-auto-scaling-groups --show-long --headers

testASG,testLC,ap-southeast-1a,2012-02-03T07:19:10.706Z,prod,EC2,1,5,1,300,0,(nil),(nil),arn:aws:autoscaling:ap-southeast-1:346266270015:autoScalingGroup:c4b584d0-bac4-4507-b972-4fc2b1bc53ac:autoScalingGroupName/testASG,(nil)

as-describe-auto-scaling-instances
i-43796716  testASG  ap-southeast-1a  InService  HEALTHY  testLC

elb-describe-lbs --headers --show-long

prod,prod-11719395.ap-southeast-1.elb.amazonaws.com,prod-11719395.ap-southeast-1.elb.amazonaws.com,Z1WI8VXHPB1R38,"{interval=120,target=HTTP:80/user/sign_in/,timeout=30,healthy-threshold=5,unhealthy-threshold=3}",ap-southeast-1a,(nil),(nil),"i-495dda1c, i-43796716","{protocol=HTTP,lb-port=80,instance-protocol=HTTP,instance-port=80,policies=AWSConsolePolicy-1}",(nil),"{policy-name=AWSConsolePolicy-1,expiration-period=180}","{owner-alias=amazon-elb,group-name=amazon-elb-sg}",(nil),2012-02-01T10:36:08.810Z

elb-describe-instance-health loadbalancername --headers --show-long

INSTANCE_ID,i-495dda1c,InService,N/A,N/A
INSTANCE_ID,i-43796716,OutOfService,Instance has failed at least the UnhealthyThreshold number of health checks consecutively.,Instance
Run Code Online (Sandbox Code Playgroud)

amazon-ec2 amazon-web-services

4
推荐指数
1
解决办法
1万
查看次数

如何配置 aws ec2 自动从 github 拉取代码

嗨,我正在运行一个配置为自动缩放的大型 ec2 ubuntu 实例。每当大型实例的负载增加时,它将启动一个新实例。但是启动的新实例不会有更新的代码。我在 github 中有我的代码仓库。如何配置新启动的实例以从 github 中提取代码并保持自身更新。

请注意

amazon-ec2 amazon-web-services

3
推荐指数
1
解决办法
3184
查看次数

如何根据内存设置自动伸缩策略

我能够设置自动缩放策略并且测试工作正常,我使用 EC2 小实例来运行 Ruby on Rails 应用程序,因为 Rails 更像是内存密集型平台我想根据内存而不是 CPU 利用率来扩展 EC2 实例. 我昨天用谷歌搜索,但没有得到任何实际上对我有帮助的结果。

任何的意见都将会有帮助。

ubuntu amazon-ec2

1
推荐指数
1
解决办法
2689
查看次数

sudo:抱歉,你必须有一个 tty 才能运行 sudo

我正在尝试将此 bash 脚本作为 cron 作业运行,但我收到一个错误,内容为 sudo: sorry, you must have a tty to run sudo. 我在亚马逊 EC2 linux 实例中运行这个 bash 脚本。

#!/bin/bash -
#get instance id - used for putting metric
INSTANCE_ID=`GET http://169.254.169.254/latest/meta-data/instance-id`

#could be done using "free" or "vmstat" - use of less and grep is believed to provide widest compatibility - CJ 2011-11-24
memfree=`less /proc/meminfo | grep -i MemFree | grep -o [0-9]*`
swaptotal=`less /proc/meminfo | grep -i SwapTotal | grep -o [0-9]*`
swapfree=`less /proc/meminfo | grep …
Run Code Online (Sandbox Code Playgroud)

linux sudo amazon-ec2 tty

1
推荐指数
2
解决办法
2850
查看次数