存取测试
代码语言:javascript复制[root@docker etcd-v2.2.4-linux-amd64]# ./etcdctl set keytest "hello world for etcd test"
hello world for etcd test
[root@docker etcd-v2.2.4-linux-amd64]# ./etcdctl get keytest
hello world for etcd test
[root@docker etcd-v2.2.4-linux-amd64]#
单点运行
代码语言:javascript复制[root@docker etcd-v2.2.4-linux-amd64]# netstat -ant | grep -E '(2379|2380)'
[root@docker etcd-v2.2.4-linux-amd64]#
----------
[root@docker etcd-v2.2.4-linux-amd64]# ./etcd
2016-02-01 22:54:18.977681 I | etcdmain: etcd Version: 2.2.4
2016-02-01 22:54:18.977850 I | etcdmain: Git SHA: bdee27b
2016-02-01 22:54:18.977859 I | etcdmain: Go Version: go1.5.3
2016-02-01 22:54:18.977867 I | etcdmain: Go OS/Arch: linux/amd64
...
...
...
----------
[root@docker etcd-v2.2.4-linux-amd64]# netstat -ant | grep -E '(2379|2380)'
tcp 0 0 127.0.0.1:2379 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2380 0.0.0.0:* LISTEN
[root@docker etcd-v2.2.4-linux-amd64]#
etcd运行后会监听在本地的 2379 和 2380 上面
- 2379 用来与客户通讯
- 2380 用来进行服务间通讯