首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CoreOS: fleetctl列表-机器显示错误

CoreOS: fleetctl列表-机器显示错误
EN

Stack Overflow用户
提问于 2014-07-29 15:39:03
回答 3查看 3.4K关注 0票数 2

我在CoreOS上非常新,我正在尝试使用官方医生来创建一个由3个节点组成的带Vagrant的集群。但是,当我访问其中一个节点并执行命令:fleetctl list-machines时,输出显示了一些错误:

代码语言:javascript
复制
E0729 09:29:05.725714 01013 fleetctl.go:141] error attempting to check latest fleet version in Registry: 501: All the given peers are not reachable (Tried to connect to each peer twice and failed) [0]
Error retrieving list of active machines: 501: All the given peers are not reachable (Tried to connect to each peer twice and failed) [0]

我可以通过代理上网-> 172.23.1.0:3128

我怀疑发生错误是因为节点无法连接到 https://discovery.etcd.io/2bef6823259cdef6751632f1f7052ff3 ,但我不知道问题出在哪里,也不知道如何修复它。

我在用:

流浪汉-> 1.6.3

VirtualBox -> 4.3.10_Ubuntu

CoreOS盒-> 367.1.0 (稳定)

这些是我的资源文件:

Vagrantfile

代码语言:javascript
复制
# -*- mode: ruby -*-
# # vi: set ft=ruby :

require 'fileutils'

Vagrant.require_version ">= 1.6.0"

CLOUD_CONFIG_PATH = File.join(File.dirname(__FILE__), "user-data")
CONFIG = File.join(File.dirname(__FILE__), "config.rb")

# Defaults for config options defined in CONFIG
$num_instances = 1
$update_channel = "stable"
$enable_serial_logging = false
$vb_gui = false
$vb_memory = 1024
$vb_cpus = 1

# Attempt to apply the deprecated environment variable NUM_INSTANCES to
# $num_instances while allowing config.rb to override it
if ENV["NUM_INSTANCES"].to_i > 0 && ENV["NUM_INSTANCES"]
  $num_instances = ENV["NUM_INSTANCES"].to_i
end

if File.exist?(CONFIG)
  require CONFIG
end

Vagrant.configure("2") do |config|
  config.vm.box = "coreos-%s" % $update_channel
  #config.vm.box_version = ">= 308.0.1"
  config.vm.box_url = "coreos_production_vagrant.box"

  config.vm.provider :vmware_fusion do |vb, override|
      override.vm.box_url = "coreos_production_vagrant.box"
  end

  config.vm.provider :virtualbox do |v|
     v.check_guest_additions = false
     v.functional_vboxsf     = false
     v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
     v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
  end

  # plugin conflict
  if Vagrant.has_plugin?("vagrant-vbguest") then
     config.vbguest.auto_update = false
  end

  (1..$num_instances).each do |i|
    config.vm.define vm_name = "core-%02d" % i do |config|
    config.vm.hostname = vm_name

    if $enable_serial_logging
      logdir = File.join(File.dirname(__FILE__), "log")
      FileUtils.mkdir_p(logdir)

      serialFile = File.join(logdir, "%s-serial.txt" % vm_name)
      FileUtils.touch(serialFile)

      config.vm.provider :vmware_fusion do |v, override|
        v.vmx["serial0.present"] = "TRUE"
        v.vmx["serial0.fileType"] = "file"
        v.vmx["serial0.fileName"] = serialFile
        v.vmx["serial0.tryNoRxLoss"] = "FALSE"
      end

      config.vm.provider :virtualbox do |vb, override|
        vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
        vb.customize ["modifyvm", :id, "--uartmode1", serialFile]
      end
    end

    if $expose_docker_tcp
      config.vm.network "forwarded_port", guest: 2375, host: ($expose_docker_tcp + i - 1), auto_correct: true
    end

    config.vm.provider :vmware_fusion do |vb|
      vb.gui = $vb_gui
    end

    config.vm.provider :virtualbox do |vb|
      vb.gui = $vb_gui
      vb.memory = $vb_memory
      vb.cpus = $vb_cpus
    end

    ip = "33.33.33.#{i+100}"
    config.vm.network :private_network, ip: "#{ip}"
    config.vm.synced_folder ".", "/home/core/share", id: "core", :nfs => true, :mount_options => ['nolock,vers=3,udp']

    if File.exist?(CLOUD_CONFIG_PATH)
      config.vm.provision :file, :source => "#{CLOUD_CONFIG_PATH}", :destination => "/tmp/vagrantfile-user-data"
      config.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", :privileged => true
    end

   end
 end
end

用户-数据:

代码语言:javascript
复制
#cloud-config

coreos:
  etcd:
      # generate a new token for each unique cluster from https://discovery.etcd.io/new
      # WARNING: replace each time you 'vagrant destroy'
      discovery: https://discovery.etcd.io/2bef6823259cdef6751632f1f7052ff3
      addr: $public_ipv4:4001
      peer-addr: $public_ipv4:7001
  fleet:
      public-ip: $public_ipv4
  units:
    - name: etcd.service
      command: start
    - name: fleet.service
      command: start

config.rb

代码语言:javascript
复制
# Size of the CoreOS cluster created by Vagrant
$num_instances=3

# Official CoreOS channel from which updates should be downloaded
$update_channel='stable'
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-08-01 16:54:33

最后,我从下载了,并在后台运行了带有IP地址10.10.10.10etcd。然后,在CoreOS指令的启发下运行您自己的发现端点,我将用户数据中的发现地址设置为:

代码语言:javascript
复制
discovery: http://10.10.10.10:4001/v2/keys/2bef6823259cdef6751632f1f7052ff3

在此之后,我可以执行vagrant up,当我检查http://10.10.10.10:4001/v2/keys/2bef6823259cdef6751632f1f7052ff3时,所有CoreOS实例都已注册。

票数 3
EN

Stack Overflow用户

发布于 2014-07-29 17:36:30

我打开问题 for etcd是为了通过env支持代理,类似于CoreOS 发动机

为了在短期内解决这个问题,您可以通过cli标志或配置文件硬编码计算机的对等地址列表。--peers--peers-file可能是你最好的选择。

票数 0
EN

Stack Overflow用户

发布于 2015-03-22 04:19:11

我也有同样的问题。在我的例子中,它是由#cloud-config中一个陈旧的发现URL引起的。我通过从https://discovery.etcd.io/new获得一个新的发现url来修复它

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

https://stackoverflow.com/questions/25019355

复制
相关文章

相似问题

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