我想开始使用chef-solo
部署组件。
我还配置了solo.rb
和node.json
。
每当我运行命令时:chef-solo -c solo.rb -j node.json
我收到以下错误消息:
Error Resolving Cookbooks for Run List:
Missing Cookbooks:
------------------
Could not satisfy version constraints for: build-essential
Expanded Run List:
------------------
* blueprint-yum::default
* coremedia::chef_logging
* coremedia::reporting
* mysql::server
* coremedia::db_schemas
* mongodb::default
* coremedia::solr_master
* coremedia::master_live_server
* coremedia::content_management_server
* coremedia::workflow_server
* coremedia::caefeeder_preview
* coremedia::caefeeder_live
* coremedia::studio
* coremedia::studio_apache
* coremedia::certificate_generator
* coremedia::delivery
* coremedia::delivery_apache
Running handlers:
[2018-04-06T12:39:45+02:00] ERROR: Running exception handlers
Running handlers complete
[2018-04-06T12:39:45+02:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 02 seconds
[2018-04-06T12:39:45+02:00] FATAL: Stacktrace dumped to /var/chef-solo/cache/chef-stacktrace.out
[2018-04-06T12:39:45+02:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-04-06T12:39:45+02:00] ERROR: 412 "Precondition Failed"
[2018-04-06T12:39:45+02:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
node.json:
{
"fqdn":"bender",
"mysql":{
"allow_remote_root":true,
"bind_address":"xxx.x.x.x",
"use_upstart":false,
"server_repl_password":"xxx",
"server_debian_password":"xxx",
"server_root_password":"xxx",
"tunable":{
"wait_timeout":"7200"
},
"client": {
"packages": ["mysql-community-client", "mysql-community-devel"]
},
"server": {
"packages": ["mysql-community-server"]
}
},
"coremedia":{
"db":{
"schemas":["cm7management",
"cm7master",
"cm7replication",
"cm7caefeeder",
"cm7mcaefeeder"]
},
"yum":{
"local": {
"path": "/opt/git/cm8-hamburg-de/boxes/target/shared/rpm-repo/",
"archive": "/opt/git/cm8-hamburg-de/boxes/target/shared/rpm-repo/"
}
},
"content_archive_url":"/opt/git/cm8-hamburg-de/boxes/target/shared/content/content-users.zip",
"content_archive":"/opt/git/cm8-hamburg-de/boxes/target/shared/content/content-users.zip",
"configuration":{
"configure.STUDIO_TLD":"bender",
"configure.DELIVERY_TLD":"bender",
"configure.CROWD_APP_NAME":"admin",
"configure.CROWD_PASSWORD":"x",
"configure.CROWD_SERVER":"Crowd Server:8443",
"configure.ELASTIC_MAIL_HOST":"webserver@testhh.de",
"configure.DELIVERY_REPOSITORY_HTTP_PORT":"42080",
"configure.DELIVERY_SOLR_PORT":"44080"
},
"logging":{
"default":{
"com.coremedia":{"level":"info"},
"cap.server":{"level":"info"},
"hox.corem.server":{"level":"info"},
"workflow.server":{"level":"info"}
}
},
"tomcat":{
"manager":{
"credentials":{
"admin":{
"username":"admin",
"password" : "x",
"roles" : "manager-gui"
},
"script": {
"username" :"script",
"password" : "x",
"roles" : "manager-jmx,manager-script"
}
}
}
}
},
"run_list":[
"recipe[blueprint-yum::default]",
"recipe[coremedia::chef_logging]",
"recipe[coremedia::reporting]",
"recipe[mysql::server]",
"recipe[coremedia::db_schemas]",
"recipe[mongodb::default]",
"recipe[coremedia::solr_master]",
"recipe[coremedia::master_live_server]",
"recipe[coremedia::content_management_server]",
"recipe[coremedia::workflow_server]",
"recipe[coremedia::caefeeder_preview]",
"recipe[coremedia::caefeeder_live]",
"recipe[coremedia::studio]",
"recipe[coremedia::studio_apache]",
"recipe[coremedia::certificate_generator]",
"recipe[coremedia::delivery]",
"recipe[coremedia::delivery_apache]"
]
}
solo.rb:
file_cache_path '/var/chef-solo/cache'
cookbook_path ['/opt/git/cm8-hamburg-de/boxes/chef/chef-repo/cookbooks', '/opt/git/cm8-hamburg-de/boxes/chef/chef-repo/berks-cookbooks']
role_path ['/var/chef-solo/roles', '/opt/git/cm8-hamburg-de/boxes/chef/chef-repo/roles']
data_bag_path '/var/chef-solo/data_bags'
我的metadata.json的内容(cookbook:build-essential):
{
"name": "build-essential",
"description": "Installs C compiler / build tools",
"long_description": "",
"maintainer": "Opscode, Inc.",
"maintainer_email": "cookbooks@opscode.com",
"license": "Apache 2.0",
"platforms": {
"amazon": ">= 0.0.0",
"centos": ">= 0.0.0",
"debian": ">= 0.0.0",
"fedora": ">= 0.0.0",
"freebsd": ">= 0.0.0",
"mac_os_x": ">= 0.0.0",
"mac_os_x_server": ">= 0.0.0",
"oracle": ">= 0.0.0",
"redhat": ">= 0.0.0",
"scientific": ">= 0.0.0",
"smartos": ">= 0.0.0",
"suse": ">= 0.0.0",
"ubuntu": ">= 0.0.0"
},
"dependencies": {
},
"recommendations": {
},
"suggestions": {
"pkgutil": ">= 0.0.0"
},
"conflicting": {
},
"providing": {
},
"replacing": {
},
"attributes": {
},
"groupings": {
},
"recipes": {
"build-essential": "Installs packages required for compiling C software from source."
},
"version": "2.1.2"
}
我感谢任何帮助。非常感谢。
更新:chef-stacktrace.out:
Net::HTTPServerException: 412 "Precondition Failed"
/opt/chef/embedded/lib/ruby/2.4.0/net/http/response.rb:122:in `error!'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:152:in `request'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:131:in `post'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/policy_builder/expand_node_object.rb:177:in `sync_cookbooks'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/policy_builder/expand_node_object.rb:83:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/client.rb:513:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/client.rb:281:in `run'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:292:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:280:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:280:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:245:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:233:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/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.8.5/lib/chef/application/client.rb:457:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:457:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:441:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:59:in `run'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/solo.rb:225:in `run'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/bin/chef-solo:25:in `<top (required)>'
/usr/bin/chef-solo:59:in `load'
/usr/bin/chef-solo:59:in `<main>'
Berksfile
source 'https://supermarket.chef.io'
cookbook 'mongodb', '= 0.16.2'
# fixing the compat_resource cookbook that provides a compatibility layer for older chef versions and their concepts.
# here it provides mainly the compatibility layer for the old LWRP dsl which has been replaced in 12.5
cookbook 'compat_resource', '~> 12.10.7'
# vendored workspace cookbooks
cookbook 'coremedia', path: 'cookbooks/coremedia'
cookbook 'psdash', path: 'cookbooks/psdash'
cookbook 'blueprint-yum', path: 'cookbooks/blueprint-yum'