ETCD_NAME=default
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://192.168.33.10:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.33.10:2379,http://127.0.0.1:2379"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.33.10:2380"
ETCD_INITIAL_CLUSTER="infra0=http://192.168.33.10:2380,infra1=http://192.168.33.9:2380"
ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-1"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.33.10:2380"
I setup my /etc/etcd/etcd.conf file as suggested in https://github.com/coreos/etcd/blob/master/Documentation/clustering.md
. I can curl to it just fine, but etcdctl gives me a 404 error.
[root@localhost vagrant]# etcdctl get /foo/bar
Error: invalid character 'p' after top-level value
Any ideas?
@PeterLamar etcdctl by default will reach your localhost:4001 or 2379. I think you might have other server serving on that addr(4001).
Its a clean Fedora 22 image, with this being the first thing installed. I don't think anything is running on 4001, but happy to try any commands you suggest.
Try etcdctl --debug get /foo/bar, which tells you the details about its operations.
@PeterLamar I am closing this due to low activity. Report back if you can reproduce this and provide more detail information. Thanks!
In my case when I received this error, I had typoed my configuration in such a way that the etcd was advertising its client URL as its peer URL. Changing the advertised client URL to the correct port fixed the issue.
Thanks @alindeman Your method fixed my problem. :-)
cat << EOF > $tmpdir/etcd.service
[Unit]
Description=Etcd Server
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
ExecStart=/usr/bin/etcd \
--name=$etcd_name \
--data-dir=/var/lib/etcd/default.etcd \
--listen-peer-urls=https://$ip:2380 \
--listen-client-urls=https://$ip:2379,http://127.0.0.1:2379 \
--advertise-client-urls=https://$ip:2379 \
--initial-advertise-peer-urls=https://$ip:2380 \
--initial-cluster=etcd01=https://$MASTER_IP:2380,etcd02=https://$NODE1_IP:2380,etcd03=https://$NODE2_IP:2380,etcd04=https://$NODE3_IP:2380 \
--initial-cluster-token=etcd-cluster \
--initial-cluster-state=new \
--cert-file=$ETCD_CERT_DIR/server.pem \
--key-file=$ETCD_CERT_DIR/server-key.pem \
--peer-cert-file=$ETCD_CERT_DIR/server.pem \
--peer-key-file=$ETCD_CERT_DIR/server-key.pem \
--trusted-ca-file=$ETCD_CERT_DIR/ca.pem \
--peer-trusted-ca-file=$ETCD_CERT_DIR/ca.pem
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
EOF
be carefull of advertise-client-urls 琚潙鍝暒
Most helpful comment
In my case when I received this error, I had typoed my configuration in such a way that the etcd was advertising its client URL as its peer URL. Changing the advertised client URL to the correct port fixed the issue.