ETCD(二)配置文件说明

简介: ETCD(二)配置文件说明

从配置文件参数了解ETCD的一些特性

如下:

name: "etcdnode1" # 节点名称,需要自定义
data-dir: "/etcd-data/data" # 数据存储目录,可以看出etcd是用反斜杠类似文件目录的形式来分级并存储数据的
wal-dir: "/etcd-data/wal" # 预写式日志存储目录,这是设置WAL日志存储地址,不需要关注
listen-peer-urls: "http://0.0.0.0:12380" # 集群成员之间通讯使用的URL(集群服务节点与服务节点之间通讯)
listen-client-urls: "http://0.0.0.0:12379" # 集群提供给外部客户端访问的URL,即外部客户端必须通过指定的IP加端口访问etcd (客户端与服务节点之间通讯)
initial-advertise-peer-urls: "http://192.168.239.000:12380" #集群推荐配置地址
initial-cluster:"etcdnode0=http://192.168.239.000:2380,etcdnode1=http://192.168.239.000:12380,etcdnode2=http://192.168.239.000:22380" # 集群初始成员配置,是etcd静态部署的核心初始化配置,它说明了当前集群由哪些URLs组成,此处default为节点名称(以节点名称=节点地址拼接而成,通过这个参数可以找到集群所有节点)
initial-cluster-state: "new" # 初始化集群状态(new 或 existing)
initial-cluster-token: "etcd-cluster" # 引导期间etcd集群的初始集群令牌,防止不同集群之间产生交互,作为某一个集群的唯一名字标签
advertise-client-urls: "http://192.168.239.000:12379" # 向客户端发布的推荐服务端点
log-level: "warn" # 配置日志级别,仅支持 debug, info, warn, error, panic, or fatal

集群配置文件示例

etcd1: etcd --name ares1 --listen-client-urls http://localhost:12379 --advertise-client-urls http://localhost:12379 --listen-peer-urls http://localhost:12380 --initial-advertise-peer-urls http://localhost:12380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'ares1=http://localhost:12380,ares2=http://localhost:22380,ares3=http://localhost:32380' --initial-cluster-state new
etcd2: etcd --name ares2 --listen-client-urls http://localhost:22379 --advertise-client-urls http://localhost:22379 --listen-peer-urls http://localhost:22380 --initial-advertise-peer-urls http://localhost:22380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'ares1=http://localhost:12380,ares2=http://localhost:22380,ares3=http://localhost:32380' --initial-cluster-state new
etcd3: etcd --name ares3 --listen-client-urls http://localhost:32379 --advertise-client-urls http://localhost:32379 --listen-peer-urls http://localhost:32380 --initial-advertise-peer-urls http://localhost:32380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'ares1=http://localhost:12380,ares2=http://localhost:22380,ares3=http://localhost:32380' --initial-cluster-state new
目录
相关文章
|
JSON 应用服务中间件 API
【干货】将参数传递给 Apache APISIX 的五种方式
【干货】将参数传递给 Apache APISIX 的五种方式
540 0
|
11月前
|
存储 关系型数据库 分布式数据库
【赵渝强老师】基于PostgreSQL的分布式数据库:Citus
Citus 是基于 PostgreSQL 的开源分布式数据库,采用 shared nothing 架构,具备良好的扩展性。它以插件形式集成,部署简单,适用于处理大规模数据和高并发场景。本文介绍了 Citus 的基础概念、安装配置步骤及其在单机环境下的集群搭建方法。
924 2
|
SQL 关系型数据库 数据库
postgresql中连接两张表更新第三张表(updata)
如何结合两张表的数据来更新第三张表
823 0
|
存储 Unix Linux
etcd集群搭建
etcd集群搭建
|
存储 监控 网络协议
在Linux中,什么是SAN和NAS存储?
在Linux中,什么是SAN和NAS存储?
|
存储 Kubernetes Cloud Native
云原生|kubernetes|etcd集群详细介绍+安装部署+调优
云原生|kubernetes|etcd集群详细介绍+安装部署+调优
3621 1
|
存储 Kubernetes 安全
在K8S中,etcdctl如何使用?
在K8S中,etcdctl如何使用?
|
JSON fastjson Java
JSON中FastJSON使用总结
JSON中FastJSON使用总结
462 1