ubuntu – 在本地(在实例上)关闭EC2实例?

前端之家收集整理的这篇文章主要介绍了ubuntu – 在本地(在实例上)关闭EC2实例?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
编辑:这似乎是我试图关闭AMI的一个问题.其他AMI通过“sudo poweroff”命令礼貌地关闭.

目标是让EC2实例自行关闭.我的所有实例都是Ubuntu 10.10.

我曾经能够执行命令“sudo poweroff -n -f”,实例将关闭.但是,现在实例停止响应并将其cpu固定在50%.

我已经尝试了关闭/暂停/关机的所有可能组合,它们都是:

>什么都不做,让实例仍在运行
>将实例置于此暂停/购买但仍处于“开启”状态

其他细节/确切场景:

>运行sudo poweroff:我得到了正常的“系统现在正在关闭电源!”信息.然后我回到了shell.系统不会关闭电源.如果我再次执行“sudo poweroff”,系统似乎关闭(ssh连接已终止),但AMI不会关闭并保持“运行”状态,cpu使用率保持不变(从AWS管理控制台监控) .
>现在运行sudo shutdown:我得到了正常的“系统现在正在维护!”消息但没有任何反应.系统保持正常运行.告诉syslog我看到以下消息:

Dec 21 16:24:36 ip-10-212-177-30 init: ssh main process (599) terminated with status 255
Dec 21 16:24:36 ip-10-212-177-30 init: rc main process (677) killed by TERM signal
Dec 21 16:24:36 ip-10-212-177-30 init: tty4 main process (678) killed by TERM signal
Dec 21 16:24:36 ip-10-212-177-30 init: tty5 main process (682) killed by TERM signal
Dec 21 16:24:36 ip-10-212-177-30 init: tty2 main process (685) killed by TERM signal
Dec 21 16:24:36 ip-10-212-177-30 init: tty6 main process (688) killed by TERM signal
Dec 21 16:24:36 ip-10-212-177-30 init: cron main process (692) killed by TERM signal
Dec 21 16:24:36 ip-10-212-177-30 init: irqbalance main process (701) killed by TERM signal
Dec 21 16:24:36 ip-10-212-177-30 init: tty3 main process (686) killed by TERM signal

调用“sudo poweroff”后的所有日志消息

sudo poweroff

==> auth.log <==
Dec 21 21:39:37 ip-10-244-74-146 sudo:   ubuntu : TTY=pts/1 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/sbin/poweroff

==> wtmp <==
02~~~runlevel2.6.35-28-virtualR?N?? 
Broadcast message from ubuntu@ip-10-244-74-146
    (/dev/pts/1) at 21:39 ...

The system is going down for power off NOW!

==> boot.log <==
init: Disconnected from system bus
init: dbus main process (663) killed by TERM signal
hostname: the specified hostname is invalid

系统仍在运行,没有变化

sudo poweroff

==> wtmp <==
~~~shutdown2.6.35-28-virtual)R?N^?

没有更多的日志文件,系统挂起,无法SSH,cpu旋转50%

sudo halt -p –verbose

ubuntu@ip-10-2-22-35:~$/sbin/runlevel 
N 2

ubuntu@ip-10-2-22-35:~$sudo halt -p --verbose
Calling shutdown

Broadcast message from ubuntu@ip-10-2-22-35
    (/dev/pts/1) at 17:31 ...

The system is going down for power off NOW!
ubuntu@ip-10-2-22-35:~$/sbin/runlevel 
2 0

ubuntu@ip-10-2-22-35:~$ps aux
USER       PID %cpu %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.1  0.1   2892  1732 ?        Ss   17:21   0:00 /sbin/init
root         2  0.0  0.0      0     0 ?        S    17:21   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    17:21   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S    17:21   0:00 [migration/0]
root         5  0.0  0.0      0     0 ?        S    17:21   0:00 [watchdog/0]
root         6  0.0  0.0      0     0 ?        S    17:21   0:00 [events/0]
root         7  0.0  0.0      0     0 ?        S    17:21   0:00 [cpuset]
root         8  0.0  0.0      0     0 ?        S    17:21   0:00 [khelper]
root         9  0.0  0.0      0     0 ?        S    17:21   0:00 [netns]
root        10  0.0  0.0      0     0 ?        S    17:21   0:00 [async/mgr]
root        11  0.0  0.0      0     0 ?        S    17:21   0:00 [pm]
root        12  0.0  0.0      0     0 ?        S    17:21   0:00 [xenwatch]
root        13  0.0  0.0      0     0 ?        S    17:21   0:00 [xenbus]
root        14  0.0  0.0      0     0 ?        S    17:21   0:00 [sync_supers]
root        15  0.0  0.0      0     0 ?        S    17:21   0:00 [bdi-default]
root        16  0.0  0.0      0     0 ?        S    17:21   0:00 [kintegrityd/0]
root        17  0.0  0.0      0     0 ?        S    17:21   0:00 [kblockd/0]
root        18  0.0  0.0      0     0 ?        S    17:21   0:00 [ata_aux]
root        19  0.0  0.0      0     0 ?        S    17:21   0:00 [ata_sff/0]
root        20  0.0  0.0      0     0 ?        S    17:21   0:00 [khubd]
root        21  0.0  0.0      0     0 ?        S    17:21   0:00 [kseriod]
root        22  0.0  0.0      0     0 ?        S    17:21   0:00 [kmmcd]
root        24  0.0  0.0      0     0 ?        S    17:21   0:00 [khungtaskd]
root        25  0.0  0.0      0     0 ?        S    17:21   0:00 [kswapd0]
root        26  0.0  0.0      0     0 ?        SN   17:21   0:00 [ksmd]
root        27  0.0  0.0      0     0 ?        S    17:21   0:00 [aio/0]
root        28  0.0  0.0      0     0 ?        S    17:21   0:00 [ecryptfs-kthrea]
root        29  0.0  0.0      0     0 ?        S    17:21   0:00 [crypto/0]
root        35  0.0  0.0      0     0 ?        S    17:21   0:00 [khvcd]
root        36  0.0  0.0      0     0 ?        S    17:21   0:00 [kstriped]
root        37  0.0  0.0      0     0 ?        S    17:21   0:00 [kmpathd/0]
root        38  0.0  0.0      0     0 ?        S    17:21   0:00 [kmpath_handlerd]
root        39  0.0  0.0      0     0 ?        S    17:21   0:00 [ksnapd]
root        40  0.0  0.0      0     0 ?        S    17:21   0:00 [kondemand/0]
root        41  0.0  0.0      0     0 ?        S    17:21   0:00 [kconservative/0]
root       143  0.0  0.0      0     0 ?        S    17:21   0:00 [xfs_mru_cache]
root       144  0.0  0.0      0     0 ?        S    17:21   0:00 [xfslogd/0]
root       145  0.0  0.0      0     0 ?        S    17:21   0:00 [xfsdatad/0]
root       146  0.0  0.0      0     0 ?        S    17:21   0:00 [xfsconvertd/0]
root       148  0.0  0.0      0     0 ?        S    17:21   0:00 [xfsbufd/sda1]
root       149  0.0  0.0      0     0 ?        S    17:21   0:00 [xfsaild/sda1]
root       150  0.0  0.0      0     0 ?        S    17:21   0:00 [xfssyncd/sda1]
root       177  0.0  0.0      0     0 ?        S    17:21   0:00 [flush-202:1]
root       183  0.0  0.0   2560   988 ?        S    17:21   0:00 /sbin/plymouthd --mode=boot --attach-to-session
root       187  0.0  0.0   4484  1260 ?        S    17:21   0:00 mountall --daemon
daemon     382  0.0  0.0   1968   536 ?        Ss   17:22   0:00 portmap
root       413  0.0  0.0   2304   252 ?        Ss   17:22   0:00 dhclient3 -e IF_METRIC=100 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth0
statd      593  0.0  0.0   2104   824 ?        Ss   17:22   0:00 rpc.statd -L
root       607  0.0  0.0      0     0 ?        S    17:22   0:00 [kjournald]
root       624  0.0  0.0      0     0 ?        S    17:22   0:00 [rpciod/0]
root       627  0.0  0.0      0     0 ?        S<   17:22   0:00 [kslowd000]
root       628  0.0  0.0      0     0 ?        S<   17:22   0:00 [kslowd001]
root       639  0.0  0.0      0     0 ?        S    17:22   0:00 [nfsiod]
ganglia    684  0.0  0.0   4260  1644 ?        Ss   17:22   0:00 /usr/sbin/gmond
root       723  0.0  0.1  52988  3168 ?        Ss   17:22   0:00 PHP-fpm: master process (/etc/PHP5/fpm/main.conf)      
www-data   724  0.0  0.1  52972  2536 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   725  0.0  0.1  52972  2540 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   726  0.0  0.1  52972  2540 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   727  0.0  0.1  52972  2540 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   728  0.0  0.1  52972  2540 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   729  0.0  0.1  52972  2540 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   730  0.0  0.1  52972  2540 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   731  0.0  0.1  52972  2540 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   732  0.0  0.1  52972  2540 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   733  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   734  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   735  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   736  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   737  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   738  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   739  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   740  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   741  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   742  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   743  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   744  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   746  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   747  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   748  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   750  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   751  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   753  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   754  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   755  0.0  0.1  52972  2652 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   756  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   757  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   758  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   759  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   760  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   761  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   762  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   763  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   764  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   765  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
www-data   766  0.0  0.1  52972  2656 ?        S    17:22   0:00 PHP-fpm: pool www                                      
root      1240  0.0  0.1   8848  3116 ?        Ss   17:31   0:00 sshd: ubuntu [priv] 
ubuntu    1334  0.0  0.0   8848  1368 ?        S    17:31   0:00 sshd: ubuntu@pts/1  
ubuntu    1335  0.5  0.3   9016  6048 pts/1    Ss   17:31   0:01 -bash
root      1373  0.0  0.0   1904   512 ?        Ss   17:31   0:00 /bin/sh /etc/init.d/rc 0
root      1375  0.0  0.0   3000  1304 ?        S    17:31   0:00 /bin/bash /etc/rc0.d/K01unregister stop
root      1394  0.0  0.1   5144  1952 ?        S    17:31   0:00 ssh -i /XXXX ubuntu@XXX.com sudo sh -c 'sed -e "/10.2.22.35      fb?"-//W3C//DTD??lang="e
ubuntu    1400  0.0  0.0   4280  1088 pts/1    R+   17:34   0:00 ps aux

两次调用halt -p之后的最后一次VMS控制台输出(在奇怪的50%cpu挂起状态下)

init: tty2 main process (679) killed by TERM signal

init: tty3 main process (680) killed by TERM signal

init: tty6 main process (682) killed by TERM signal

init: hwclock-save main process (881) terminated with status 1

init: Disconnected from system bus

init: dbus main process (618) killed by TERM signal

hostname: the specified hostname is invalid
[   52.346590] System halted.

谢谢!

查看作为AWS工具一部分的ec2stop / ec2-stop-instances命令

猜你在找的Ubuntu相关文章