【问题标题】:etcd error when trying to start service rejected send message尝试启动服务时出现 etcd 错误拒绝发送消息
【发布时间】:2016-11-08 10:28:58
【问题描述】:

我正在使用 ubuntu 14.04 并且我正在配置 etcd 以与 calico 一起使用,但该服务不起作用。

这是我的 etcd.conf 文件:

# vim:set ft=upstart ts=2 et:
description "etcd"
author "etcd maintainers"

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn

setuid etcd

env ETCD_DATA_DIR=/var/lib/etcd
export ETCD_DATA_DIR

exec /usr/bin/etcd --name="uno" \
--advertise-client-urls="http://172.16.8.241:2379,http://172.16.8.241:4001" \
--listen-client-urls="http://0.0.0.0:2379,http://0.0.0.0:4001" \
--listen-peer-urls "http://0.0.0.0:2380" \
--initial-advertise-peer-urls "http://172.16.8.241:2380" \
--initial-cluster-token $(uuidgen) \
--initial-cluster "node1=http://172.16.8.241:2380" \
--initial-cluster-state "new"

当我尝试开始时:

ikerlan@uno:~$ service etcd start

start: Rejected send message, 1 matched rules; type="method_call", sender=":1.128" (uid=1000 pid=7374 comm="start etcd ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")

可能是什么问题?

【问题讨论】:

    标签: etcd calico project-calico


    【解决方案1】:

    尝试使用sudo运行:

    sudo service etcd start   
    

    如果你遇到如下错误:

    start: Job failed to start
    

    添加用户etcd后重新运行:

    sudo adduser etcd
    

    更新:

    如果etcd实例无法启动,检查以下两点:

    1:您的 etcd 启动命令是正确的,在您的情况下,etcd 命令无法运行,因为您将收到 err msg 如下:

    etcd: couldn't find local name "uno" in the initial cluster configuration
    

    所以将/etc/init/etcd.conf 中的内容更改为:

    --initial-cluster "uno=http://172.16.8.241:2380" \
    

    您的原始配置在哪里:

    --initial-cluster "node1=http://172.16.8.241:2380" \
    

    2:用户etcd应该有写/var/lib/etcd的权限

    【讨论】:

    • 我可以开始使用 sudo,但并没有真正开始,因为如果我运行“sudo service etcd stop”,它会抛出“stop:unknown instance”,或者如果我重新启动 etcd,它可以' t 停止。
    • 检查目录'/var/lib/etcd'是否存在,二进制文件'/usr/bin/etcd'是否存在?
    • 是的,它们存在,有/usr/bin/etcd和/usr/bin/etcdctl,还有var/lib/etcd。
    • 用户'etcd'也存在?
    • @Asier 已更新,您可以再试一次,我认为它会起作用 :)
    【解决方案2】:

    Etcd 标志“name”和“initial-cluster”必须匹配在一起。

    ....
        --name="keukenhof" \
        --initial-cluster="keukenhof=http://localhost:2380"
    ....
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-05
      • 2021-01-30
      • 2018-05-12
      • 1970-01-01
      • 2020-12-05
      • 2010-12-21
      • 1970-01-01
      • 2018-11-19
      相关资源
      最近更新 更多