美文网首页
etcd 的部署

etcd 的部署

作者: wayyyy | 来源:发表于2023-01-14 00:00 被阅读0次

安装

Centos 7 使用如下方式进行安装:

#/bin/bash

ETCD_VER=v3.4.4
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download 
DOWNLOAD_URL=${GITHUB_URL}

rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
rm -rf /tmp/etcd-download-test && mkdir -p/tmp/etcd-download-test 

curl -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz

tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz-c/tmp/etcd-download-test --strip-components=1

rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz 

/tmp/etcd-download-test/etcd --version
/tmp/etcd-download-test/etcdctl version

单机部署

集群部署

在生产环境中,为了整个集群的高可用,etcd 正常都是集群部署,避免单点故障。引导etcd 集群启动有以下3种方式:

  • 静态
    静态启动的etcd 集群的方式需要每个成员都知道集群中的其他成员
  • etcd 动态发现
  • DNS 发现
静态方式启动

这里我们使用goreman 整个多进程管理工具来完成ectd集群搭建,首先安装 goreman 这个工具。

# go get github.com/mattn/goreman

然后新建 /opt/profile,加入如下内容:

etcdl: etcd --name infral --listen-client-urls http://127.0.0.1:12379 --advertise-client-urls http://127.0.0.1:12379 \
--listen-peer-urls http://127.0.0.1:12380 --initial-advertise-peer-urls http://127.0.0.1:12380 --initial-cluster-token \
etcd-cluster-1 --initial-cluster 'infral=http://127.0.0.1:12380, infra2=http://127.0.0.1:22380, infra3=http://127.0.0.1:32380'
-initial -cluster-state new --enable-pprof --logger=zap --log-outputs=stderr

执行goreman -f /opt/profile启动集群。

启动完成后,可使用命令查看集群内的成员:

# etcdctl --endpoint=http://localhost:22379 member list
动态方式启动

在上面的方式中,我们是以静态的方式指定集群成员,但在实际生产环境中,集群成员的IP可能不会提前知道。

相关文章

  • 使用etcd报错dial tcp 192.168.0.1:237

    使用2个机器,搭了一个3etcd集群,机器A上部署1个etcd,机器B上部署2个etcd 机器A上使用etcdct...

  • 部署k8s-v1.22.3版本高可用集群

    本文采用的是etcd、master、HA混合部署方式,当然也可以把etcd cluster独立出来部署也是可以 本...

  • Centos7二进制部署k8s(一) Etcd集群

    一、部署etcd集群 使用cfssl来生成自签证书,先下载cfssl工具: 1.1 生成证书 1.2 部署Etcd...

  • k8s学习笔记-6-etcd

    6 部署etcd 签发etcd证书,签发证书的服务器,node5 创建ca-config.json 创建etcd证...

  • 手动构筑单机版K8s(五)创建单节点etcd

    5.创建单节点etcd kuberntes 系统使用 etcd 存储所有数据,本文介绍单节点etcd部署方式 TL...

  • etcd部署

    这里使用的环境是三台centos7.5的机器 安装 在三台机器上安装etcd 配置 公用的变量。 在三台机器上分别...

  • 部署etcd

    注意etcd默认是监听在127.0.0.1的需要在启动时配置命令行参数,否则在实机是访问不了etcd服务的 测试一...

  • 部署Etcd

    官方二进制包下载地址:https://github.com/etcd-io/etcd/releases 1. 创建...

  • etcd 的部署

    安装 Centos 7 使用如下方式进行安装: 单机部署 集群部署 在生产环境中,为了整个集群的高可用,etcd ...

  • 大规模场景下 kubernetes 集群的性能优化

    一、etcd 优化 1、etcd 采用本地 ssd 盘作为后端存储存储 2、etcd 独立部署在非 k8s nod...

网友评论

      本文标题:etcd 的部署

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