質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Chef

ChefはRuby等で書かれた構成管理ツールです。 システム構築や、運用作業を自動化してくれます。

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

Q&A

解決済

1回答

2674閲覧

knife boot strapは成功するが、chef-clientは接続できない

退会済みユーザー

退会済みユーザー

総合スコア0

Chef

ChefはRuby等で書かれた構成管理ツールです。 システム構築や、運用作業を自動化してくれます。

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

0グッド

0クリップ

投稿2017/07/18 12:03

###前提・実現したいこと
Validatorless Bootstrapをためすと、knife bootstrapは成功しますが/etc/chef/validation.pemと/etc/chef/client.rbを生成しないため、chef-clientが接続できません。
/etc/chef以下の適切な設定方法は何でしょうか。。

###発生している問題・エラーメッセージ

[root@localhost vagrant]# knife bootstrap *.*.*.* -N 'chef-test' -r 'role[infra]' --ssh-user root -P xs-123 --sudo Node chef-test exists, overwrite it? (Y/N) Y Client chef-test exists, overwrite it? (Y/N) Y Creating new client for chef-test Creating new node for chef-test Connecting to *.*.*.* *.*.*.* -----> Existing Chef installation detected *.*.*.* Starting the first Chef Client run... ~中略~ *.*.*.* Running handlers complete *.*.*.* Chef Client finished, 0/1 resources updated in 05 seconds [root@localhost vagrant]# chef-client [2017-07-18T16:05:19+09:00] WARN: ***************************************** [2017-07-18T16:05:19+09:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options. [2017-07-18T16:05:19+09:00] WARN: ***************************************** Starting Chef Client, version 13.2.20 Creating a new client identity for localhost using the validator key. [2017-07-18T16:05:20+09:00] WARN: Failed to read the private key /etc/chef/validation.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/validation.pem> [2017-07-18T16:05:20+09:00] WARN: Failed to read the private key /etc/chef/validation.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/validation.pem> ================================================================================ Chef encountered an error attempting to create the client "localhost" ================================================================================ Private Key Not Found: ---------------------- Your private key could not be loaded. If the key file exists, ensure that it is readable by chef-client. Relevant Config Settings: ------------------------- validation_key "/etc/chef/validation.pem" System Info: ------------ chef_version=13.2.20 ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] program_name=chef-client worker: ppid=2629;start=16:05:19; executable=/opt/chef/bin/chef-client Running handlers: ~以下略~ [root@localhost vagrant]# cat /var/chef/cache/chef-stacktrace.out Generated at 2017-07-18 16:05:20 +0900 Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/validation.pem, which you told me to use to sign requests! /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http/authenticator.rb:95:in `rescue in load_signing_key' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http/authenticator.rb:85:in `load_signing_key' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http/authenticator.rb:42:in `initialize' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http.rb:98:in `new' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http.rb:98:in `block in initialize' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http.rb:97:in `each' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http.rb:97:in `initialize' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/server_api.rb:37:in `initialize' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:150:in `new' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:150:in `http_api' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:96:in `create' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:87:in `create_or_update' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:58:in `run' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/client.rb:666:in `register' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/client.rb:267:in `run' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:291:in `block in fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:279:in `fork' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:279:in `fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:244:in `block in run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/local_mode.rb:44:in `with_server_connectivity' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:232:in `run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:458:in `block in interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:457:in `loop' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:457:in `interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:441:in `run_application' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:59:in `run' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/bin/chef-client:26:in `<top (required)>' /usr/bin/chef-client:58:in `load' /usr/bin/chef-client:58:in `<main>' >>>> Caused by Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/validation.pem /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http/authenticator.rb:86:in `read' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http/authenticator.rb:86:in `load_signing_key' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http/authenticator.rb:42:in `initialize' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http.rb:98:in `new' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http.rb:98:in `block in initialize' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http.rb:97:in `each' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/http.rb:97:in `initialize' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/server_api.rb:37:in `initialize' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:150:in `new' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:150:in `http_api' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:96:in `create' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:87:in `create_or_update' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/api_client/registration.rb:58:in `run' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/client.rb:666:in `register' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/client.rb:267:in `run' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:291:in `block in fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:279:in `fork' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:279:in `fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:244:in `block in run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/local_mode.rb:44:in `with_server_connectivity' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:232:in `run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:458:in `block in interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:457:in `loop' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:457:in `interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/client.rb:441:in `run_application' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application.rb:59:in `run' /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/bin/chef-client:26:in `<top (required)>' /usr/bin/chef-client:58:in `load' /usr/bin/chef-client:58:in `<main>'[root@localhost vagrant]#

###試したこと
chef-serverの旧バージョンで発生したため、chef-serverを最新版にしました。
knife ssl checkなどは問題ありません。

###補足情報(言語/FW/ツール等のバージョンなど)
CentOS 7環境で、

  • chef client

chef-13.2.20-1.el7.x86_64.rpm

  • chef server

chef-server-core-12.15.8-1.el7.x86_64.rpm

yumでlocalinstallしました。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

chef-serverからclient.pemファイルをダウンロードし、kitchenのknife.rbを改変してclient.rbを作成しました。
とりあえず接続はできてしまったのですが、server faultかどっかでknife bootstrapはno longer maintenanceとか言われてたので皆様のお知恵をお借りしたかった次第です。

というわけで自己解決してしまったので、クローズです。

投稿2017/07/19 23:40

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問