Search code examples
etcd

etcd unknown job when start service


I have the next etcd.conf, and if I try to start the etcd service with the next command, it throws the next:

ubuntu$ service etcd start

start: Unknown job: etcd

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="client1"\
--advertise-client-urls="http://172.16.8.244:2379,http://172.16.8.244: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.244:2380"\
--initial-cluster-token $(uuidgen)\
--initial-cluster "cient2=http://172.16.8.244:2380"\
--initial-cluster-state "new"

Solution

  • The error message has nothing to do with etcd, but caused by upstart script.
    When got message like start: Unknown job, there must be something wrong in upstart script. In your case:

    --listen-client-urls="http://0.0.0.0:2379,http://0.0.0.0:4001"
    --listen-peer-urls "http://0.0.0.0:2380"\
    

    I think what you want is (miss the character '\' at the end of first line):

    --listen-client-urls="http://0.0.0.0:2379,http://0.0.0.0:4001"\
    --listen-peer-urls "http://0.0.0.0:2380"\
    

    You can try it again after you correct this.