2017-08-03 99 views
0

試圖從勝利EC2實例獲取用戶數據EC2EC2 http://169.254.169.254/latest/user-data返回404

http://169.254.169.254/latest/user-data

我得到404 - Not Found錯誤

+1

你好嗎?在網頁瀏覽器中?也許:[AWS EC2 Windows 10無法訪問元數據](https://stackoverflow.com/a/45116140/174777) –

回答

-2

最簡單的方式獲得您的實例中的用戶數據的腳本內容是執行此:

curl http://169.254.169.254/latest/user-data | gunzip 
0

我看到了這個問題,以及:

[email protected]:/var/lib/cloud# curl http://169.254.169.254/latest/ 
dynamic 
meta-data 
[email protected]:/var/lib/cloud# 
[email protected]:/var/lib/cloud# curl http://169.254.169.254/latest/user-data 
<?xml version="1.0" encoding="iso-8859-1"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  
<head> 
    <title>404 - Not Found</title> 
</head> 
<body> 
    <h1>404 - Not Found</h1> 
</body> 
</html> 

請注意,第一個curl命令指示數據應該在那裏。