Ubuntu 上的 etcd

Openstack服务可以使用Etcd,Etcd是一个高可用的键值存储系统,主要用于键锁、存储配置和服务发等场景。

The etcd service runs on the controller node.

安装并配置组件

  1. 安装 ``etcd``包

    # apt install etcd
    

    备注

    As of Ubuntu 18.04, the etcd package is no longer available from the default repository. To install successfully, enable the Universe repository on Ubuntu.

    As for Ubuntu 24.04 install the package with following name:

    # apt install etcd-server
    
  2. 编辑``/etc/etcd/etcd.conf``配置``ETCD_INITIAL_CLUSTER``, ETCD_INITIAL_ADVERTISE_PEER_URLS, ETCD_ADVERTISE_CLIENT_URLS, ETCD_LISTEN_CLIENT_URLS 为控制节点的管理IP,使其他节点可以通过管理网络来访问。

    ETCD_NAME="controller"
    ETCD_DATA_DIR="/var/lib/etcd"
    ETCD_INITIAL_CLUSTER_STATE="new"
    ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
    ETCD_INITIAL_CLUSTER="controller=http://10.0.0.11:2380"
    ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.0.11:2380"
    ETCD_ADVERTISE_CLIENT_URLS="http://10.0.0.11:2379"
    ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
    ETCD_LISTEN_CLIENT_URLS="http://10.0.0.11:2379"
    

完成安装

  1. Enable and restart the etcd service:

    # systemctl enable etcd
    # systemctl restart etcd