etcd icon indicating copy to clipboard operation
etcd copied to clipboard

etcdmain fails to start

Open ajaybhatnagar opened this issue 11 years ago • 11 comments

Followed steps defined on the link but startup fails with the errors below: Probably incorrect localhost address used in startup.

2015-11-16 20:09:52.579262 I | etcdmain: setting maximum number of CPUs to 4, total number of available CPUs is 4 2015-11-16 20:09:52.579278 W | etcdmain: no data-dir provided, using default data-dir ./default.etcd 2015-11-16 20:09:52.579478 C | etcdmain: listen tcp 27.0.0.1:2380: bind: cannot assign requested address

  • ./etcdctl set mykey 'this is awesome' Error: client: etcd cluster is unavailable or misconfigured error #0: dial tcp 127.0.0.1:4001: getsockopt: connection refused error #1: dial tcp 127.0.0.1:2379: getsockopt: connection refused

ajaybhatnagar avatar Nov 16 '15 20:11 ajaybhatnagar

@ajaybhatnagar What is 27.0.0.1:2380? Should't it be 127.0.0.1:2380?

xiang90 avatar Nov 16 '15 20:11 xiang90

correct, binary is using 27.0.0.1:2380.

ajaybhatnagar avatar Nov 16 '15 20:11 ajaybhatnagar

@ajaybhatnagar Can you share your command or script to start your etcd?

gyuho avatar Nov 16 '15 20:11 gyuho

Script is like below, just replace the version with latest stable version 2.2.1 cd /var/tmp curl -L https://github.com/coreos/etcd/releases/download/v2.1.2/etcd-v2.1.2-linux-amd64.tar.gz -o etcd-v2.1.2-linux-amd64.tar.gz tar xzvf etcd-v2.1.2-linux-amd64.tar.gz mv etcd-v2.1.2-linux-amd64 /usr/local cd /usr/local/etcd-v2.1.2-linux-amd64

./etcd ./etcdctl set mykey "this is awesome" ./etcdctl get mykey

ajaybhatnagar avatar Nov 16 '15 20:11 ajaybhatnagar

I cannot reproduce with 2.2.1. Did you run etcdctl first (before etcd)?

gyuho avatar Nov 16 '15 20:11 gyuho

Following these instructions at this link: It does not mention to run etcdctl first.

https://github.com/coreos/etcd/releases/

curl -L https://github.com/coreos/etcd/releases/download/v2.2.1/etcd-v2.2.1-linux-amd64.tar.gz -o etcd-v2.2.1-linux-amd64.tar.gz tar xzvf etcd-v2.2.1-linux-amd64.tar.gz cd etcd-v2.2.1-linux-amd64 ./etcd

Output is below: root@calico-00:/usr/local/etcd-v2.2.1-linux-amd64# uname -r 3.16.0-52-lowlatency root@calico-00:/usr/local/etcd-v2.2.1-linux-amd64# ./etcd 2015-11-16 20:40:33.344205 I | etcdmain: etcd Version: 2.2.1 2015-11-16 20:40:33.344261 I | etcdmain: Git SHA: 75f8282 2015-11-16 20:40:33.344273 I | etcdmain: Go Version: go1.5.1 2015-11-16 20:40:33.344282 I | etcdmain: Go OS/Arch: linux/amd64 2015-11-16 20:40:33.344296 I | etcdmain: setting maximum number of CPUs to 4, total number of available CPUs is 4 2015-11-16 20:40:33.344306 W | etcdmain: no data-dir provided, using default data-dir ./default.etcd 2015-11-16 20:40:33.344465 C | etcdmain: listen tcp 27.0.0.1:2380: bind: cannot assign requested address

ajaybhatnagar avatar Nov 16 '15 20:11 ajaybhatnagar

@ajaybhatnagar You should etcd first. Sorry if my comment made you confused. BTW are you still having this issue?

gyuho avatar Nov 16 '15 20:11 gyuho

yep

ajaybhatnagar avatar Nov 16 '15 20:11 ajaybhatnagar

Ignore the issue. Cause was /etc/hosts file with incorrect address. Thanks

ajaybhatnagar avatar Nov 16 '15 21:11 ajaybhatnagar

Ah that makes sense. Thanks,

gyuho avatar Nov 16 '15 21:11 gyuho

in my case ,i find can't ping 127.0.0.1 , so i run ifconfig lo up ,it works !

horizon365 avatar Oct 18 '17 06:10 horizon365