单机安装
- 官网:https://github.com/etcd-io/etcd/tags
- 选择最新版进去,点进去 找到linux版本下载
-
解压并查看是否安装成功
tar -zxvf /data/etcd/etcd-3.5.15.tar.gz -C /data/etcd/etcd-v3.5.15 #查看安装是否成功的相关命令 /data/etcd/etcd-v3.5.15/etcd --version /data/etcd/etcd-v3.5.15/etcdctl version /data/etcd/etcd-v3.5.15/etcdutl version
-
添加环境变量
vim /etc/profile ------------------------------------ export ETCD_HOME=/data/etcd/etcd-v3.5.15 export PATH=.:$ETCD_HOME:$PATH ————————————————---------------- source /etc/profile
-
后台启动etcd
-
chmod 777 /data/etcd/etcd-v3.5.15/etcd /data/etcd/etcd-v3.5.15/etcd &
-
测试etcd写入
etcdctl --endpoints=localhost:2379 put foo bar etcdctl --endpoints=localhost:2379 get foo
-
-
或者直接使用github提供的命令 – Linux # 能访问外网
-
# 创建安装脚本 vim etcd 写入如下内容 ETCD_VER=v3.5.15 # 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}-linux-amd64.tar.gz rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test curl -L ${DOWNLOAD_URL}/${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-download-test --strip-components=1 rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz /tmp/etcd-download-test/etcd --version /tmp/etcd-download-test/etcdctl version /tmp/etcd-download-test/etcdutl version
-
启动本地etcd
# start a local etcd server /tmp/etcd-download-test/etcd # write,read to etcd /tmp/etcd-download-test/etcdctl --endpoints=localhost:2379 put foo bar /tmp/etcd-download-test/etcdctl --endpoints=localhost:2379 get foo
-
-
查看启动状态 :etcdctl member list
-
卸载只需要删除对应文件和目录