2020-10-21

How to install ETCD from source code

1/ OS environment:
root@srv111:/# uname -a
Linux srv111 4.15.0-118-generic #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

root@srv111:/# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
root@srv111:/# 



2/ Config Host file:
#HOST FILE:
chattr -i -f /etc/hosts
cp -vR /etc/hosts /etc/hosts-
#{
cat <<EOF > /etc/hosts
#!/bin/bash
127.0.0.1 localhost
10.0.2.111 srv111
10.0.2.112 srv112
10.0.2.113 srv113
#
10.0.2.111 etcd1.mgiay.local etcd1
10.0.2.112 etcd2.mgiay.local etcd2
10.0.2.113 etcd3.mgiay.local etcd3
#THE-END
EOF
cat /etc/hosts
chattr +i -f /etc/hosts
#}
#


3/ Install ETCD from sourcecode:
cd /opt/setup/
time (curl -s https://api.github.com/repos/etcd-io/etcd/releases/latest \
|grep browser_download_url \
|grep linux-amd64 \
|cut -d '"' -f 4 \
|wget -qi -)
#
cd /opt/setup/;
tar -xf etcd*;
cd etcd-v3.3.25-linux-amd64;
cp -vR etcd* /usr/sbin/;
source /etc/profile;
etcd -version; etcdctl -version;


4/ Check result:
root@srv111:/# date;etcd -version; 
Wed Oct 21 17:34:17 +07 2020
etcd Version: 3.3.25
Git SHA: 2c834459e
Go Version: go1.12.17
Go OS/Arch: linux/amd64
root@srv111:/# 

root@srv111:/# date; etcdctl -version;
Wed Oct 21 17:34:23 +07 2020
etcdctl version: 3.3.25
API version: 2
root@srv111:/# 


No comments:

Post a Comment