美文网首页
etcd线上推荐配置

etcd线上推荐配置

作者: Ballpenww | 来源:发表于2022-08-31 18:23 被阅读0次

    关注点:

    1. 加密配置
    2. 压缩配置
    3. 日志配置
    4. 监控指标
    5. v2状态

    /etc/etcd/etcd.conf 相关参数含义 etcd -h自己查看

    #[Member]
    #ETCD_CORS=""
    ETCD_DATA_DIR="/data/etcd/default.etcd"
    #ETCD_WAL_DIR=""
    ETCD_LISTEN_PEER_URLS="https://0.0.0.0:2380"
    ETCD_LISTEN_CLIENT_URLS="https://0.0.0.0:2379"
    #ETCD_MAX_SNAPSHOTS="5"
    #ETCD_MAX_WALS="5"
    ETCD_NAME="etcd01"
    #ETCD_SNAPSHOT_COUNT="100000"
    #ETCD_HEARTBEAT_INTERVAL="100"    # 根据具体网络情况调整,正常情况不用修改
    #ETCD_ELECTION_TIMEOUT="1000"    # 根据具体网络情况调整,正常情况不用修改
    #ETCD_QUOTA_BACKEND_BYTES="0"   # 根据你们使用情况定义,默认2G,最大不建议超过8G
    #ETCD_MAX_REQUEST_BYTES="1572864"
    #ETCD_GRPC_KEEPALIVE_MIN_TIME="5s"
    #ETCD_GRPC_KEEPALIVE_INTERVAL="2h0m0s"
    #ETCD_GRPC_KEEPALIVE_TIMEOUT="20s"
    #ETCD_SOCKET_REUSE_PORT="false"
    #ETCD_SOCKET_REUSE_ADDRESS="false"
    #
    #[Clustering]
    ETCD_INITIAL_ADVERTISE_PEER_URLS="https://ip1:2380"
    ETCD_ADVERTISE_CLIENT_URLS="https://ip1:2379"
    #ETCD_DISCOVERY=""
    #ETCD_DISCOVERY_FALLBACK="proxy"
    #ETCD_DISCOVERY_PROXY=""
    #ETCD_DISCOVERY_SRV=""
    ETCD_INITIAL_CLUSTER="etcd01=https://ip1:2380,etcd02=https://ip2:2380,etcd03=https://ip3:2380"
    ETCD_INITIAL_CLUSTER_TOKEN="etcd-first"
    ETCD_INITIAL_CLUSTER_STATE="new"
    ETCD_STRICT_RECONFIG_CHECK="true"
    ETCD_ENABLE_V2="false"   # 根据使用情况定,3.6版本将废弃,3.5和3.4默认是关闭的
    ETCD_PRE_VOTE="true"
    #
    #[Compaction]
    ETCD_AUTO_COMPACTION_MODE="periodic"  # periodic:按照时间周期,revision: 按照版本
    ETCD_AUTO_COMPACTION_RETENTION="72h"  # 按需调整
    #
    #[Proxy]
    #ETCD_PROXY="off"
    #ETCD_PROXY_FAILURE_WAIT="5000"
    #ETCD_PROXY_REFRESH_INTERVAL="30000"
    #ETCD_PROXY_DIAL_TIMEOUT="1000"
    #ETCD_PROXY_WRITE_TIMEOUT="5000"
    #ETCD_PROXY_READ_TIMEOUT="0"
    #
    #[Security]
    # 这块主要用自签名证书验证,如果要更安全的防护,可以增加--**-cert-allowed-hostname、--peer-cert-allowed-cn、--cipher-suites、--host-whitelist等配置
    ETCD_CERT_FILE="/path/etcd/ssl/server.pem"
    ETCD_KEY_FILE="/path/etcd/ssl/server-key.pem"
    ETCD_CLIENT_CERT_AUTH="true"
    ETCD_TRUSTED_CA_FILE="/path/etcd/ssl/ca.pem"
    #ETCD_AUTO_TLS="false"
    ETCD_PEER_CERT_FILE="/path/etcd/etcdssl/server.pem"
    ETCD_PEER_KEY_FILE="/path/etcd/etcdssl/server-key.pem"
    ETCD_PEER_CLIENT_CERT_AUTH="true"
    ETCD_PEER_TRUSTED_CA_FILE="/path/etcd/etcdssl/ca.pem"
    #ETCD_PEER_AUTO_TLS="false"
    #
    #[Logging]
    #ETCD_DEBUG="false"
    ETCD_LOGGER="zap"
    ETCD_LOG_LEVEL="info"
    ETCD_ENABLE_LOG_ROTATION="true"
    ETCD_LOG_OUTPUTS="/path/to/etcd.log"
    #ETCT_LOG_ROTATION_CONFIG_JSON='{"maxsize": 100, "maxage": 0, "maxbackups": 0, "localtime": false, "compress": false}'
    #
    #[Unsafe]
    #ETCD_FORCE_NEW_CLUSTER="false"
    #
    #[Version]
    #ETCD_VERSION="false"
    ETCD_AUTO_COMPACTION_RETENTION="5m"
    ETCD_AUTO_COMPACTION_mode="periodic"
    #
    #[Profiling]
    #ETCD_ENABLE_PPROF="false"
    ETCD_METRICS="extensive"
    #
    #[Auth]
    # 默认关闭,更具实际情况配置吧
    #ETCD_AUTH_TOKEN="simple"
    

    相关文章

      网友评论

          本文标题:etcd线上推荐配置

          本文链接:https://www.haomeiwen.com/subject/bkwdnrtx.html