这是在 Ubuntu 机器上。我在 Chef 服务器上安装了 knife backup gem 来备份服务器。
sudo gem install knife-backup
现在我创建一个 knife.rb
文件,配置如下。
log_level :info
log_location STDOUT
validation_client_name 'chef-validator'
validation_key '/etc/chef-server/chef-validator.pem'
chef_server_url 'https://ip'
当我运行以下命令时,
sudo knife backup export -D /etc/chef/backups -c knife.rb
它向我显示错误:-
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/ohai-7.0.4/lib/ohai/loader.rb:188: warning: character class has [' without escape /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/ohai-7.0.4/lib/ohai/loader.rb:188: warning: regexp has]' without escape
Backing up clients
ERROR: Your private key could not be loaded from /etc/chef/client.pem
Check your configuration file and ensure that your private key is readable
最佳答案
我已经使用下面的命令解决了这个问题。这是管理任务,我们需要为此描述用户和管理 key 。
sudo knife backup export -D /etc/chef/backups --user admin --key /etc/chef-server/admin.pem -c knife.rb
对于相同更好的描述,请给我更多的解决方案
关于chef-infra - 带有 Knife 备份的 Chef 服务器显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24374359/