k8s基础(3)etcd集群

  • 下载安装

  •   https://github.com/coreos/etcd/releases  在这网页,可以看到有多个版本共选择。
  • 下载3.25
  • 解压后,

    cd etcd-v3.2.5-linux-amd64

    会看到etcd,etcdctl,将它们复制到/usr/local/bin下
  • cp etcd* /usr/bin
  • vim  kube-etcd.service

  • [Unit]
    Description=Kube-etcd Service
    After=network.target

    [Service]
    Type=notify
    ExecStart=/usr/local/bin/etcd \
    --name "etcd1" \
    --data-dir="~/.k8s/etcd" \
    --listen-client-urls "http://192.168.0.222:2379,http://127.0.0.1:2379" \
    --listen-peer-urls "http://192.168.0.222:2380" \
    --advertise-client-urls "http://192.168.0.222:2379" \
    --initial-advertise-peer-urls "http://192.168.0.222:2380" \
    --initial-cluster "etcd1=http://192.168.0.222:2380" \
    --initial-cluster-state "new"
    Restart=always
    LimitNOFILE=65536

    [Install]
    WantedBy=default.target

  • cp -rf kube-etcd.service   /lib/systemd/system/
  • systemctl --system daemon-reload

  • systemctl start kube-etcd.service
posted @ 2017-10-24 16:45  一只宅男的自我修养  阅读(811)  评论(0)    收藏  举报