首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Ubuntu etcd.service启动失败(代码= exited,status=1/FAILURE)

Ubuntu etcd.service启动失败(代码= exited,status=1/FAILURE)
EN

Stack Overflow用户
提问于 2022-06-19 04:06:30
回答 1查看 1.2K关注 0票数 3

当我编写了我的etcd.service文件并使用systemctl start etcd.service命令运行时,它会产生以下错误:

代码语言:javascript
运行
复制
etcd.service - ve489 etcd service
     Loaded: loaded (/lib/systemd/system/etcd.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2022-06-18 20:59:50 PDT; 3s ago
       Docs: https://github.com/etcd-io/etcd
    Process: 13415 ExecStart=/usr/local/bin/etcd --name ubuntu20 --data-dir /var/lib/etcd --initial-advertise-peer-urls http://192.168.159.128:2380 --listen-peer-urls http://192.168.159.128:2380 --listen-client-urls http://192.168.159.128:2379,http://127.0.0.1:2379 --advertise-client-urls http://192.168.159.128:2379 --initial-cluster-token etcd-cluster-1 --initial-cluster etcd-1=http://192.168.159.128:2380,etcd-2=http://192.168.159.129:2380 --initial-cluster-state new --heartbeat-interval 1000 --election-timeout 5000 (code=exited, status=1/FAILURE)
   Main PID: 13415 (code=exited, status=1/FAILURE)

文件etcd.service中的源代码是

代码语言:javascript
运行
复制
[Unit]
Description=ve489 etcd service
Documentation=https://github.com/etcd-io/etcd
 
[Service]
User=root
Type=notify
ExecStart=/usr/local/bin/etcd \
 --name ubuntu20 \
 --data-dir /var/lib/etcd \
 --initial-advertise-peer-urls http://192.168.159.128:2380 \
 --listen-peer-urls http://192.168.159.128:2380 \
 --listen-client-urls http://192.168.159.128:2379,http://127.0.0.1:2379 \
 --advertise-client-urls http://192.168.159.128:2379 \
 --initial-cluster-token etcd-cluster-1 \
 --initial-cluster etcd-1=http://192.168.159.128:2380,etcd-2=http://192.168.159.129:2380 \
 --initial-cluster-state new \
 --heartbeat-interval 1000 \
 --election-timeout 5000
Restart=on-failure
RestartSec=5
 
[Install]
WantedBy=multi-user.target

journalctl -xe命令给出如下内容:

代码语言:javascript
运行
复制
Jun 18 21:03:57 ubuntu systemd[1]: etcd.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit etcd.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
Jun 18 21:03:57 ubuntu systemd[1]: etcd.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit etcd.service has entered the 'failed' state with result 'exit-code'.
Jun 18 21:03:57 ubuntu systemd[1]: Failed to start ve489 etcd service.
-- Subject: A start job for unit etcd.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit etcd.service has finished with a failure.
-- 
-- The job identifier is 38547 and the job result is failed.

我是个新来和etcd联系的人,所以我不知道出了什么问题,有人能帮我解决这个问题吗?

EN

Stack Overflow用户

发布于 2022-11-02 01:49:05

我也有同样的问题。这是我的解决方案。

首站etcd服务

代码语言:javascript
运行
复制
systemctl start etcd.service

然后,检查端口被占用。

代码语言:javascript
运行
复制
lsof -i:2380

如果被占用,则关闭pid

代码语言:javascript
运行
复制
kill -9 xxx

最后,启动etcd服务。

代码语言:javascript
运行
复制
systemctl start etcd.service
票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72674204

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档