wefe 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. node1 10.0.0.50
  2. node2 10.0.0.51
  3. node3 10.0.0.52
  4. #[Member]
  5. ETCD_NAME="node1"
  6. ETCD_DATA_DIR="/var/lib/etcd"
  7. ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
  8. ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
  9. ETCD_HEARTBEAT_INTERVAL="1000"
  10. ETCD_ELECTION_TIMEOUT="5000"
  11. #[Clustering]
  12. ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.50:2380"
  13. ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.50:2379"
  14. ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380"
  15. ETCD_INITIAL_CLUSTER_TOKEN="frogofrock"
  16. ETCD_INITIAL_CLUSTER_STATE="new"
  17. напиши таску, которая заменит в файле /etc/default/etcd строку содержащую ETCD_INITIAL_CLUSTER= на ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380"
  18. и строку содержащую ETCD_INITIAL_CLUSTER_STATE= на ETCD_INITIAL_CLUSTER_STATE="new"
  19. systemctl start etcd.service; systemctl enable etcd.service
  20. etcdctl cluster-health
  21. etcdctl member list
  22. etcdctl member add node2 --peer-urls=http://10.0.0.51:2380
  23. #[Member]
  24. ETCD_NAME="node2"
  25. ETCD_DATA_DIR="/var/lib/etcd"
  26. ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
  27. ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
  28. ETCD_HEARTBEAT_INTERVAL="1000"
  29. ETCD_ELECTION_TIMEOUT="5000"
  30. #[Clustering]
  31. ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.51:2380"
  32. ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.51:2379"
  33. ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380,node2=http://10.0.0.51:2380"
  34. ETCD_INITIAL_CLUSTER_TOKEN="frogofrock"
  35. ETCD_INITIAL_CLUSTER_STATE="existing"
  36. #[Member]
  37. ETCD_NAME="node3"
  38. ETCD_DATA_DIR="/var/lib/etcd/"
  39. ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
  40. ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
  41. ETCD_HEARTBEAT_INTERVAL="1000"
  42. ETCD_ELECTION_TIMEOUT="5000"
  43. #[Clustering]
  44. ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.52:2380"
  45. ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.52:2379"
  46. ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380,node2=http://10.0.0.51:2380,node3=http://10.0.0.52:2380"
  47. ETCD_INITIAL_CLUSTER_TOKEN="frogofrock"
  48. ETCD_INITIAL_CLUSTER_STATE="existing"
  49. Пытаюсь настроить кластер etcd, после добавления второй ноды на лидере отказывается запускаться вторая нода. Конфигурация:
  50. #[Member]
  51. ETCD_NAME="node1"
  52. ETCD_DATA_DIR="/var/lib/etcd"
  53. ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
  54. ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
  55. ETCD_HEARTBEAT_INTERVAL="1000"
  56. ETCD_ELECTION_TIMEOUT="5000"
  57. #[Clustering]
  58. ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.50:2380"
  59. ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.50:2379"
  60. ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380"
  61. ETCD_INITIAL_CLUSTER_TOKEN="tst"
  62. ETCD_INITIAL_CLUSTER_STATE="new"
  63. #[Member]
  64. ETCD_NAME="node2"
  65. ETCD_DATA_DIR="/var/lib/etcd/"
  66. ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
  67. ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
  68. ETCD_HEARTBEAT_INTERVAL="1000"
  69. ETCD_ELECTION_TIMEOUT="5000"
  70. #[Clustering]
  71. ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.51:2380"
  72. ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.51:2379"
  73. ETCD_INITIAL_CLUSTER="node1=http://10.0.0.50:2380,node2=http://10.0.0.51:2380"
  74. ETCD_INITIAL_CLUSTER_TOKEN="tst"
  75. ETCD_INITIAL_CLUSTER_STATE="existing"
  76. etcdctl -w table endpoint --cluster status