首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >厨师单人私钥在尝试使用数据库食谱时丢失

厨师单人私钥在尝试使用数据库食谱时丢失
EN

Stack Overflow用户
提问于 2014-11-15 08:48:47
回答 1查看 696关注 0票数 0

有人能告诉我我在这里做错了什么吗。我正在尝试使用主厨solo来部署rails堆栈。我正在使用数据库食谱。我有两个角色end服务器& sparkle_database_master,附在最后。

我的命令行:

代码语言:javascript
复制
knife solo cook --identity-file=/home/sburke/.ssh/sab-sburke-sparkle.pem -r "role[sparkle_database_master], role[webserver]" -E production ubuntu@54.173.103.4

输出:================================================================================ /home/ubuntu/chef-solo/cookbooks-2/database/recipes/master.rb ================================================================================中的配方编译错误

代码语言:javascript
复制
Chef::Exceptions::PrivateKeyMissing
-----------------------------------
I cannot read /etc/chef/client.pem, which you told me to use to sign requests!

Cookbook Trace:
---------------
  /home/ubuntu/chef-solo/cookbooks-2/database/recipes/master.rb:30:in `from_file'

Relevant File Content:
----------------------
/home/ubuntu/chef-solo/cookbooks-2/database/recipes/master.rb:

 23:  # will win out, so make sure the databags have the same passwords set for
 24:  # the root, repl, and debian-sys-maint users.
 25:  #
 26:  
 27:  db_info = {}
 28:  root_pw = ''
 29:  
 30>> search(:apps) do |app|
 31:    (app['database_master_role'] & node.run_list.roles).each do |dbm_role|
 32:      %w(root repl debian).each do |user|
 33:        user_pw = app["mysql_#{user}_password"]
 34:        if !user_pw.nil? && user_pw[node.chef_environment]
 35:          Chef::Log.debug("Saving password for #{user} as node attribute node['mysql']['server_#{user}_password'")
 36:          node.set['mysql']["server_#{user}_password"] = user_pw[node.chef_environment]
 37:          node.save
 38:        else
 39:          log "A password for MySQL user #{user} was not found in DataBag 'apps' item '#{app["id"]}' for environment ' for #{node.chef_environment}'." do


Running handlers:
[2014-11-15T08:38:44+00:00] ERROR: Running exception handlers
Running handlers complete
[2014-11-15T08:38:44+00:00] ERROR: Exception handlers complete
[2014-11-15T08:38:44+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 1.24174155 seconds
[2014-11-15T08:38:44+00:00] ERROR: I cannot read /etc/chef/client.pem, which you told me to use to sign requests!
[2014-11-15T08:38:44+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.
sburke@sewer:~/sandbox/sparkle-kitchen$ knife solo cook --identity-file=/home/sburke/.ssh/sab-sburke-sparkle.pem -r "role[sparkle_database_master], role[webserver]" -E production ubuntu@54.173.103.4

sparkle_database_master角色

代码语言:javascript
复制
{
    "name": "sparkle_database_master",
    "default_attributes": {
        "postgresql": {
            "password": {
                "postgres": "md586643717dc6cb1111610b853bf48efbb"
            },
            "config": {
                "listen_addresses": "localhost",
                "port": "5432"
            }
        }
    },
    "json_class": "Chef::Role",

    "env_run_lists": {
        "production": ["recipe[postgresql::server]",
                       "recipe[database::master]",
                       "recipe[database::postgresql]"
                      ]
    },
    "chef_type": "role",
    "override_attributes": {
        "postgresql": {
            "password": {
                "postgres": "md586643717dc6cb1111610b853bf48efbb"
            },
            "config": {
                "listen_addresses": "localhost",
                "port": "5432"
            }
        }
    }
}

role服务器角色

代码语言:javascript
复制
{
  "name": "webserver",
  "default_attributes": {
  },
  "json_class": "Chef::Role",
  "env_run_lists": {
    "production": ["recipe[build-essential::default]",
                   "recipe[apache2]",
                   "recipe[apache2::mod_ssl]",
                   "recipe[apache2::mod_rewrite]",
                   "recipe[apache2::mod_deflate]",
                   "recipe[apache2::mod_headers]",
                   "recipe[nodejs]",
                   "recipe[sparkle]"
                  ],
    "test": [ "role[base]", "recipe[apache2]", "recipe[apache::copy_test_configs]" ],
    "dev": [ "role[base]", "recipe[apache2]", "recipe[apache::copy_dev_configs]" ]
  },
  "run_list": [ "role[base]",
                "recipe[build-essential::default]",
                "recipe[apache2]",
                "recipe[apache2::mod_ssl]" ],
  "description": "The webserver role",
  "chef_type": "role",
  "override_attributes": {
      "passenger": {
          "install_method": "package",
          "package": {
              "name": "libapache2-mod-passenger"
          }
      }
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-11-15 18:09:34

database::master的菜谱目前与主厨单曲不兼容,尽管它可能是。要么使用chef-client --localchef-solo-search食谱,要么修补食谱,使其不使用search。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26944159

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档