etcd增删改查
Posted 离地最远的星
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了etcd增删改查相关的知识,希望对你有一定的参考价值。
![image-20191209191301618](C:UsersAneroKissingerAppDataRoamingTypora ypora-user-imagesimage-20191209191301618.png
root@instance-emh5jlpa:~# etcdctl put /user/101/name xiahualou
OK
root@instance-emh5jlpa:~# etcdctl get /user/101
root@instance-emh5jlpa:~# etcdctl get /user/101/name
/user/101/name
xiahualou
root@instance-emh5jlpa:~# etcdctl get /user/101 --prefix //获取所有以/user/101为前缀的
/user/101/name
xiahualou
root@instance-emh5jlpa:~# etcdctl del /user/101 --prefix //删除所有以/user/101为前缀的
1
![image-20191209191301618](C:UsersAneroKissingerAppDataRoamingTypora ypora-user-imagesimage-20191209191301618.png
root@instance-emh5jlpa:~# etcdctl put /user/101/name xiahualou
OK
root@instance-emh5jlpa:~# etcdctl get /user/101
root@instance-emh5jlpa:~# etcdctl get /user/101/name
/user/101/name
xiahualou
root@instance-emh5jlpa:~# etcdctl get /user/101 --prefix //获取所有以/user/101为前缀的
/user/101/name
xiahualou
root@instance-emh5jlpa:~# etcdctl del /user/101 --prefix //删除所有以/user/101为前缀的
1
以上是关于etcd增删改查的主要内容,如果未能解决你的问题,请参考以下文章
MyBatis增删改查(步骤详细,由浅入深,适合初学者,只看这一篇就够了)