This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

consul: need 3 nodes for bootstrap, needs 2 nodes for running

+10 -9
+10 -9
2configs/consul.nix
··· 12 12 # interface.bind = "retiolum"; 13 13 extraConfig = { 14 14 bind_addr = config.krebs.build.host.nets.retiolum.ip4.addr; 15 - bootstrap_expect = 1; 15 + bootstrap_expect = 3; 16 16 server = true; 17 17 # retry_join = config.services.consul.extraConfig.start_join; 18 18 retry_join = lib.mapAttrsToList (_n: h: lib.head h.nets.retiolum.aliases) ( ··· 29 29 cleanup_dead_servers = true; 30 30 # How long a server must be stable before promoting 31 31 server_stabilization_time = "10s"; 32 - # Only requires 3 servers minimum instead of all configured servers 33 - min_quorum = 3; 32 + # Allow cluster to operate with 2 of 3 nodes (majority quorum) 33 + min_quorum = 2; 34 34 }; 35 35 36 - # Performance tuning for faster leader elections 36 + # Performance tuning - slightly relaxed for network tolerance 37 37 performance = { 38 - # Reduce raft timing for faster recovery 39 - raft_multiplier = 1; 38 + # 2 = default, gives more time for slow/unstable networks 39 + # 1 was too aggressive and caused leader flapping 40 + raft_multiplier = 2; 40 41 }; 42 + 43 + # Reconnect timeout for failed nodes (default 72h, reduce for faster cleanup) 44 + reconnect_timeout = "24h"; 41 45 42 46 # Leave on terminate for cleaner shutdowns 43 47 leave_on_terminate = true; ··· 48 52 systemd.services.consul = { 49 53 # Add pre-start script to clean up potential issues 50 54 preStart = '' 51 - # Remove any stale peers.json from failed recovery attempts 52 - rm -f /var/lib/consul/raft/peers.json 53 - 54 55 # Ensure proper permissions 55 56 chown -R consul:consul /var/lib/consul 56 57 '';