Consul Bootstrap: Need help to understand the log data

661 views
Skip to first unread message

Hemant Gupta

unread,
Jan 12, 2016, 11:04:18 PM1/12/16
to Consul

New logs are appearing at the bottom(see red portion) when I bootstrap consul cluster for the first time.
Please help me understand why I am getting the logs at the bottom(see red portion) and how can i get rid of them.

I want server001 to be elected as leader and don't want it to loose the leadership

==> Log data will now stream in as it occurs:

    2016/01/12 19:35:33 [INFO] serf: EventMemberJoin: server001 10.xxx.xx.x1
    2016/01/12 19:35:33 [INFO] serf: EventMemberJoin: server001.data_consul 10.xxx.xx.x1
    2016/01/12 19:35:33 [INFO] raft: Node at 10.xxx.xx.x1:8300 [Follower] entering Follower state
    2016/01/12 19:35:33 [INFO] consul: adding LAN server server001 (Addr: 10.xxx.xx.x1:8300) (DC: data_consul)
    2016/01/12 19:35:33 [INFO] consul: adding WAN server server001.data_consul (Addr: 10.xxx.xx.x1:8300) (DC: data_consul)
    2016/01/12 19:35:33 [ERR] agent: failed to sync remote state: No cluster leader
    2016/01/12 19:35:35 [WARN] raft: Heartbeat timeout reached, starting election
    2016/01/12 19:35:35 [INFO] raft: Node at 10.xxx.xx.x1:8300 [Candidate] entering Candidate state
    2016/01/12 19:35:35 [INFO] raft: Election won. Tally: 1
    2016/01/12 19:35:35 [INFO] raft: Node at 10.xxx.xx.x1:8300 [Leader] entering Leader state
    2016/01/12 19:35:35 [INFO] consul: cluster leadership acquired
    2016/01/12 19:35:35 [INFO] consul: New leader elected: server001
    2016/01/12 19:35:35 [INFO] raft: Disabling EnableSingleNode (bootstrap)
    2016/01/12 19:35:35 [INFO] consul: member 'server001' joined, marking health alive
    2016/01/12 19:35:36 [INFO] agent: Synced service 'consul'
    2016/01/12 19:35:39 [WARN] raft: Failed to get previous log: 12 log not found (last: 4)
    2016/01/12 19:35:39 [INFO] raft: Node at 10.xxx.xx.x1:8300 [Follower] entering Follower state
    2016/01/12 19:35:39 [INFO] consul: cluster leadership lost
    2016/01/12 19:35:41 [WARN] raft: EnableSingleNode disabled, and no known peers. Aborting election.
    2016/01/12 19:35:50 [WARN] raft: Previous log term mis-match: ours: 1 remote: 230
    2016/01/12 19:35:50 [ERR] agent: coordinate update error: No cluster leader
    2016/01/12 19:36:00 [WARN] raft: Previous log term mis-match: ours: 1 remote: 230
    2016/01/12 19:36:10 [WARN] raft: Previous log term mis-match: ours: 1 remote: 230
    2016/01/12 19:36:19 [ERR] agent: coordinate update error: No cluster leader
    2016/01/12 19:36:20 [WARN] raft: Previous log term mis-match: ours: 1 remote: 230
    2016/01/12 19:36:21 [INFO] serf: EventMemberJoin: server002 10.xxx.xx.x2
    2016/01/12 19:36:21 [INFO] serf: EventMemberJoin: server003 10.xxx.xx.x3
    2016/01/12 19:36:21 [INFO] consul: adding LAN server server002(Addr: 10.xxx.xx.x2:8300) (DC: data_consul)
    2016/01/12 19:36:21 [INFO] consul: adding LAN server server003 (Addr: 10.xxx.xx.x3:8300) (DC: data_consul)
    2016/01/12 19:36:21 [INFO] consul: New leader elected: server003
    2016/01/12 19:36:21 [INFO] consul: New leader elected: server003
    2016/01/12 19:36:21 [INFO] consul: New leader elected: server003
    2016/01/12 19:36:21 [INFO] consul: New leader elected: server003
    2016/01/12 19:36:21 [INFO] consul: New leader elected: server003
    2016/01/12 19:36:21 [INFO] consul: New leader elected: server003
    2016/01/12 19:36:21 [INFO] consul: New leader elected: server003
    2016/01/12 19:36:21 [INFO] consul: New leader elected: server003
    2016/01/12 19:36:31 [WARN] raft: Clearing log suffix from 1 to 4

My config.json looks as below:

{
  "server": true,
  "datacenter": "data_consul",
  "data_dir": "/var/consul",
  "log_level": "INFO",
  "enable_syslog": true,
  "ports": {
    "dns": 8600,
    "http": 8500,
    "https": 8700,
    "rpc": 8400,
    "serf_lan": 8301,
    "serf_wan": 8302,
    "server": 8300
  },
  "bootstrap": true,
  "client_addr": "0.0.0.0"
}

James Phillips

unread,
Jan 13, 2016, 5:37:29 PM1/13/16
to consu...@googlegroups.com
Hi Hemant,

In general it's dangerous to bootstrap a multi-server cluster with "bootstrap" set to true. You'd have to carefully sequence the startup of the servers to get this to work properly. The safest way to start a multi-server cluster is to configure them all the same with https://www.consul.io/docs/agent/options.html#_bootstrap_expect set to the same value.

-- James

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/6c22e125-a854-412e-a3b0-cd320a1ef54a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages