2017-08-10 14 views
0

我一直试图通过consul中的配置添加多个服务。配置文件中的多个服务定义不能运行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

回答

0

配置文件没有加载,所以问题并不在该文件中,以加载您应该添加一个标志加载配置的配置文件,否则领事将使用默认配置启动。

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

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

相关问题