Chef: conexão recusada para upload do livro de receitas

6

Seja gentil, sou novo no chef, tentando configurar meu ambiente e ter algumas novas receitas para fazer upload no meu novo servidor do chef. Eu sou capaz de fazer alguns comandos, e eu fui capaz de knife bootstrap o novo nó, então eu tenho certeza que minha configuração está correta.

Parece que está tentando fazer o upload para o localhost quando eu ligo o registro detalhado. Eu tenho um servidor definido no meu knife.rb e também tentei especificar um servidor no comando faca com -s , sem sucesso.

$ knife cookbook upload -a
Uploading base         [0.1.0]
Uploading dovecot      [0.1.0]
Uploading postfix      [0.1.0]
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:762:in 'initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)

Com o servidor especificado:

$ knife cookbook upload -a -s https://mychefserver
Uploading base         [0.1.0]
Uploading dovecot      [0.1.0]
Uploading postfix      [0.1.0]
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:762:in 'initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)

E com -V:

$ knife cookbook upload -a -s https://mychefserver -V
Uploading base         [0.1.0]
Uploading dovecot      [0.1.0]
Uploading postfix      [0.1.0]
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
INFO: Saving base
INFO: Saving dovecot
INFO: Saving postfix
INFO: Uploading files
INFO: Uploading /Users/.../...-chef/cookbooks/base/recipes/default.rb (checksum hex = b3e608cb34530c1126b9df9a630af8f7) to https://localhost:443/bookshelf/organization-00000000000000000000000000000000/checksum-b3e608cb34530c1126b9df9a630af8f7?AWSAccessKeyId=c1856885418af6721fb2be208ec54665cb869971&Expires=1362163782&Signature=Yzq%2B97btwNYPEHiGwpVJjaEYs8k%3D
INFO: Uploading /Users/.../...-chef/cookbooks/base/CHANGELOG.md (checksum hex = f1df44f4bb93cd7273932708a6686e51) to https://localhost:443/bookshelf/organization-00000000000000000000000000000000/checksum-f1df44f4bb93cd7273932708a6686e51?AWSAccessKeyId=c1856885418af6721fb2be208ec54665cb869971&Expires=1362163782&Signature=/QThzu8xUqEVyzuMmIp1XPiGG28%3D
INFO: Uploading /Users/.../...-chef/cookbooks/base/metadata.json (checksum hex = 163c72c0947d9cf8c99442b215a8de44) to https://localhost:443/bookshelf/organization-00000000000000000000000000000000/checksum-163c72c0947d9cf8c99442b215a8de44?AWSAccessKeyId=c1856885418af6721fb2be208ec54665cb869971&Expires=1362163782&Signature=8oD9AJmgTk5cgpltIXMFTeQ2oi0%3D
INFO: Uploading /Users/.../...-chef/cookbooks/base/metadata.rb (checksum hex = 6608c1ae5e3ce19a777fe1059e7264c1) to https://localhost:443/bookshelf/organization-00000000000000000000000000000000/checksum-6608c1ae5e3ce19a777fe1059e7264c1?AWSAccessKeyId=c1856885418af6721fb2be208ec54665cb869971&Expires=1362163782&Signature=/fF5I2cNbupm1auyVkpzxdVaubs%3D
INFO: Uploading /Users/.../...-chef/cookbooks/base/README.md (checksum hex = 6a4d0867b35a496d39f4d2da92c86879) to https://localhost:443/bookshelf/organization-00000000000000000000000000000000/checksum-6a4d0867b35a496d39f4d2da92c86879?AWSAccessKeyId=c1856885418af6721fb2be208ec54665cb869971&Expires=1362163782&Signature=kWX4LhSquvdw68NBHxgD2s%2BPOH4%3D
INFO: Uploading /Users/.../...-chef/cookbooks/dovecot/recipes/default.rb (checksum hex = f122f4ccdcc72d81e880c467122a7606) to https://localhost:443/bookshelf/organization-00000000000000000000000000000000/checksum-f122f4ccdcc72d81e880c467122a7606?AWSAccessKeyId=c1856885418af6721fb2be208ec54665cb869971&Expires=1362163782&Signature=WAxlIpN3U5mrrUm7BGGwlbAD8lM%3D
INFO: Uploading /Users/.../...-chef/cookbooks/dovecot/CHANGELOG.md (checksum hex = 8c447bfd4084f175bbd758b330abb0a1) to https://localhost:443/bookshelf/organization-00000000000000000000000000000000/checksum-8c447bfd4084f175bbd758b330abb0a1?AWSAccessKeyId=c1856885418af6721fb2be208ec54665cb869971&Expires=1362163782&Signature=BFiSvfDIMmBUFehMvLSPru9TWwg%3D
INFO: Uploading /Users/.../...-chef/cookbooks/dovecot/metadata.json (checksum hex = a8206f560ccb896cb73be7e97cde3cbc) to https://localhost:443/bookshelf/organization-00000000000000000000000000000000/checksum-a8206f560ccb896cb73be7e97cde3cbc?AWSAccessKeyId=c1856885418af6721fb2be208ec54665cb869971&Expires=1362163782&Signature=dAqms7EwUJkmnto8kz6yrqV40kk%3D
log writing failed. Connection refused - connect(2)
log writing failed. Connection refused - connect(2)
INFO: Uploading /Users/.../...-chef/cookbooks/dovecot/metadata.rb (checksum hex = 81eccd27bf23c5ec35e8759fe80a3a7a) to https://localhost:443/bookshelf/organization-00000000000000000000000000000000/checksum-81eccd27bf23c5ec35e8759fe80a3a7a?AWSAccessKeyId=c1856885418af6721fb2be208ec54665cb869971&Expires=1362163782&Signature=Mf/KIRRgeVgpNM7DlngY5Atf%2BIQ%3D
log writing failed. Connection refused - connect(2)
log writing failed. Connection refused - connect(2)/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:762:in 'initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:762:in 'open'
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:762:in 'block in connect'
from /opt/chef/embedded/lib/ruby/1.9.1/timeout.rb:68:in 'timeout'
from /opt/chef/embedded/lib/ruby/1.9.1/timeout.rb:99:in 'timeout'
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:762:in 'connect'
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:755:in 'do_start'
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:744:in 'start'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in 'transmit'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in 'execute'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in 'execute'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/resource.rb:76:in 'put'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/cookbook_uploader.rb:142:in 'block in uploader_function_for'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/cookbook_uploader.rb:25:in 'call'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/cookbook_uploader.rb:25:in 'block (3 levels) in setup_worker_threads'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/cookbook_uploader.rb:24:in 'loop'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/cookbook_uploader.rb:24:in 'block (2 levels) in setup_worker_threads'

Obrigado antecipadamente.

    
por Eve Freeman 02.03.2013 / 00:36

2 respostas

14

Para resumir a sessão de IRC no link :

Chef-servidor redireciona os clientes api entre seus componentes (neste caso, erchef e bookshelf). Esses redirecionamentos são baseados no FQDN do servidor do chef. Se o servidor não tiver um FQDN válido no momento da instalação, isso poderá resultar em redirecionamentos para https://localhost:443 .

Uma solução é corrigir o FQDN no servidor do chef e executar chef-server-ctl reconfigure .

Outra solução é definir algumas opções em /etc/chef-server/chef-server.rb (eu tive que criar este arquivo) e depois executar chef-server-ctl reconfigure .

server_name = "192.168.114.11"
api_fqdn server_name

nginx['url'] = "https://#{server_name}"
nginx['server_name'] = server_name
lb['fqdn'] = server_name
bookshelf['vip'] = server_name
    
por 09.03.2013 / 14:37
0

Nossa, eu pensei que seria minha culpa, mas consegui encontrar este tópico: link

E parece que o instalador omnibus usa o fqdn como o valor de algumas coisas da configuração. Eu não consegui descobrir como consertá-lo, então eu apenas reinstalei o servidor do chef via RPM (depois de configurar um nome de host real para a caixa), e tentei os comandos de faca novamente, e eles funcionaram - como por mágica. / p>     

por 02.03.2013 / 14:52

Tags