gpt4 book ai didi

networking - berkshelf 无法在 CentOS 上连接

转载 作者:行者123 更新时间:2023-12-04 19:34:41 25 4
gpt4 key购买 nike

我在 vagrant box 上安装了 ChecfDK。

Brekshelf 不好用。可以连接 无法连接

我检查了 Iptables 等,但在网络上找不到问题。
URL 可以通过 curl 访问,并且可以在 ubuntu 盒子上正常工作。

CentOS (https://github.com/takase1024/chefdk-centos)

[vagrant@vagrant-centos65 ~]$ cd /vagrant/berks
[vagrant@vagrant-centos65 berks]$ berks install
Resolving cookbook dependencies...
Fetching 'myapp' from source at .
Fetching cookbook index from http://api.berkshelf.com/...
Error retrieving universe from source: http://api.berkshelf.com/
* [Berkshelf::APIClient::TimeoutError] Unable to connect to: http://api.berkshelf.com/
E, [2014-08-25T03:14:08.122005 #1776] ERROR -- : Actor crashed!
Berkshelf::MissingLockfileCookbookVersion: Cookbook 'apache2' (2.0.0) not found in any of the sources! This can happen if the remote cookbook has been deleted or if the sources inside the Berksfile have changed. Please run `berks update apache2` to resolve to a valid version.
/opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/installer.rb:95:in `install'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/calls.rb:26:in `public_send'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/calls.rb:26:in `dispatch'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/calls.rb:63:in `dispatch'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/cell.rb:60:in `block in invoke'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/cell.rb:71:in `block in task'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor.rb:369:in `block in task'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/tasks.rb:55:in `block in initialize'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
E, [2014-08-25T03:14:08.123992 #1776] ERROR -- : Actor crashed!
Berkshelf::MissingLockfileCookbookVersion: Cookbook 'iptables' (0.13.2) not found in any of the sources! This can happen if the remote cookbook has been deleted or if the sources inside the Berksfile have changed. Please run `berks update iptables` to resolve to a valid version.
/opt/chefdk/embedded/apps/berkshelf/lib/berkshelf/installer.rb:95:in `install'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/calls.rb:26:in `public_send'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/calls.rb:26:in `dispatch'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/calls.rb:63:in `dispatch'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/cell.rb:60:in `block in invoke'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/cell.rb:71:in `block in task'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor.rb:369:in `block in task'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/tasks.rb:55:in `block in initialize'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
Cookbook 'apache2' (2.0.0) not found in any of the sources! This can happen if the remote cookbook has been deleted or if the sources inside the Berksfile have changed. Please run `berks update apache2` to resolve to a valid version.

(Following omitted)

[vagrant@vagrant-centos65 berks]$ curl http://api.berkshelf.com/
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>

(Following omitted)

最佳答案

在尝试使用 Berkshelf 工作流程后,我发现它不适用于在 Windows 主机上运行的 vagrant(或者我猜是 Virtual Box?)CentOS guest 。这是因为上面指出的超时问题。我的hacky修复是这样的。我知道它可能会更好地插入允许您将其作为变量传递的增强功能。

现在我假设您使用的是 ChefDK 的嵌入式 ruby​​ 和 berkshelf gem。如果不是,这些位置可能在其他地方。

在此处阅读有关特定类(class)的更多信息:

http://ruby-doc.org/gems/docs/b/berkshelf-api-client-1.2.0/Berkshelf/APIClient/Connection.html

[vagrant@vagrant-centos65 apache-acquity]$ cd /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-api-client-1.2.0/
lib/berkshelf/api_client
[vagrant@vagrant-centos65 api_client]$ vim connection.rb

找到这个:
def initialize(url, options = {})
options = options.reverse_merge(retries: 3, retry_interval: 0.5,
open_timeout: 3, timeout: 30)

并更改为:
def initialize(url, options = {})
options = options.reverse_merge(retries: 3, retry_interval: 0.5,
open_timeout: 30, timeout: 30)

保存并关闭,然后重试。

关于networking - berkshelf 无法在 CentOS 上连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25478993/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com