Consul cluster Mode problem

364 views
Skip to first unread message

Vikram Ranabhatt

unread,
May 8, 2016, 2:09:59 PM5/8/16
to Consul
I have two consul/vault server having ip 10.20.0.252 and 10.20.0.254.Each server is having Vault and Consul  installled.
I am trying to configure HA for vault.HA is failing as both the server is showing Active,instead of one active and other Stand by.
Consul Info command give num_peers = 0.Let me know what is going wrong here

Node1 
---------------------------------------
I joined  these two consul by 
consul join 10.20.0.254

root@06e9c498-fde9-4932-b329-b18e826ca027:/var/vcap/jobs/consul/consul# /var/vcap/packages/consul/bin/consul members
Node                         Address           Status  Type    Build  Protocol  DC
cf-vaultdemo-vault_consul-0  10.20.0.252:8301  alive   server  0.6.0  2         dc1
cf-vaultdemo-vault_consul-1  10.20.0.254:8301  alive   server  0.6.0  2         dc1

 root@06e9c498-fde9-4932-b329-b18e826ca027:/var/vcap/jobs/consul/consul# /var/vcap/packages/consul/bin/consul info
gives num_peers = 0
raft:
        applied_index = 17411
        commit_index = 17411
        fsm_pending = 0
        last_contact = never
        last_log_index = 17411
        last_log_term = 15
        last_snapshot_index = 16391
        last_snapshot_term = 15
        num_peers = 0
        state = Leader
        term = 15


{
  "data_dir": "/var/vcap/store/consul",
  "ui_dir": "/var/vcap/packages/consul-ui",
  "node_name": "cf-vaultdemo-vault_consul-0",
  "bind_addr": "0.0.0.0",
  "client_addr": "0.0.0.0",
  "advertise_addr": "10.20.0.252",
  "leave_on_terminate": false,
  "log_level": "INFO",
  "domain": "consul",
  "server": true,
  "rejoin_after_leave": true,
  "ports": {
    "dns": 53
  },
  "disable_update_check": true,
  "recursor": "10.20.0.40",
  "start_join": [

  ],
  "retry_join": [

  ],
  "bootstrap_expect": 2
}

David Adams

unread,
May 8, 2016, 2:41:48 PM5/8/16
to consu...@googlegroups.com
You need to have an odd number of Consul servers in your cluster. If you want HA, you will need to add a third Consul server and change bootstrap_expect to 3. The members have to vote on who the leader is and so with two there will never be a winner.

--
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/27804ac6-4013-4426-bffb-ba74a0deb25d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

V Kumar

unread,
May 9, 2016, 6:04:43 AM5/9/16
to Consul
Hi
Still num_peers = 0 
Now I am getting error

   2016/05/09 09:56:50 [ERR] consul: 'cf-vaultdemo-vault_consul-0' and 'cf-vaultdemo-vault_consul-1' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:56:50 [ERR] consul: 'cf-vaultdemo-vault_consul-2' and 'cf-vaultdemo-vault_consul-1' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:57:50 [ERR] consul: 'cf-vaultdemo-vault_consul-0' and 'cf-vaultdemo-vault_consul-1' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:57:50 [ERR] consul: 'cf-vaultdemo-vault_consul-2' and 'cf-vaultdemo-vault_consul-1' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:58:50 [ERR] consul: 'cf-vaultdemo-vault_consul-2' and 'cf-vaultdemo-vault_consul-1' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:58:50 [ERR] consul: 'cf-vaultdemo-vault_consul-0' and 'cf-vaultdemo-vault_consul-1' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:59:53 [ERR] consul: 'cf-vaultdemo-vault_consul-0' and 'cf-vaultdemo-vault_consul-1' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:59:53 [ERR] consul: 'cf-vaultdemo-vault_consul-2' and 'cf-vaultdemo-vault_consul-1' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.


mode, not adding Raft peer.
    2016/05/09 09:57:55 [ERR] consul: 'cf-vaultdemo-vault_consul-0' and 'cf-vaultdemo-vault_consul-2' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:58:55 [ERR] consul: 'cf-vaultdemo-vault_consul-1' and 'cf-vaultdemo-vault_consul-2' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:58:55 [ERR] consul: 'cf-vaultdemo-vault_consul-0' and 'cf-vaultdemo-vault_consul-2' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:59:55 [ERR] consul: 'cf-vaultdemo-vault_consul-1' and 'cf-vaultdemo-vault_consul-2' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 09:59:55 [ERR] consul: 'cf-vaultdemo-vault_consul-0' and 'cf-vaultdemo-vault_consul-2' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 10:00:55 [ERR] consul: 'cf-vaultdemo-vault_consul-1' and 'cf-vaultdemo-vault_consul-0' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.
    2016/05/09 10:00:55 [ERR] consul: 'cf-vaultdemo-vault_consul-0' and 'cf-vaultdemo-vault_consul-2' are both in bootstrap mode. Only one node should be in bootstrap mode, not adding Raft peer.

Node 1:
{
  "data_dir": "/var/vcap/store/consul",
  "ui_dir": "/var/vcap/packages/consul-ui",
  "node_name": "cf-vaultdemo-vault_consul-0",
  "bind_addr": "0.0.0.0",
  "client_addr": "0.0.0.0",
  "advertise_addr": "10.20.0.252",
  "leave_on_terminate": false,
  "log_level": "INFO",
  "domain": "consul",
  "server": true,
  "rejoin_after_leave": true,
  "ports": {
    "dns": 53
  },
  "disable_update_check": true,
  "recursor": "10.20.0.40",
  "start_join": [

  ],
  "retry_join": [

  ],
  "bootstrap_expect": 3
}


Node 2
{
  "data_dir": "/var/vcap/store/consul",
  "ui_dir": "/var/vcap/packages/consul-ui",
  "node_name": "cf-vaultdemo-vault_consul-1",
  "bind_addr": "0.0.0.0",
  "client_addr": "0.0.0.0",
  "advertise_addr": "10.20.0.254",
  "leave_on_terminate": false,
  "log_level": "INFO",
  "domain": "consul",
  "server": true,
  "rejoin_after_leave": true,
  "ports": {
    "dns": 53
  },
  "disable_update_check": true,
  "recursor": "10.20.0.40",
  "start_join": [

  ],
  "retry_join": [

  ],
  "bootstrap_expect": 3
}

Node 3

{
  "data_dir": "/var/vcap/store/consul",
  "ui_dir": "/var/vcap/packages/consul-ui",
  "node_name": "cf-vaultdemo-vault_consul-2",
  "bind_addr": "0.0.0.0",
  "client_addr": "0.0.0.0",
  "advertise_addr": "10.20.0.32",
  "leave_on_terminate": false,
  "log_level": "INFO",
  "domain": "consul",
  "server": true,
  "rejoin_after_leave": true,
  "ports": {
    "dns": 53
  },
  "disable_update_check": true,
  "recursor": "10.20.0.40",
  "start_join": [

  ],
  "retry_join": [

  ],
  "bootstrap_expect": 3
Reply all
Reply to author
Forward
0 new messages