- Effective DevOps with AWS
- Yogesh Raheja Giuseppe Borgese Nathaniel Felsen
- 134字
- 2021-07-23 16:27:30
Terminating our EC2 instance
As with most Hello World exercises, once the helloworld message is displayed, the goal is reached. It is now time to think about shutting down our server. Since we only pay for what we consume in AWS, freeing up unnecessary resources such as this server is a good strategy for making AWS very cost effective.
We can do a clean shutdown of the Hello World service using the stop command. We can then exit the virtual server and terminate our instance, as follows:
[ec2-user@ip-172-31-22-52 ~]$ sudo stop helloworld helloworld stop/waiting [ec2-user@ip-172-31-22-52 ~]$ ec2-metadata --instance-id instance-id: i-057e8deb1a4c3f35d [ec2-user@ip-172-31-22-52 ~]$ exit logout $ aws ec2 terminate-instances --instance-ids i-057e8deb1a4c3f35d { "TerminatingInstances": [ { "InstanceId": "i-057e8deb1a4c3f35d", "CurrentState": { "Code": 32, "Name": "shutting-down" }, "PreviousState": { "Code": 16, "Name": "running" } } ] }
推薦閱讀
- Java編程全能詞典
- 大數(shù)據(jù)技術(shù)基礎(chǔ)
- 三菱FX3U/5U PLC從入門到精通
- 網(wǎng)絡(luò)服務(wù)器架設(shè)(Windows Server+Linux Server)
- Effective DevOps with AWS
- 數(shù)據(jù)庫(kù)原理與應(yīng)用技術(shù)學(xué)習(xí)指導(dǎo)
- 機(jī)艙監(jiān)測(cè)與主機(jī)遙控
- VMware Performance and Capacity Management(Second Edition)
- 大數(shù)據(jù)技術(shù)入門(第2版)
- CompTIA Linux+ Certification Guide
- OpenStack Cloud Computing Cookbook
- 工業(yè)機(jī)器人安裝與調(diào)試
- 網(wǎng)絡(luò)脆弱性掃描產(chǎn)品原理及應(yīng)用
- 青少年VEX IQ機(jī)器人實(shí)訓(xùn)課程(初級(jí))
- MPC5554/5553微處理器揭秘