Search code examples
etcdcalico

etcd error when trying to start service rejected send message


I am using ubuntu 14.04 and Im configuring etcd for use with calico, but the service does not work.

This is my etcd.conf file:

# 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"

When I try to start:

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")

What could be the problem?


Solution

  • Try to run with sudo:

    sudo service etcd start   
    

    Then if you got error like:

    start: Job failed to start
    

    Rerun after add user etcd:

    sudo adduser etcd
    

    Update:

    If etcd instance can't start, check the following two things:

    1: your etcd start command is right, in your case, the etcd command can't run as you will get err msg like :

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

    so change your content in /etc/init/etcd.conf to :

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

    where your original config is :

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

    2: user etcd should have the permission to write to /var/lib/etcd