Оновлення etcd з 3.5 до 3.6

Процеси, контрольні списки та примітки щодо оновлення etcd з 3.5 до 3.6

У загальному випадку, оновлення з etcd v3.5 до v3.6 може бути безперервним, поступовим оновленням без простою:

  • по черзі зупиняйте процеси etcd v3.5 і замінюйте їх процесами etcd v3.6
  • після запуску всіх процесів v3.6 нові функції у v3.6 стають доступними для кластера

Перед тим як почати оновлення, прочитайте решту цього посібника, щоб підготуватися.

Контрольні списки оновлення

Оновлення 3.5

Сховище V2

Якщо --enable-v2 або змінна середовища ETCD_ENABLE_V2="true" була (або коли-небудь була) налаштована на будь-якому учаснику, сховище v2store повинно бути очищене перед тим, як кластер можна буде безпечно оновити до v3.6. Загальний робочий процес:

  1. Виконайте команду etcdutl check v2store на кожному учаснику, щоб перевірити, чи містить v2store якісь дані, що не стосуються членства (дані користувача). Переконайтеся, що ви використовуєте etcdutl версії 3.5.32 або пізнішої, яка розширює перевірку, додаючи до знімка v2 також перевірку записів WAL.

  2. Перевірка повідомляє один із наступних результатів. Усуньте будь-які проблеми, виявлені перевіркою, як описано у відповідних розділах.

    • No custom content found in both v2store and WAL records — сховище v2store чисте. Перейдіть до кроку 4.
    • detected custom content in v2store — кастомні дані v2 існують лише у знімку v2. Дотримуйтесь інструкцій у розділі v2store містить кастомні дані.
    • detected custom v2 content in WAL records — кастомні дані v2 існують лише в записах WAL. Дотримуйтесь інструкцій у розділі WAL містить кастомні дані v2.
    • detected custom v2 content in both v2store and WAL records — кастомні дані v2 існують в обох місцях. Дотримуйтесь інструкцій у розділах v2store містить кастомні дані та WAL містить кастомні дані v2.
    • Щось інше — цей результат зазвичай не повинен відбуватися; якщо відбувається, перевірка могла видати неочікуваний вивід, тому зупиніться та розслідуйте вручну.
  3. Повторіть крок 1, щоб перевірити, що v2store чисте. Якщо перевірка все ще повідомляє про кастомні дані, поверніться до кроку 2 та усуньте решту проблем.

  4. Щойно etcdutl check v2store повідомить “No custom content found in both v2store and WAL records” на кожному учаснику, видаліть прапорець --enable-v2 та змінну середовища ETCD_ENABLE_V2 з усіх учасників etcd.

    Готово! Тепер ви можете безпечно оновити etcd до v3.6!

v2store містить кастомні дані

Якщо вам потрібні кастомні дані v2 або вам потрібно мігрувати їх до v3store, дотримуйтесь посібника з міграції v2 для міграції даних.

Якщо вам не потрібні кастомні дані v2, ви можете:

  • Видалити кастомні дані v2 вручну з теки даних, або
  • Запустити etcd з прапорцем --v2-deprecation=write-only-skip-check, щоб перевірка v2store була пропущена під час запуску. Зверніть увагу, що це потребує etcd версії v3.5.32 або пізнішої, і ви використовуєте цей параметр на власний ризик.

Після усунення проблеми повторно виконайте etcdutl check v2store, щоб підтвердити, що v2store чисте.

WAL містить кастомні дані v2

Кастомні дані v2 у записах WAL автоматично видаляються при створенні наступного знімка v2. За стандартної конфігурації знімків новий знімок v2 створюється після великої кількості зафіксованих транзакцій. Точний час очікування залежить від частоти записів вашого кластера; у завантажених кластерах наступний знімок може бути створений протягом кількох годин, тоді як у менш активних кластерах це може зайняти більше часу.

  • Зачекайте на наступний знімок v2. Якщо ви можете дочекатися, тримайте кластер запущеним; новий знімок v2 зрештою буде створено, і WAL буде очищено автоматично.

  • Примусово створіть знімок негайно. Якщо ви не хочете чекати, застосуйте обхідний шлях --snapshot-count=1 на кожному ураженому учаснику:

    1. Додайте прапорець --snapshot-count=1 до кожного учасника etcd, який повідомляє про кастомні дані WAL.
    2. Перезапустіть учасників etcd.
    3. Щойно наступний знімок буде створено, видаліть прапорець --snapshot-count=1 (або відновіть його початкове значення, якщо застосовно).
    4. Перезапустіть учасників etcd ще раз.

Після створення нового знімка v2 повторно виконайте etcdutl check v2store, щоб підтвердити, що WAL чистий.

Додані прапорці

+etcd --discovery-token ''
+etcd --discovery-endpoints ''
+etcd --discovery-dial-timeout '2s'
+etcd --discovery-request-timeout '5s'
+etcd --discovery-keepalive-time '2s'
+etcd --discovery-keepalive-timeout '6s'
+etcd --discovery-insecure-transport 'true'
+etcd --discovery-insecure-skip-tls-verify 'false'
+etcd --discovery-cert ''
+etcd --discovery-key ''
+etcd --discovery-cacert ''
+etcd --discovery-user ''
+etcd --discovery-password ''
+etcd --feature-gates
+etcd --log-format

Видалені прапорці

-etcd --enable-v2
-etcd --experimental-enable-v2v3
-etcd --proxy
-etcd --proxy-failure-wait
-etcd --proxy-refresh-interval
-etcd --proxy-dial-timeout
-etcd --proxy-write-timeout
-etcd --proxy-read-timeout

Застарілі прапорці

Прапорець etcd --experimental-bootstrap-defrag-threshold-megabytes застарів.


-etcd --experimental-bootstrap-defrag-threshold-megabytes

+etcd --bootstrap-defrag-threshold-megabytes

Прапорець etcd --experimental-compaction-batch-limit застарів.


-etcd --experimental-compaction-batch-limit

+etcd --compaction-batch-limit

Прапорець etcd --experimental-compact-hash-check-time застарів.


-etcd --experimental-compact-hash-check-time

+etcd --compact-hash-check-time

Прапорець etcd --experimental-compaction-sleep-interval застарів.


-etcd --experimental-compaction-sleep-interval

+etcd --compaction-sleep-interval

Прапорець etcd --experimental-corrupt-check-time застарів.


-etcd --experimental-corrupt-check-time

+etcd --corrupt-check-time

Прапорець etcd --experimental-enable-distributed-tracing застарів.


-etcd --experimental-enable-distributed-tracing

+etcd --enable-distributed-tracing

Прапорець etcd --experimental-distributed-tracing-address застарів.


-etcd --experimental-distributed-tracing-address

+etcd --distributed-tracing-address

Прапорець etcd --experimental-distributed-tracing-instance-id застарів.


-etcd --experimental-distributed-tracing-instance-id

+etcd --distributed-tracing-instance-id

Прапорець etcd --experimental-distributed-tracing-sampling-rate застарів.


-etcd --experimental-distributed-tracing-sampling-rate

+etcd --distributed-tracing-sampling-rate

Прапорець etcd --experimental-distributed-tracing-service-name застарів.


-etcd --experimental-distributed-tracing-service-name

+etcd --distributed-tracing-service-name

Прапорець etcd --experimental-downgrade-check-time застарів.


-etcd --experimental-downgrade-check-time

+etcd --downgrade-check-time

Прапорець etcd --experimental-max-learners застарів.


-etcd --experimental-max-learners

+etcd --max-learners

Прапорець etcd --experimental-memory-mlock застарів.


-etcd --experimental-memory-mlock

+etcd --memory-mlock

Прапорець etcd --experimental-peer-skip-client-san-verification застарів.


-etcd --experimental-peer-skip-client-san-verification

+etcd --peer-skip-client-san-verification

Прапорець etcd --experimental-snapshot-catchup-entries застарів.


-etcd --experimental-snapshot-catchup-entries

+etcd --snapshot-catchup-entries

Прапорець etcd --experimental-warning-apply-duration застарів.


-etcd --experimental-warning-apply-duration

+etcd --warning-apply-duration

Прапорець etcd --experimental-warning-unary-request-duration застарів.


-etcd --experimental-warning-unary-request-duration

+etcd --warning-unary-request-duration

Прапорець etcd --experimental-watch-progress-notify-interval застарів.


-etcd --experimental-watch-progress-notify-interval

+etcd --watch-progress-notify-interval

Еквівалентні прапорці функціональних можливостей v3.5

еквівалентний прапорець для функціональної можливості etcd --experimental-compact-hash-check-enabled=true


-etcd --experimental-compact-hash-check-enabled=true

+etcd --feature-gates=CompactHashCheck=true

еквівалентний прапорець для функціональної можливості etcd --experimental-initial-corrupt-check=true


-etcd --experimental-initial-corrupt-check=true

+etcd --feature-gates=InitialCorruptCheck=true

еквівалентний прапорець для функціональної можливості etcd --experimental-enable-lease-checkpoint=true


-etcd --experimental-enable-lease-checkpoint=true

+etcd --feature-gates=LeaseCheckpoint=true

еквівалентний прапорець для функціональної можливості etcd --experimental-enable-lease-checkpoint-persist=true


-etcd --experimental-enable-lease-checkpoint-persist=true

+etcd --feature-gates=LeaseCheckpointPersist=true

еквівалентний прапорець для функціональної можливості etcd --experimental-stop-grpc-service-on-defrag=true


-etcd --experimental-stop-grpc-service-on-defrag=true

+etcd --feature-gates=StopGRPCServiceOnDefrag=true

еквівалентний прапорець для функціональної можливості etcd --experimental-txn-mode-write-with-shared-buffer=false


-etcd --experimental-txn-mode-write-with-shared-buffer=false

+etcd --feature-gates=TxnModeWriteWithSharedBuffer=false

Прапорці з новими стандартними значеннями

Початкове стандартне значення прапорця etcd --snapshot-count=100000


-etcd --snapshot-count=100000

+etcd --snapshot-count=10000

Початкове стандартне значення прапорця etcd --v2-deprecation='not-yet'


-etcd --v2-deprecation='not-yet'

+etcd --v2-deprecation='write-only'

Початкове стандартне значення прапорця etcd --discovery-fallback='proxy'


-etcd --discovery-fallback='proxy'

+etcd --discovery-fallback='exit'

Відмінності у метриках Prometheus

# метрики, додані у v3.6
+etcd_network_known_peers
+etcd_server_feature_enabled

Контрольні списки оновлення сервера

Вимоги до оновлення

Щоб оновити наявне розгортання etcd до v3.6, кластер, що працює, повинен бути версії v3.5 або вище. Якщо це версія до v3.5, спочатку оновіть до v3.5 перед оновленням до v3.6.

Крім того, щоб забезпечити плавне поступове оновлення, кластер, що працює, повинен бути справним. Перевірте стан кластера за допомогою команди etcdctl endpoint health перед продовженням.

Підготовка

Перед оновленням etcd завжди тестуйте сервіси, що залежать від etcd, у тестовому середовищі перед розгортанням оновлення у виробничому середовищі.

Перед початком завантажте резервну копію знімка. Якщо щось піде не так під час оновлення, можна використовувати цю резервну копію для пониження версії до поточної версії etcd. Зверніть увагу, що команда snapshot створює резервну копію лише даних v3.

Змішані версії

Під час оновлення кластер etcd підтримує змішані версії учасників etcd і працює з протоколом найнижчої загальної версії. Кластер вважається оновленим лише після того, як усі його учасники будуть оновлені до версії v3.6. Внутрішньо учасники etcd ведуть переговори один з одним, щоб визначити загальну версію кластера, яка контролює звітну версію та підтримувані функції.

Пониження версії

Перед оновленням вашого кластера etcd створіть та завантажте резервну копію знімка вашого кластера etcd. Цей знімок можна використовувати для відновлення кластера до стану до оновлення за потреби. Якщо під час оновлення виникають проблеми, спочатку визначте та усуньте їхню першопричину. Якщо кластер все ще перебуває у стані змішаних версій, де хоча б один учасник залишається на v3.5, можна або замінити двійковий файл або образ на попередню версію v3.5, або безпосередньо відновити кластер за допомогою знімка. У цьому змішаному стані кластер продовжує працювати як кластер v3.5, дозволяючи пониження версії без дотримання формальної процедури зниження версії.

Однак, щойно всі учасники будуть оновлені до v3.6, кластер вважається повністю оновленим, і пониження версії за допомогою двійкових файлів більше неможливе. У цьому випадку єдиним варіантом відновлення є відновлення зі знімка, створеного до оновлення. Якщо користувачі бажають повернутися до початкової версії після завершення повного оновлення, їм слід дотримуватися офіційного посібника зі зниження версії, щоб забезпечити цілісність та уникнути пошкодження даних.

Процедура оновлення

Цей приклад показує, як оновити кластер etcd v3.5 з 3 учасниками, що працює на локальній машині.

Крок 1: перевірте вимоги до оновлення

Чи кластер справний і працює на v3.5.x?

etcdctl --endpoints=localhost:2379,localhost:22379,localhost:32379 endpoint health
<<COMMENT
localhost:2379 is healthy: successfully committed proposal: took = 2.555774ms
localhost:32379 is healthy: successfully committed proposal: took = 2.631133ms
localhost:22379 is healthy: successfully committed proposal: took = 3.020958ms
COMMENT

curl http://localhost:2379/version
<<COMMENT
{"etcdserver":"3.5.18","etcdcluster":"3.5.0"}
COMMENT

curl http://localhost:22379/version
<<COMMENT
{"etcdserver":"3.5.18","etcdcluster":"3.5.0"}
COMMENT

curl http://localhost:32379/version
<<COMMENT
{"etcdserver":"3.5.18","etcdcluster":"3.5.0"}
COMMENT

Крок 2: завантажте резервну копію знімка з лідера

Завантажте резервну копію знімка, щоб забезпечити шлях для пониження версії у разі виникнення проблем.

Лідер etcd гарантовано має останні дані застосунків, тому отримайте знімок з лідера:

curl -sL http://localhost:2379/metrics | grep etcd_server_is_leader
<<COMMENT
# HELP etcd_server_is_leader Whether or not this member is a leader. 1 if is, 0 otherwise.
# TYPE etcd_server_is_leader gauge
etcd_server_is_leader 1
COMMENT

curl -sL http://localhost:22379/metrics | grep etcd_server_is_leader
<<COMMENT
etcd_server_is_leader 0
COMMENT

curl -sL http://localhost:32379/metrics | grep etcd_server_is_leader
<<COMMENT
etcd_server_is_leader 0
COMMENT

etcdctl --endpoints=localhost:2379 snapshot save backup.db
<<COMMENT
{"level":"info","ts":"2025-03-01T04:34:10.336768+0530","caller":"snapshot/v3_snapshot.go:65","msg":"created temporary db file","path":"backup.db.part"}
{"level":"info","ts":"2025-03-01T04:34:10.342373+0530","logger":"client","caller":"v3@v3.5.18/maintenance.go:212","msg":"opened snapshot stream; downloading"}
{"level":"info","ts":"2025-03-01T04:34:10.342433+0530","caller":"snapshot/v3_snapshot.go:73","msg":"fetching snapshot","endpoint":"localhost:2379"}
{"level":"info","ts":"2025-03-01T04:34:10.346482+0530","logger":"client","caller":"v3@v3.5.18/maintenance.go:220","msg":"completed snapshot read; closing"}
{"level":"info","ts":"2025-03-01T04:34:10.348801+0530","caller":"snapshot/v3_snapshot.go:88","msg":"fetched snapshot","endpoint":"localhost:2379","size":"20 kB","took":"now"}
{"level":"info","ts":"2025-03-01T04:34:10.348933+0530","caller":"snapshot/v3_snapshot.go:97","msg":"saved","path":"backup.db"}
Snapshot saved at backup.db
COMMENT

Крок 3: зупиніть один наявний сервер etcd

Коли кожен процес etcd зупиняється, очікувані помилки будуть записані іншими учасниками кластера. Це нормально, оскільки зʼєднання учасника кластера було (тимчасово) розірвано:

{"level":"info","ts":"2025-03-01T04:31:50.654520+0530","caller":"etcdserver/server.go:2676","msg":"cluster version is updated","cluster-version":"3.5"}
{"level":"info","ts":"2025-03-01T04:34:10.345927+0530","caller":"v3rpc/maintenance.go:130","msg":"sending database snapshot to client","total-bytes":20480,"size":"20 kB"}
{"level":"info","ts":"2025-03-01T04:34:10.346094+0530","caller":"v3rpc/maintenance.go:170","msg":"sending database sha256 checksum to client","total-bytes":20480,"checksum-size":32}
{"level":"info","ts":"2025-03-01T04:34:10.346108+0530","caller":"v3rpc/maintenance.go:179","msg":"successfully sent database snapshot to client","total-bytes":20480,"size":"20 kB","took":"now"}
^C
{"level":"info","ts":"2025-03-01T04:35:01.443045+0530","caller":"osutil/interrupt_unix.go:64","msg":"received signal; shutting down","signal":"interrupt"}
{"level":"info","ts":"2025-03-01T04:35:01.443088+0530","caller":"embed/etcd.go:408","msg":"closing etcd server","name":"node1","data-dir":"/tmp/etcd-node1","advertise-peer-urls":["http://127.0.0.1:2380"],"advertise-client-urls":["http://127.0.0.1:2379"]}
{"level":"info","ts":"2025-03-01T04:35:01.443417+0530","caller":"etcdserver/server.go:1503","msg":"leadership transfer starting","local-member-id":"bf9071f4639c75cc","current-leader-member-id":"bf9071f4639c75cc","transferee-member-id":"91bc3c398fb3c146"}
{"level":"info","ts":"2025-03-01T04:35:01.443441+0530","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"bf9071f4639c75cc [term 2] starts to transfer leadership to 91bc3c398fb3c146"}
{"level":"info","ts":"2025-03-01T04:35:01.443455+0530","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"bf9071f4639c75cc sends MsgTimeoutNow to 91bc3c398fb3c146 immediately as 91bc3c398fb3c146 already has up-to-date log"}
{"level":"warn","ts":"2025-03-01T04:35:01.443517+0530","caller":"embed/serve.go:179","msg":"stopping insecure grpc server due to error","error":"accept tcp 127.0.0.1:2379: use of closed network connection"}
{"level":"warn","ts":"2025-03-01T04:35:01.443548+0530","caller":"embed/serve.go:181","msg":"stopped insecure grpc server due to error","error":"accept tcp 127.0.0.1:2379: use of closed network connection"}
{"level":"info","ts":"2025-03-01T04:35:01.445536+0530","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"bf9071f4639c75cc [term: 2] received a MsgVote message with higher term from 91bc3c398fb3c146 [term: 3]"}
{"level":"info","ts":"2025-03-01T04:35:01.445556+0530","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"bf9071f4639c75cc became follower at term 3"}
{"level":"info","ts":"2025-03-01T04:35:01.445565+0530","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"bf9071f4639c75cc [logterm: 2, index: 12, vote: 0] cast MsgVote for 91bc3c398fb3c146 [logterm: 2, index: 12] at term 3"}
{"level":"info","ts":"2025-03-01T04:35:01.445572+0530","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"raft.node: bf9071f4639c75cc lost leader bf9071f4639c75cc at term 3"}
{"level":"info","ts":"2025-03-01T04:35:01.446773+0530","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"raft.node: bf9071f4639c75cc elected leader 91bc3c398fb3c146 at term 3"}
{"level":"info","ts":"2025-03-01T04:35:01.544062+0530","caller":"etcdserver/server.go:1520","msg":"leadership transfer finished","local-member-id":"bf9071f4639c75cc","old-leader-member-id":"bf9071f4639c75cc","new-leader-member-id":"91bc3c398fb3c146","took":"100.640374ms"}
{"level":"info","ts":"2025-03-01T04:35:01.544160+0530","caller":"rafthttp/peer.go:330","msg":"stopping remote peer","remote-peer-id":"91bc3c398fb3c146"}
{"level":"warn","ts":"2025-03-01T04:35:01.544956+0530","caller":"rafthttp/stream.go:286","msg":"closed TCP streaming connection with remote peer","stream-writer-type":"stream MsgApp v2","remote-peer-id":"91bc3c398fb3c146"}
{"level":"info","ts":"2025-03-01T04:35:01.544984+0530","caller":"rafthttp/stream.go:294","msg":"stopped TCP streaming connection with remote peer","stream-writer-type":"stream MsgApp v2","remote-peer-id":"91bc3c398fb3c146"}
{"level":"warn","ts":"2025-03-01T04:35:01.545050+0530","caller":"rafthttp/stream.go:286","msg":"closed TCP streaming connection with remote peer","stream-writer-type":"stream Message","remote-peer-id":"91bc3c398fb3c146"}
{"level":"info","ts":"2025-03-01T04:35:01.545065+0530","caller":"rafthttp/stream.go:294","msg":"stopped TCP streaming connection with remote peer","stream-writer-type":"stream Message","remote-peer-id":"91bc3c398fb3c146"}
{"level":"info","ts":"2025-03-01T04:35:01.545099+0530","caller":"rafthttp/pipeline.go:85","msg":"stopped HTTP pipelining with remote peer","local-member-id":"bf9071f4639c75cc","remote-peer-id":"91bc3c398fb3c146"}
{"level":"warn","ts":"2025-03-01T04:35:01.545156+0530","caller":"rafthttp/stream.go:421","msg":"lost TCP streaming connection with remote peer","stream-reader-type":"stream MsgApp v2","local-member-id":"bf9071f4639c75cc","remote-peer-id":"91bc3c398fb3c146","error":"context canceled"}
{"level":"warn","ts":"2025-03-01T04:35:01.545178+0530","caller":"rafthttp/peer_status.go:66","msg":"peer became inactive (message send to peer failed)","peer-id":"91bc3c398fb3c146","error":"failed to read 91bc3c398fb3c146 on stream MsgApp v2 (context canceled)"}
{"level":"info","ts":"2025-03-01T04:35:01.545199+0530","caller":"rafthttp/stream.go:442","msg":"stopped stream reader with remote peer","stream-reader-type":"stream MsgApp v2","local-member-id":"bf9071f4639c75cc","remote-peer-id":"91bc3c398fb3c146"}
{"level":"warn","ts":"2025-03-01T04:35:01.545246+0530","caller":"rafthttp/stream.go:421","msg":"lost TCP streaming connection with remote peer","stream-reader-type":"stream Message","local-member-id":"bf9071f4639c75cc","remote-peer-id":"91bc3c398fb3c146","error":"context canceled"}
{"level":"info","ts":"2025-03-01T04:35:01.545263+0530","caller":"rafthttp/stream.go:442","msg":"stopped stream reader with remote peer","stream-reader-type":"stream Message","local-member-id":"bf9071f4639c75cc","remote-peer-id":"91bc3c398fb3c146"}
{"level":"info","ts":"2025-03-01T04:35:01.545272+0530","caller":"rafthttp/peer.go:335","msg":"stopped remote peer","remote-peer-id":"91bc3c398fb3c146"}
{"level":"info","ts":"2025-03-01T04:35:01.545282+0530","caller":"rafthttp/peer.go:330","msg":"stopping remote peer","remote-peer-id":"fd422379fda50e48"}
{"level":"warn","ts":"2025-03-01T04:35:01.545307+0530","caller":"rafthttp/stream.go:286","msg":"closed TCP streaming connection with remote peer","stream-writer-type":"stream MsgApp v2","remote-peer-id":"fd422379fda50e48"}
{"level":"info","ts":"2025-03-01T04:35:01.545328+0530","caller":"rafthttp/stream.go:294","msg":"stopped TCP streaming connection with remote peer","stream-writer-type":"stream MsgApp v2","remote-peer-id":"fd422379fda50e48"}
{"level":"warn","ts":"2025-03-01T04:35:01.545359+0530","caller":"rafthttp/stream.go:286","msg":"closed TCP streaming connection with remote peer","stream-writer-type":"stream Message","remote-peer-id":"fd422379fda50e48"}
{"level":"info","ts":"2025-03-01T04:35:01.545379+0530","caller":"rafthttp/stream.go:294","msg":"stopped TCP streaming connection with remote peer","stream-writer-type":"stream Message","remote-peer-id":"fd422379fda50e48"}
{"level":"info","ts":"2025-03-01T04:35:01.545410+0530","caller":"rafthttp/pipeline.go:85","msg":"stopped HTTP pipelining with remote peer","local-member-id":"bf9071f4639c75cc","remote-peer-id":"fd422379fda50e48"}
{"level":"warn","ts":"2025-03-01T04:35:01.545467+0530","caller":"rafthttp/stream.go:421","msg":"lost TCP streaming connection with remote peer","stream-reader-type":"stream MsgApp v2","local-member-id":"bf9071f4639c75cc","remote-peer-id":"fd422379fda50e48","error":"context canceled"}
{"level":"warn","ts":"2025-03-01T04:35:01.545485+0530","caller":"rafthttp/peer_status.go:66","msg":"peer became inactive (message send to peer failed)","peer-id":"fd422379fda50e48","error":"failed to read fd422379fda50e48 on stream MsgApp v2 (context canceled)"}
{"level":"info","ts":"2025-03-01T04:35:01.545504+0530","caller":"rafthttp/stream.go:442","msg":"stopped stream reader with remote peer","stream-reader-type":"stream MsgApp v2","local-member-id":"bf9071f4639c75cc","remote-peer-id":"fd422379fda50e48"}
{"level":"warn","ts":"2025-03-01T04:35:01.545560+0530","caller":"rafthttp/stream.go:421","msg":"lost TCP streaming connection with remote peer","stream-reader-type":"stream Message","local-member-id":"bf9071f4639c75cc","remote-peer-id":"fd422379fda50e48","error":"context canceled"}
{"level":"info","ts":"2025-03-01T04:35:01.545577+0530","caller":"rafthttp/stream.go:442","msg":"stopped stream reader with remote peer","stream-reader-type":"stream Message","local-member-id":"bf9071f4639c75cc","remote-peer-id":"fd422379fda50e48"}
{"level":"info","ts":"2025-03-01T04:35:01.545592+0530","caller":"rafthttp/peer.go:335","msg":"stopped remote peer","remote-peer-id":"fd422379fda50e48"}
{"level":"warn","ts":"2025-03-01T04:35:01.545669+0530","caller":"rafthttp/http.go:413","msg":"failed to find remote peer in cluster","local-member-id":"bf9071f4639c75cc","remote-peer-id-stream-handler":"bf9071f4639c75cc","remote-peer-id-from":"91bc3c398fb3c146","cluster-id":"59a05384c9b79ee"}
{"level":"warn","ts":"2025-03-01T04:35:01.545698+0530","caller":"rafthttp/http.go:413","msg":"failed to find remote peer in cluster","local-member-id":"bf9071f4639c75cc","remote-peer-id-stream-handler":"bf9071f4639c75cc","remote-peer-id-from":"fd422379fda50e48","cluster-id":"59a05384c9b79ee"}
{"level":"warn","ts":"2025-03-01T04:35:01.545732+0530","caller":"rafthttp/http.go:413","msg":"failed to find remote peer in cluster","local-member-id":"bf9071f4639c75cc","remote-peer-id-stream-handler":"bf9071f4639c75cc","remote-peer-id-from":"91bc3c398fb3c146","cluster-id":"59a05384c9b79ee"}
{"level":"warn","ts":"2025-03-01T04:35:01.545765+0530","caller":"rafthttp/http.go:413","msg":"failed to find remote peer in cluster","local-member-id":"bf9071f4639c75cc","remote-peer-id-stream-handler":"bf9071f4639c75cc","remote-peer-id-from":"fd422379fda50e48","cluster-id":"59a05384c9b79ee"}
{"level":"info","ts":"2025-03-01T04:35:01.549658+0530","caller":"embed/etcd.go:613","msg":"stopping serving peer traffic","address":"127.0.0.1:2380"}
{"level":"info","ts":"2025-03-01T04:35:02.550532+0530","caller":"embed/etcd.go:618","msg":"stopped serving peer traffic","address":"127.0.0.1:2380"}
{"level":"info","ts":"2025-03-01T04:35:02.550561+0530","caller":"embed/etcd.go:410","msg":"closed etcd server","name":"node1","data-dir":"/tmp/etcd-node1","advertise-peer-urls":["http://127.0.0.1:2380"],"advertise-client-urls":["http://127.0.0.1:2379"]}

Крок 4: перезапустіть сервер etcd з тією ж конфігурацією

Перезапустіть сервер etcd з тією ж конфігурацією, але з новим двійковим файлом etcd.

-etcd-old --name ${name} \
+etcd-new --name ${name} \
  --data-dir /path/to/${name}.etcd \
  --listen-client-urls http://localhost:2379 \
  --advertise-client-urls http://localhost:2379 \
  --listen-peer-urls http://localhost:2380 \
  --initial-advertise-peer-urls http://localhost:2380 \
  --initial-cluster s1=http://localhost:2380,s2=http://localhost:22380,s3=http://localhost:32380 \
  --initial-cluster-token tkn \
  --initial-cluster-state new

Новий etcd v3.6 опублікує свою інформацію в кластері. На цьому етапі кластер все ще працює за протоколом v3.5, який є найнижчою загальною версією.

{"level":"info","ts":"2025-03-01T04:40:36.828+0530","caller":"api/capability.go:76","msg":"enabled capabilities for version","cluster-version":"3.5"}

{"level":"info","ts":"2025-03-01T04:40:36.889+0530","caller":"membership/cluster.go:539","msg":"updated cluster version","cluster-id":"59a05384c9b79ee","local-member-id":"bf9071f4639c75cc","from":"3.0","to":"3.5"}

{"level":"info","ts":"2025-03-01T04:40:36.828+0530","caller":"api/capability.go:76","msg":"enabled capabilities for version","cluster-version":"3.5"}

{"level":"info","ts":"2025-03-01T04:40:36.894+0530","caller":"etcdserver/server.go:1686","msg":"published local member to cluster through raft","local-member-id":"bf9071f4639c75cc","local-member-attributes":"{Name:node1 ClientURLs:[http://127.0.0.1:2379]}","cluster-id":"59a05384c9b79ee","publish-timeout":"7s"}

Переконайтеся, що кожен учасник, а потім і весь кластер, стає справним з новим двійковим файлом etcd v3.6:

etcdctl endpoint health --endpoints=localhost:2379,localhost:22379,localhost:32379
<<COMMENT
localhost:2379 is healthy: successfully committed proposal: took = 1.704998ms
localhost:22379 is healthy: successfully committed proposal: took = 2.331754ms
localhost:32379 is healthy: successfully committed proposal: took = 2.490705ms
COMMENT

Неоновлені учасники будуть записувати попередження, як показано нижче, доки весь кластер не буде оновлено.

Це очікувано і припиниться після того, як усі учасники кластера etcd будуть оновлені до v3.6:

{"level":"warn","ts":"2025-03-01T04:40:37.545960+0530","caller":"etcdserver/cluster_util.go:189","msg":"leader found higher-versioned member","local-member-version":"3.5.18","remote-member-id":"bf9071f4639c75cc","remote-member-version":"3.6.0-alpha.0"}

Крок 5: повторіть крок 3 та крок 4 для решти учасників

Коли всі учасники оновлені, кластер повідомить про успішне оновлення до v3.6:

Учасник 1:

{"level":"info","ts":"2025-03-01T04:58:32.375+0530","caller":"etcdserver/server.go:2149","msg":"updating cluster version using v3 API","from":"3.5","to":"3.6"} {"level":"info","ts":"2025-03-01T04:58:32.377+0530","caller":"etcdserver/server.go:2164","msg":"cluster version is updated","cluster-version":"3.6"}

Учасник 2:

{"level":"info","ts":"2025-03-01T04:58:32.377+0530","caller":"membership/cluster.go:539","msg":"updated cluster version","cluster-id":"59a05384c9b79ee","local-member-id":"91bc3c398fb3c146","from":"3.5","to":"3.6"}

Учасник 3:

{"level":"info","ts":"2025-03-01T04:58:32.377+0530","caller":"membership/cluster.go:539","msg":"updated cluster version","cluster-id":"59a05384c9b79ee","local-member-id":"fd422379fda50e48","from":"3.5","to":"3.6"}

endpoint health --endpoints=localhost:2379,localhost:22379,localhost:32379
<<COMMENT
localhost:2379 is healthy: successfully committed proposal: took = 492.834µs
localhost:22379 is healthy: successfully committed proposal: took = 1.015025ms
localhost:32379 is healthy: successfully committed proposal: took = 1.853077ms
COMMENT

curl http://localhost:2379/version
<<COMMENT
{"etcdserver":"3.6.0-alpha.0","etcdcluster":"3.6.0"}
COMMENT

curl http://localhost:22379/version
<<COMMENT
{"etcdserver":"3.6.0-alpha.0","etcdcluster":"3.6.0"}
COMMENT

curl http://localhost:32379/version
<<COMMENT
{"etcdserver":"3.6.0-alpha.0","etcdcluster":"3.6.0"}
COMMENT

Востаннє змінено September 13, 2026: Add Ukrainian documentation and tutorials for etcd v3.5..v3.8 (45739f0)