• Kubernetes多master部署(3)---etcd集群部署


    etcd集群部署

    安装包:etcd-v3.3.10-linux-amd64.tar.gz

     解压:

    tar xvf etcd-v3.3.10-linux-amd64.tar.gz
    
    cd etcd-v3.3.10-linux-amd64

    编辑etcd配置文件:

    vim /opt/kubernetes/cfg/etcd
    
    #[Member]
    ETCD_NAME="etcd01"
    ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
    ETCD_LISTEN_PEER_URLS="https://10.50.182.65:2380"
    ETCD_LISTEN_CLIENT_URLS="https://10.50.182.65:2379"
    
    #[Clustering]
    ETCD_INITIAL_ADVERTISE_PEER_URLS="https://10.50.182.65:2380"
    ETCD_ADVERTISE_CLIENT_URLS="https://10.50.182.65:2379"
    ETCD_INITIAL_CLUSTER="etcd01=https://10.50.182.65:2380,etcd02=https://10.50.182.66:2380,etcd03=https://10.50.182.67:2380"
    ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
    ETCD_INITIAL_CLUSTER_STATE="new"

    将etcd配置到系统环境中

    vim /usr/lib/systemd/system/etcd.service
    
    
    [Unit]
    Description=Etcd Server
    After=network.target
    After=network-online.target
    Wants=network-online.target
    
    [Service]
    Type=notify
    EnvironmentFile=-/opt/kubernetes/cfg/etcd
    ExecStart=/opt/kubernetes/bin/etcd 
    --name=${ETCD_NAME} 
    --data-dir=${ETCD_DATA_DIR} 
    --listen-peer-urls=${ETCD_LISTEN_PEER_URLS} 
    --listen-client-urls=${ETCD_LISTEN_CLIENT_URLS},http://127.0.0.1:2379 
    --advertise-client-urls=${ETCD_ADVERTISE_CLIENT_URLS} 
    --initial-advertise-peer-urls=${ETCD_INITIAL_ADVERTISE_PEER_URLS} 
    --initial-cluster=${ETCD_INITIAL_CLUSTER} 
    --initial-cluster-token=${ETCD_INITIAL_CLUSTER} 
    --initial-cluster-state=new 
    --cert-file=/opt/kubernetes/ssl/server.pem 
    --key-file=/opt/kubernetes/ssl/server-key.pem 
    --peer-cert-file=/opt/kubernetes/ssl/server.pem 
    --peer-key-file=/opt/kubernetes/ssl/server-key.pem 
    --trusted-ca-file=/opt/kubernetes/ssl/ca.pem 
    --peer-trusted-ca-file=/opt/kubernetes/ssl/ca.pem
    Restart=on-failure
    LimitNOFILE=65536
    
    [Install]
    WantedBy=multi-user.target

    启动etcd服务日志在/var/log/messages:

    systemctl start etcd
    
    systemctl enable etcd
    
    systemctl status etcd -l

    此时master上面etcd配置完毕,我们将其配置拷贝到其他2台机器上面,命令自己调整:

    scp -rf  -P 10022 jyapp@10.50.182.65:/opt/kubernetes  /opt/
    在master02和master03上启动etcd

    测试etcd:
    cd /opt/kubernetes/ssl
     /opt/kubernetes/bin/etcdctl --ca-file=ca.pem --cert-file=server.pem --key-file=server-key.pem --endpoints="https://10.50.182.65:2379,https://10.50.182.66:2379,https://10.50.182.67:2379" cluster-health
  • 相关阅读:
    js规范
    JS多个函数多个参数如何动态调用,apply的灵活应用
    我是插件狂人,jDuang,jValidator,jModal,jGallery
    Button在IE6、7下的自适应宽度问题解决方法
    100个直接可以拿来用的JavaScript实用功能代码片段
    docker
    jsonp实现post跨域请求
    setInterval倒计时10s
    CI框架源码解读(1)-入口文件index.php
    为什么开始源码阅读
  • 原文地址:https://www.cnblogs.com/litzhiai/p/10813932.html
Copyright © 2020-2023  润新知