How to Install etcd on Debian Latest

Introduction

etcd is an open-source, distributed key-value store used for storing configuration data, coordination, and service discovery. It is commonly used within Kubernetes clusters to store cluster-level metadata. In this tutorial, we will cover the steps to install etcd on Debian Latest.

Prerequisites

Before starting, make sure you have:

Step 1: Download etcd

First, get the latest version of etcd from the official etcd GitHub repository:

# Download etcd v3.5.0
wget https://github.com/coreos/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-amd64.tar.gz

Step 2: Extract the etcd archive

Extract the etcd archive to a suitable directory. In this tutorial, we will extract the archive to /usr/local/bin directory:

sudo tar -zxvf etcd-v3.5.0-linux-amd64.tar.gz -C /usr/local/bin --strip 1

Step 3: Create the etcd systemd service

Create a file etcd.service in the /etc/systemd/system/ directory:

sudo nano /etc/systemd/system/etcd.service

Add the following contents to the etcd.service file:

[Unit]
Description=etcd key-value store
Documentation=https://github.com/coreos/etcd
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
Type=notify
User=etcd
ExecStart=/usr/local/bin/etcd
Restart=always
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

Save and close the etcd.service file.

Step 4: Reload the systemctl daemon

Reload the systemctl daemon to apply changes:

sudo systemctl daemon-reload

Step 5: Start and enable the etcd service

Start the etcd service and enable it to start automatically at boot time:

sudo systemctl start etcd
sudo systemctl enable etcd

Step 6: Check the etcd service status

Check the etcd service status to ensure that the service was started successfully:

sudo systemctl status etcd

If the service is running, you should see output similar to the following:

● etcd.service - etcd key-value store
   Loaded: loaded (/etc/systemd/system/etcd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-09-01 15:04:47 UTC; 5s ago
     Docs: https://github.com/coreos/etcd
 Main PID: 1234 (etcd)
    Tasks: 18 (limit: 2350)
   Memory: 31.3M
   CGroup: /system.slice/etcd.service
           └─1234 /usr/local/bin/etcd

Congratulation! You have successfully installed and configured etcd on Debian Latest.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!