开始/停止或重启后的AMI无法到达(SSH)EC2实例启动重启、实例、SSH、AMI

2023-09-11 08:48:06 作者:余生陪你去浪费

当我们启动一个实例从一个AMI。起初实例访问(SSH)。一旦我们停止/启动实例或重新启动它的机器成为通过ssh无法进入,我们可以但ping到它。我们看到下面的错误在系统日志中。

  AMI ID使用 -  AMI-72dc9220
实例 -  I-0896a15f  - 

Linux的rhel6.4 M1.large实例。
../

******************* BLKFRONT器件/ VBD / 2049 **********
后端的/本地/域/ 0 /后端/ VBD /二千○四十九分之二百三十六
无法读取/本地/域/ 0 /后端/ VBD /二千零四十九分之二百三十六/功能障碍。
无法读取/本地/域/ 0 /后端/ VBD /二千零四十九分之二百三十六/功能刷新缓存。
512字节14680064行业
**************************
主题kbdfront:指针:0x21e0130010,栈:0x3720000
FBFRONT器件/ VFB / 0 **********
KBDFRONT器件/ vkbd / 0 **********
无法读取设备/ VFB / 0 /后端-ID。
无法读取设备/ vkbd / 0 /后端-ID。
读取后端路径设备/ vkbd / 0 /后端时,错误ENOENT
主题kbdfront退出。
读取后端路径设备/ VFB / 0 /后端时,错误ENOENT

./
 

解决方案

之所以能够解决这个问题。这是由于从REDHAT的错误为6.4 RHEL实例。 从AMI启动机器后,连接到计算机并切换到root用户,并做出以下修改 /etc/rc.d/rc.local文件文件...

删除以下三行并保存文件:

 猫<< EOL>>在/ etc / SSH / sshd_config中
UseDNS无
的PermitRootLogin没有密码
../
 
苹果手机怎么设置铃声最简单的方法

人们还应该从删除垃圾条目的/ etc / SSH / sshd_config中文件。

这些更改后,一旦重新启动机器工作正常。

When we launch an instance from an AMI. At first the instance is accessible(ssh). Once we stop/start the instance or reboot it the machine becomes inaccessible via ssh,we can ping it though. We see below error in System log.

AMI ID used - ami-72dc9220
Instance - i-0896a15f - 

Linux rhel6.4 M1.large instance.
../

******************* BLKFRONT for device/vbd/2049 **********
backend at /local/domain/0/backend/vbd/236/2049
Failed to read /local/domain/0/backend/vbd/236/2049/feature-barrier.
Failed to read /local/domain/0/backend/vbd/236/2049/feature-flush-cache.
14680064 sectors of 512 bytes
**************************
Thread "kbdfront": pointer: 0x21e0130010, stack: 0x3720000
FBFRONT for device/vfb/0 **********
KBDFRONT for device/vkbd/0 **********
Failed to read device/vfb/0/backend-id.
Failed to read device/vkbd/0/backend-id.
Error ENOENT when reading the backend path device/vkbd/0/backend
Thread "kbdfront" exited.
Error ENOENT when reading the backend path device/vfb/0/backend

./

解决方案

Was able to fix this. This is due to a bug from REDHAT for 6.4 rhel instances. After launching the machine from an AMI, connect to the machine and switch to root user and make below changes to /etc/rc.d/rc.local file ...

Remove the following three lines and save the file:

cat <<EOL >> /etc/ssh/sshd_config 
UseDNS no 
PermitRootLogin without-password
../

One should also remove garbage entries from /etc/ssh/sshd_config file.

The machine once rebooted after these changes works fine.