往期精选(欢迎转发~~)
我看别人的公众号,首页都贴个图片,以后我也贴一张,是不是好看一些
3.1 ETCD安装
3.1.1 直接安装
以MAC系统为例,讲述2种按照方法,第一种很简单,是Mac自带的:
#用brew安装非常方便,没安装的自行安装Homebrew,通过下面命令可以查看安装包
brew search etcd
#安装
brew install etcd
#查看版本
etcd --version
#启动,如果没有--enable-v2=true,就不用使用v2的接口
etcd --enable-v2=true
不过这种方式可能会安装失败,我这把失败时提示日志目前没有权限,根据提示执行相关命令即可,我这边的提示如下:
sudo chown -R $(whoami) /usr/local/var/log
3.1.2 源码安装
我个人更推荐下面这种安装方式:
ETCD_VER=v3.4.14
# choose either URL
GOOGLE_URL=https://storage.googleapis.com/etcd
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download
DOWNLOAD_URL=${GOOGLE_URL}
rm -f /tmp/etcd-${ETCD_VER}-darwin-amd64.zip
rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test
curl -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-darwin-amd64.zip -o /tmp/etcd-${ETCD_VER}-darwin-amd64.zip
unzip /tmp/etcd-${ETCD_VER}-darwin-amd64.zip -d /tmp && rm -f /tmp/etcd-${ETCD_VER}-darwin-amd64.zip
mv /tmp/etcd-${ETCD_VER}-darwin-amd64/* /tmp/etcd-download-test && rm -rf mv /tmp/etcd-${ETCD_VER}-darwin-amd64
#输出etcd版本
/tmp/etcd-download-test/etcd --version
/tmp/etcd-download-test/etcdctl version
#这里是把etcd和etcdctl copy到bin目录下面
cp /tmp/etcd-download-test/etcd /usr/local/bin
cp /tmp/etcd-download-test/etcdctl /usr/local/bin
然后执行:
#安装etcd
s