メモ。
k8s のマスターで Key/Value データストアとして利用されている etcd
を少し使ってみた時のメモ。
やってみた時のメモ
環境
- MacOS X Mojave(10.14.6)
- etcd 3.4.8
インストール
Go で書かれており、リリースバイナリがあるようなのでこれを使ってみる
Mac なので darwin のものをダウンロードする。
$cd /tmp/
$wget https://github.com/etcd-io/etcd/releases/download/v3.4.8/etcd-v3.4.8-darwin-amd64.zip
$unzip etcd-v3.4.8-darwin-amd64.zip
$ls etcd-v3.4.8-darwin-amd64
Documentation README.md etcd
README-etcdctl.md READMEv2-etcdctl.md etcdctl
OK.
etcd の起動
Github の README に従いつつ、etcd を起動してみる。
$/tmp/etcd-v3.4.8-darwin-amd64/etcd
これでフォワグラウンドで etcd が起動され、ログが出る。
etcd への操作(値の put/get)
別途ターミナルを起動し、etcdtcl
を使って操作を試す
$/tmp/etcd-v3.4.8-darwin-amd64/etcdctl put mykey "this is awesome"
OK
$/tmp/etcd-v3.4.8-darwin-amd64/etcdctl get mykey
mykey
this is awesome
無事出来た