2016-12-13 5 views
0

ノード、サーバー、ワークステーションの3つのコンポーネントがあります。私はこれらを設定していませんでした。私はワークステーションからナイフステータスを実行することができ、現在の結果を返します(これは、ワークステーションからサーバーへの接続を確認するものです)。私は正常にシェフクライアントをノード自体から実行することができます(これは、ノードからサーバーへの接続が+確実に既にブートストラップされていると確信しています)。ノードはシェフサーバーに接続し、ワークステーションはシェフサーバーに接続しますが、同じノードをブートストラップすると失敗します

しかし、再度ブートストラップしようとすると失敗します。私が奇妙に感じることの1つは、ワークステーション上の/etc/chef/client.rbファイルが、node_name行をブートストラップしようとしているノードの名前に置き換えられたことに気づいたことです。多分それは正常ですか?

私が選べないことは、このエラーが/ someone/chefサーバーに接続できないように見えることです。しかし、上記のように、ワークステーションとノードの両方がシェフサーバーに認証して接続できることを確認しました。

私はドキュメントを見てきましたが、大きな問題はあいまいです。 "いくつかのものは/etc/chef/client.rbにあります。" - okですが、ノード、サーバー、またはワークステーション上にありますか?彼らはすべてこのファイルを持っています!

私はワークステーションの〜/ .chef/knife.rbに "client_key"行で示されている私のキーかもしれないと思いますが、私はそれを変更したくありません。サーバ。しかし、どこかに認証の故障があるように思えます - 私はどこでもブートストラップの間にそれを見つけることができません。

[[email protected] chef]# cat client.rb 
log_location  STDOUT 
chef_server_url "https://chefserver/organizations/domain" 
validation_client_name "domain-validator" 
node_name "workstation" 
ssl_verify_mode :verify_none 
trusted_certs_dir "/etc/chef/trusted_certs" 

[[email protected] chef]# knife bootstrap node.domain.goes.here -N node -x user -i /home/user/.ssh/id_rsa --sudo --use-sudo-password --node-ssl-verify-mode none -r recipe[chef-client] 
Doing old-style registration with the validation key at ~/.keys/domain-validator.pem... 
Delete your validation key in order to use your user credentials instead 

Connecting to node.domain.goes.here 
node.domain.goes.here -----> Existing Chef installation detected 
node.domain.goes.here Starting the first Chef Client run... 
node.domain.goes.here Starting Chef Client, version 12.10.24 
node.domain.goes.here 
node.domain.goes.here ================================================================================ 
node.domain.goes.here Chef encountered an error attempting to load the node data for "node" 
node.domain.goes.here ================================================================================ 
node.domain.goes.here 
node.domain.goes.here Authentication Error: 
node.domain.goes.here --------------------- 
node.domain.goes.here Failed to authenticate to the chef server (http 401). 
node.domain.goes.here 
node.domain.goes.here Server Response: 
node.domain.goes.here ---------------- 
node.domain.goes.here Invalid signature for user or client 'node' 
node.domain.goes.here 
node.domain.goes.here Relevant Config Settings: 
node.domain.goes.here ------------------------- 
node.domain.goes.here chef_server_url "https://chefserver/organizations/domain" 
node.domain.goes.here node_name   "node" 
node.domain.goes.here client_key  "/etc/chef/client.pem" 
node.domain.goes.here 
node.domain.goes.here If these settings are correct, your client_key may be invalid, or 
node.domain.goes.here you may have a chef user with the same client name as this node. 
node.domain.goes.here 
node.domain.goes.here Platform: 
node.domain.goes.here --------- 
node.domain.goes.here x86_64-linux 
node.domain.goes.here 
node.domain.goes.here 
node.domain.goes.here Running handlers: 
node.domain.goes.here [2016-12-13T13:51:26-05:00] ERROR: Running exception handlers 
node.domain.goes.here Running handlers complete 
node.domain.goes.here [2016-12-13T13:51:26-05:00] ERROR: Exception handlers complete 
node.domain.goes.here Chef Client failed. 0 resources updated in 01 seconds 
node.domain.goes.here [2016-12-13T13:51:26-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out 
node.domain.goes.here [2016-12-13T13:51:26-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
node.domain.goes.here [2016-12-13T13:51:26-05:00] ERROR: 401 "Unauthorized" 
node.domain.goes.here [2016-12-13T13:51:26-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 

[[email protected] chef]# cat client.rb 
log_location  STDOUT 
chef_server_url "https:/chef/organizations/domain" 
validation_client_name "domain-validator" 
node_name "node" 
ssl_verify_mode :verify_none 
trusted_certs_dir "/etc/chef/trusted_certs" 

答えて

1

あなたの組織内にその名前と一致するクライアントが既に存在している可能性があります。 knife client deleteで削除します。

1

私が理解していることは、新しい名前で再度ブートストラップしようとしていることです。これは動作しません。 ノードはすでにブートストラップされていて、古い名前のクライアント用のclient.pemファイルがすでにあります。これは、old-nameとしましょう。

シェフはclient.pemがここにあるので、new_name(ご質問はnode)の新しいクライアントを登録しようとしません。しかしnew_nameを使用すると、結果はクライアントnew_nameが他の誰かの鍵で認証しようとしています。

シェフサーバーではnew_nameが存在しないため、認証できません。

私はあなたが再びブートストラップしたい理由のわからないよ

ので、2つの解決策:あなたは、ノード名を変更するには、この場合のノード上にclient.pemファイルを削除して、ブートストラップを実行したい

  1. コマンドを再度実行します。
  2. ノードでシェフをもう一度実行したい場合は、この場合は任意のものを使用します。テストモデルではknife ssh -x user -i /home/user/.ssh/id_rsa 'name:old_name' 'sudo chef-client -r 'new_runlist'を使用できます。

client.pemを削除するには、ナイフsshでも実行できます。

コマンドラインでパスワードを渡すには、this Q/A on superuserを参照してください。両方のコマンドにスペースをあらかじめ指定しないと、プロセスリストとシェル履歴にパスワードが表示されます。

関連する問題