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 NoSQL
ETCD教程-4.深入ETCD
目前etcd主要经历了3个大的版本,分别为etcd 0.4版本、etcd 2.0版本和etcd 3.0版本。
796 0
ETCD教程-4.深入ETCD
|
网络协议 Shell 网络安全
etcd3.4集群安装并设置开机自启动
--permanent永久生效,没有此参数重启后失效,防火墙打开2379和2380端口,同时刷新防火墙 firewall-cmd --zone=public --add-port=2379/tcp --permanentfirewall-cmd --zone=public --add-port=2.
4506 0
|
2月前
|
存储 NoSQL 应用服务中间件
Etcd+Confd实现Nginx配置文件自动管理
Etcd+Confd实现Nginx配置文件自动管理
|
2月前
|
存储 负载均衡 算法
1. Etcd 介绍
1. Etcd 介绍
|
9月前
|
存储 Kubernetes 算法
【K8S系列】深入解析etcd
【K8S系列】深入解析etcd
206 0
|
10月前
|
JSON API Go
etcd的安装和使用
etcd的安装和使用
142 0
|
2月前
|
算法 Java Go
ETCD(六)ETCD和Zookeeper
ETCD(六)ETCD和Zookeeper
61 0
|
存储 算法 安全
Etcd 初步认识
近期在接触的新项目中在使用Etcd,但是在使用的过程中公司对其的使用仅使用服务注册的功能,并未将其发挥真正的用处。学习一波,将来可以在项目中使用进行改进。
236 0
|
安全 数据安全/隐私保护
ETCD安全设置
ETCD安全设置
484 0
|
存储 监控 算法
ETCD教程-1.ETCD介绍
etcd是一个Go言编写的分布式、高可用的一致性键值存储系统,用于提供可靠的分布式键值存储、配置共享和服务发现等功能
541 0
ETCD教程-1.ETCD介绍