问题描述
http://169.254.169.254/ url返回ec2实例元数据.该网址托管在哪里,如何获取实例的元数据?是只有登录ec2实例才能访问的专用ip地址吗?
http://169.254.169.254/ url returns ec2 instance metadata. Where is this url hosted and how is it able to get meta-data of an instance? Is it private ip address which can be accessed only when logged into an ec2 instance?
推荐答案
对http://169.254.169.254
的调用被Amazon EC2虚拟机管理程序拦截,并返回到实例.这样的请求不会在网络上流动.
Calls to http://169.254.169.254
are intercepted by the Amazon EC2 hypervisor and are returned to the instance. Such requests do not flow over the network.
常见用途是:
- 实例元数据:
http://169.254.169.254/latest/meta-data/
- 用户数据:
http://169.254.169.254/latest/user-data/
- Instance metadata:
http://169.254.169.254/latest/meta-data/
- User data:
http://169.254.169.254/latest/user-data/
还有一个鲜为人知的地方:
There is also the lesser-known:
- 动态数据:
http://169.254.169.254/latest/dynamic/
有关更多详细信息,请参见:实例元数据和用户数据-Amazon Elastic Compute Cloud
For more details, see: Instance Metadata and User Data - Amazon Elastic Compute Cloud
这篇关于http://169.254.169.254/在哪里托管?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!