部署单节点etcd
1.下载并安装etcd
1 2 3 4 5 | ETCD_VERSION= '3.4.13' wget https: //github .com /etcd-io/etcd/releases/download/v ${ETCD_VERSION} /etcd-v ${ETCD_VERSION}-linux-amd64. tar .gz tar -xvf etcd- v ${ETCD_VERSION}-linux-amd64. tar .gz mv etcd- v ${ETCD_VERSION}-linux-amd64 /opt/etcd cp -a /opt/etcd/etcd /opt/etcd/etcdctl /usr/bin/ |
2.创建需要用到的目录
1 2 3 | mkdir -p /opt/etcd/data mkdir -p /var/lib/etcd/ mkdir -p /etc/etcd/config/ |
3.编写配置文件
1 2 3 4 5 6 7 8 9 10 11 12 | cat > /etc/etcd/config/etcd .conf <<EOF name: etcd data- dir : /opt/etcd/data listen-peer-urls: http: //127 .0.0.1:6677 listen-client-urls: http: //0 .0.0.0:7777 advertise-client-urls: http: //127 .0.0.1:7777 initial-advertise-peer-urls: http: //10 .1.1.7:2380 initial-cluster: etcd-1=http: //127 .0.0.1:2380 initial-cluster-token: etcd-cluster initial-cluster-state: new enable -grpc-gateway: true EOF |
4.编写服务文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | cat > /etc/systemd/system/etcd .service <<EOF [Unit] Description=Etcd Server Documentation=https: //github .com /coreos/etcd After=network.target [Service] User=root Type=notify ExecStart= /opt/etcd/etcd --config- file /etc/etcd/config/etcd .conf Restart=on-failure RestartSec=10s LimitNOFILE=40000 [Install] WantedBy=multi-user.target EOF |
5.配置开机自启并启动
1 2 3 | systemctl daemon-reload systemctl enable etcd systemctl restart etcd |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
2022-11-16 es修改mapping