Etcd untuk SUSE¶
Saat ini, tidak ada paket distro yang tersedia untuk etcd3. Panduan ini menggunakan instalasi tarbal sebagai solusi sampai paket distro yang benar tersedia.
Layanan etcd berjalan pada node controller.
Menginstal dan mengkonfigurasi komponen¶
Install etcd:
Buat pengguna etcd:
# groupadd --system etcd # useradd --home-dir "/var/lib/etcd" \ --system \ --shell /bin/false \ -g etcd \ etcd
Buat direktori yang diperlukan:
# mkdir -p /etc/etcd # chown etcd:etcd /etc/etcd # mkdir -p /var/lib/etcd # chown etcd:etcd /var/lib/etcd
Tentukan arsitektur sistem Anda:
# uname -m
Unduh dan pasang tarbal etcd untuk x86_64/amd64:
# ETCD_VER=v3.2.7 # rm -rf /tmp/etcd && mkdir -p /tmp/etcd # curl -L \ https://github.com/coreos/etcd/releases/download/${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 --strip-components=1 # cp /tmp/etcd/etcd /usr/bin/etcd # cp /tmp/etcd/etcdctl /usr/bin/etcdctl
Atau unduh dan instal tarbal etcd untuk arm64:
# ETCD_VER=v3.2.7 # rm -rf /tmp/etcd && mkdir -p /tmp/etcd # curl -L \ https://github.com/coreos/etcd/releases/download/${ETCD_VER}/etcd-${ETCD_VER}-linux-arm64.tar.gz \ -o /tmp/etcd-${ETCD_VER}-linux-arm64.tar.gz # tar xzvf /tmp/etcd-${ETCD_VER}-linux-arm64.tar.gz \ -C /tmp/etcd --strip-components=1 # cp /tmp/etcd/etcd /usr/bin/etcd # cp /tmp/etcd/etcdctl /usr/bin/etcdctl
Buat dan edit file
/etc/etcd/etcd.conf.yml
dan mengaturinitial-cluster
,initial-advertise-peer-urls
,advertise-client-urls
,listen-client-urls
ke alamat IP manajemen dari node controller untuk memungkinkan akses oleh node lain melalui jaringan manajemen:name: controller data-dir: /var/lib/etcd initial-cluster-state: 'new' initial-cluster-token: 'etcd-cluster-01' initial-cluster: controller=http://10.0.0.11:2380 initial-advertise-peer-urls: http://10.0.0.11:2380 advertise-client-urls: http://10.0.0.11:2379 listen-peer-urls: http://0.0.0.0:2380 listen-client-urls: http://10.0.0.11:2379
Buat dan edit file
/usr/lib/systemd/system/etcd.service
:[Unit] After=network.target Description=etcd - highly-available key value store [Service] # Uncomment this on ARM64. # Environment="ETCD_UNSUPPORTED_ARCH=arm64" LimitNOFILE=65536 Restart=on-failure Type=notify ExecStart=/usr/bin/etcd --config-file /etc/etcd/etcd.conf.yml User=etcd [Install] WantedBy=multi-user.target
Muat ulang file systemd dengan:
# systemctl daemon-reload
Finalisasi instalasi¶
Aktifkan dan mulai layanan yang ada:
# systemctl enable etcd # systemctl start etcd