キーの監視方法
etcdのキーを監視するためのガイド
前提条件
etcdとetcdctlをインストールします。
キーの監視
今後の変更の通知を受け取るwatch:
etcdctl watch $KEY [$END_KEY]オプション
-i, --interactive[=false]: interactive mode
--prefix[=false]: watch on a prefix if prefix is set
--rev=0: Revision to start watching
--prev-kv[=false]: get the previous key-value pair before the event happens
--progress-notify[=false]: get periodic watch progress notification from server親コマンドから継承されるオプション
--endpoints="127.0.0.1:2379": gRPC endpoints例

etcdctl --endpoints=$ENDPOINTS watch stock1
etcdctl --endpoints=$ENDPOINTS put stock1 1000
etcdctl --endpoints=$ENDPOINTS watch stock --prefix
etcdctl --endpoints=$ENDPOINTS put stock1 10
etcdctl --endpoints=$ENDPOINTS put stock2 20
最終更新 2026年9月8日 · refactor(docs): move component documentation under /docs (f643529)
etcd v3.7 documentation (v3.7, commit 8245979)(Copyright 2013-present etcd Authors、CC BY 4.0)を基に改変。帰属と変更履歴を参照してください。
このページは翻訳です。正式な内容は原文に従います。