Module: ETCD

    Pigsty use etcd as DCS: Distributed configuration storage (or distributed consensus service). Which is critical to PostgreSQL High-Availability & Auto-Failover.

    You have to install ETCD module before any modules, since patroni & vip-manager will rely on etcd to work. Unless you are using an external etcd cluster.

    You have to install ETCD after module, since etcd require the trusted CA to work. Check ETCD Administration SOP for more details.


    There’s a built-in playbook: for installing etcd cluster. But you have to define it first.

    Here are available sub tasks:

    • etcd_assert : generate minio identity
    • etcd_install : install etcd rpm packages
    • etcd_clean : cleanup existing etcd
      • etcd_purge : remove running etcd instance & data
    • etcd_dir : create etcd data & conf dir
    • : create etcd directories
    • etcd_config : generate etcd config
      • etcd_conf : generate etcd main config
      • etcd_cert : generate etcd ssl cert
    • etcd_launch : launch etcd service
    • etcd_register : register etcd to prometheus

    If is true, or etcd_clean is , the playbook will abort if any running etcd instance exists to prevent purge etcd by accident.


    You have to define an etcd cluster before deploying it. There some parameters about etcd.

    It is recommending to have at least 3 instances for a serious production environment.

    Single Node

    1. etcd: { hosts: { 10.10.10.10: { etcd_seq: 1 } }, vars: { etcd_cluster: etcd } }

    This is good enough for development, testing & demonstration, but not recommended in serious production environment.

    Three Nodes

    You can define etcd cluster with multiple nodes. Remember to use odd number for cluster size.

    More Nodes

    You can also add members to existing etcd cluster, and you have to tell the existing cluster with etcdctl member add first:

    1. etcdctl member add <etcd-?> --peer-urls=https://<new_ins_ip>:2380
    2. ./etcd.yml -l <new_ins_ip> -e etcd_init=existing

    Check for more details.


    Here are some useful commands for etcd administration, check for more details.

    Cluster Management

    Environment

    Pigsty use etcd v3 API by default.

    CRUD

    You can do CRUD with following commands.


    There is one dashboard for ETCD module:

    ETCD Overview

    Overview of the ETCD cluster


    There are 10 parameters about ETCD module.