etcd学习笔记

https://www.zybuluo.com/wtf0215/note/554924


etcd学习笔记

启动etcd+skydns
   
   
  1. 1.etcd --data-dir /wtf/etcd/etcd_log1 --name wtf_etcd_test1
  2. etcd --data-dir /wtf/etcd/etcd_log1 --name wtf_etcd_test1
  3. etcd --data-dir /wtf/etcd/etcd_log1 --name wtf_etcd_test1 > etcd_out.file 2>&1&
  4. skydns > skydns_out.txt 2>&1&
  5. //advertise client URLs = http://localhost:2379,http://localhost:4001
  6. //initial advertise peer URLs = http://localhost:2380,http://localhost:7001
  7. //initial cluster = machine1=http://localhost:2380,machine1=http://localhost:7001
  8. 2.curl -s -XPUT http://127.0.0.1:4001/v2/keys/skydns/config -d value='{"dns_addr":"127.0.0.1:53","nameserver":"8.8.8.8:53"}'
  9. 3.skydns -machines=http://127.0.0.1:4001 -nameservers=8.8.4.4:53
三个etcd启动
   
   
  1. etcd -peer-addr 127.0.0.1:7001 -addr 127.0.0.1:4001 -data-dir /wtf/etcd/machines/machine1 -name machine1
  2. etcd -peer-addr 127.0.0.1:7002 -addr 127.0.0.1:4002 -peers 127.0.0.1:7001,127.0.0.1:7003 -data-dir /wtf/etcd/machines/machine2 -name machine2
  3. etcd -peer-addr 127.0.0.1:7003 -addr 127.0.0.1:4003 -peers 127.0.0.1:7001,127.0.0.1:7002 -data-dir /wtf/etcd/machines/machine3 -name machine3
官方文档
   
   
  1. etcd 启动参数
  2. -name (节点名称)infra0
  3. -initial-advertise-peer-urls (初始化——节点间通信——地址)http://10.0.1.10:2380 \
  4. -listen-peer-urls (节点与节点——监听—其—地址) http://10.0.1.10:2380 \
  5. -listen-client-urls (节点与客户端——监听-其-地址) http://10.0.1.10:2379,http://127.0.0.1:2379 \
  6. -advertise-client-urls (通知-客户端-地址)http://10.0.1.10:2379 \
  7. -initial-cluster-token (初始化-集群-令牌)etcd-cluster-1 \
  8. -initial-cluster (初始化-集群)infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
  9. -initial-cluster-state (初始化-集群-状态)new
  10. etcd
  11. -name (节点名称)infra1
  12. -initial-advertise-peer-urls(初始化——节点间通信——地址) http://10.0.1.11:2380 \
  13. -listen-peer-urls(节点与节点——监听—其—地址) http://10.0.1.11:2380 \
  14. -listen-client-urls (节点与客户端——监听-其-地址)http://10.0.1.11:2379,http://127.0.0.1:2379 \
  15. -advertise-client-urls(通知-客户端-地址) http://10.0.1.11:2379 \
  16. -initial-cluster-token(初始化-集群-令牌) etcd-cluster-1 \
  17. -initial-cluster(初始化-集群) infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \
  18. -initial-cluster-state(初始化-集群-状态) new
  19. etcd \
  20. -data-dir /wtf/etcd/machines/machine1 \
  21. -name machine1 \
  22. -initial-advertise-peer-urls http://127.0.0.1:2380 \
  23. -listen-peer-urls http://127.0.0.1:2380 \
  24. -listen-client-urls http://127.0.0.1:2379 \
  25. -advertise-client-urls http://127.0.0.1:2379\
  26. -initial-cluster-token etcd-cluster-1 \
  27. -initial-cluster machine1=http://127.0.0.1:2380,machine2=http://127.0.0.1:7001 \
  28. -initial-cluster-state new
  29. etcd \
  30. -data-dir /wtf/etcd/machines/machine2 \
  31. -name machine2 \
  32. -initial-advertise-peer-urls http://127.0.0.1:7001 \
  33. -listen-peer-urls http://127.0.0.1:7001 \
  34. -listen-client-urls http://127.0.0.1:4001 \
  35. -advertise-client-urls http://127.0.0.1:4001\
  36. -initial-cluster-token etcd-cluster-1 \
  37. -initial-cluster machine1=http://127.0.0.1:2380,machine2=http://127.0.0.1:7001 \
  38. -initial-cluster-state new
+

    • 0
      点赞
    • 0
      收藏
      觉得还不错? 一键收藏
    • 0
      评论

    “相关推荐”对你有帮助么?

    • 非常没帮助
    • 没帮助
    • 一般
    • 有帮助
    • 非常有帮助
    提交
    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值