錯誤:致命:找到#個節點,但沒有建立連接所需的屬性。嘗試設置另一個屬性以使用 - 屬性打開連接。警告:未能連接到ip-xxx-xx-xx-xx
我嘗試使用chef knife命令嘗試運行命令時就已經開始了這個問題。目的是讓命令在角色的任何服務器部分上運行,就像你看到的那樣。
所以,當我運行命令我得到了我得到以下
knife ssh "role:servers" "touch /home/ubuntu/file.txt"
WARNING: Failed to connect to ip-172-31-8-x.us-west-2.compute.internal -- SocketError: getaddrinfo: nodename nor servname provided, or not known
WARNING: Failed to connect to ip-172-31-94-xb.us-west-2.compute.internal -- SocketError: getaddrinfo: nodename nor servname provided, or not known
WARNING: Failed to connect to ip-172-31-99-x.us-west-2.compute.internal -- SocketError: getaddrinfo: nodename nor servname provided, or not known
當我嘗試新的屬性
knife ssh "role:web" "touch /home/ubuntu/file.txt" -x ubuntu -a hostname
FATAL: 6 nodes found, but does not have the required attribute to establish the
connection. Try setting another attribute to open the connection using --attribute.
我想目前存在的屬性,但是下面沒有運氣
knife ssh "role:servers" "touch /home/ubuntu/file.txt" -a ec2.public_hostname
knife ssh "role:servers" "touch /home/ubuntu/file.txt" -a public_hostname
knife ssh "role:servers" "touch /home/ubuntu/testfile.txt" --attribute 54.68.122.109 -i /Users/useraccount/.ssh/mykey.pem -x ubuntu
FATAL: 2 nodes found, but does not have the required attribute to establish the connection. Try setting another attribute to open the connection using --attribute.
顯然我錯過了一些東西。
我應該注意到,我能夠ssh進入服務器,但不能通過使用ip-172-31-xx.us-west-2.compute.internal來進行配置時主廚客戶端檢測到的,而是使用AWS公共IP。
這會影響我能夠正確運行上面的命令嗎?
廚師服務器列表節點數據
FQDN:IP-172-31-XX-xx.us - 西2.compute.internal
IP地址:172.31.xx. XX
,象這樣AWS設置匹配,
Priviate DNS:IP-172-31-XX-xx.us - 西2.compute.internal
級Priviate的IP:172.31.xx.xx
然而,信息AWS爲ssh方式連接到一個實例是
公共DNS:ec2-54-200-xx-xxx.us -west-2.compute.amazonaws.com 公共IP:54.200.xx.xxx
這是我能使用正確ssh到一個服務器(非刀)的AWS公共DNS數據。
如果可能的問題是廚師 - 客戶端提供節點數據到廚師服務器的方式,是否有改正它,所以廚師服務器反映節點aws公共ip數據?
請參閱第二個答案的意見在這裏:http://serverfault.com/questions/641951/knife-cant-ssh-into-newly-instantiated-ec2-server – Tensibai 2015-02-06 13:05:27
他們可能的情況下,如果是使用刀創建EC2但是,我正在使用自動安裝選項,其中chef-client -j /etc/chef/mynodes.json檢測實例設置,然後將其自身添加到廚師服務器。問題可能出在這裏。 FQDN和IP地址顯示不正確。我認爲他們應該向公衆顯示DNS名稱和IP地址。所以如果是這樣的話,很高興知道廚師如何添加這些信息。看着廚師,看不到如何通過公共信息。 – Lui 2015-02-10 00:17:17