配置文件中的多服务定义不工作

时间:2017-08-10 20:03:09

标签: consul

我一直试图通过领事中的配置添加多项服务。

但Consul UI在启动代理本身时会抛出错误。

错误是: -

$consul.exe agent --dev
Starting Consul agent...
panic: runtime error: invalid memory address or nil pointer dereference
github.com/hashicorp/consul/agent.(*Agent).loadServices(0xc0421268c0, 
0xc04223aa80, 0xc042254a00, 0x0)
/gopath/src/github.com/hashicorp/consul/agent/agent.go:2097 
github.com/hashicorp/consul/agent.(*Agent).Start()
/gopath/src/github.com/hashicorp/consul/agent/agent.go:326 
github.com/hashicorp/consul/command.(*AgentCommand).run()
/gopath/src/github.com/hashicorp/consul/command/agent.go:704
github.com/hashicorp/consul/command.(*AgentCommand).Run()
/gopath/src/github.com/hashicorp/consul/command/agent.go:653

配置文件是: -

{
"Services": [{
    "id": "somename",
    "name": "nameofthissevice",
    "service": "myservice",
    "address": "127.0.0.1",
    "port": 62133,
    "enableTagOverride": false,
    "tags" : ["service1"]
},
{
    "id": "somename1",
    "name": "nameofthissevice",
    "service": "myservice2",
    "address": "127.0.0.1",
    "port": 64921,
    "enableTagOverride": false,
    "tags" : ["service2"]
}]

}

我正在使用Win 7平台。

任何人都可以在其中提出一些想法。

THX

1 个答案:

答案 0 :(得分:0)

配置文件未加载,因此问题不在文件中,为了加载配置文件,您应该添加另一个用于加载配置的标志,否则consul将以默认配置启动。

看起来像一个错误的二进制或不兼容的版本。

你的windows7是32位拱形还是64位? 你下载了哪个执行版的领事?

相关问题