Code Monkey home page Code Monkey logo

Comments (4)

dreameryan avatar dreameryan commented on July 24, 2024

BTW, when I run client.machines. It will output
machines [u'http://localhost:2379', u'http://localhost:2379', u'http://localhost:4001', u'http://localhost:4001']
Seems it still find cluster machines from localhost.

from python-etcd.

durzo avatar durzo commented on July 24, 2024

This seems to be a cluster config issue. I have seen what you are experiencing before with a misconfigured cluster. Try re-creating the cluster being sure to specify the peer and client listen addresses as network reachable addresses (not localhost)

I have python-etcd from master branch working with etcd-v2.0.9 just fine:

durzo@test:~/etcd-v2.0.9-linux-amd64$ ./etcd
2015/04/08 22:22:41 etcd: no data-dir provided, using default data-dir ./default.etcd
2015/04/08 22:22:41 etcd: listening for peers on http://localhost:2380
2015/04/08 22:22:41 etcd: listening for peers on http://localhost:7001
2015/04/08 22:22:41 etcd: listening for client requests on http://localhost:2379
2015/04/08 22:22:41 etcd: listening for client requests on http://localhost:4001

durzo@test:~$ cat etcd-2.0.9.py
#!/usr/bin/python
import etcd

client = etcd.Client(host='127.0.0.1', port=4001, protocol='http', allow_redirect=True, read_timeout=None)
print "Write: %s" % client.write('/test', "testing")
print "Read: %s" % client.read('/test').value

durzo@test:~$ ./etcd-2.0.9.py
Write: <class 'etcd.EtcdResult'>({'newKey': True, 'raft_index': 76, '_children': [], 'createdIndex': 3, 'modifiedIndex': 3, 'value': u'testing', 'etcd_index': 3, 'expiration': None, 'key': u'/test', 'ttl': None, 'action': u'set', 'dir': False})
Read: testing

from python-etcd.

dreameryan avatar dreameryan commented on July 24, 2024

@durzo
Hi, do you know how to config a etcd cluster?

I follow the etcd instruction ,and run following command on each machine, but it doesn't work:
/home/idcuser/HATest/etcd-v2.0.9-linux-amd64/etcd -name monitorserver1 -listen-peer-urls http://10.120.73.86:7001 -listen-client-urls http://10.120.73.86:4001 -initial-cluster-token monitorserver-cluster -initial-advertise-peer-urls http://10.120.73.86:7001 -initial-cluster monitorserver1=http://10.120.73.86:7001,monitorserve2=http://10.112.206.10:2380 -initial-cluster-state new &>> /home/idcuser/HATest/etcd.log &

/home/idcuser/HATest/etcd-v2.0.9-linux-amd64/etcd -name monitorserver2 -listen-peer-urls http://10.112.206.10:2380 -listen-client-urls http://10.112.206.10:2379 -initial-cluster-token monitorserver-cluster -initial-advertise-peer-urls http://10.112.206.10:2380 -initial-cluster monitorserver1=http://10.120.73.86:7001,monitorserver2=http://10.112.206.10:2380 -initial-cluster-state new &>> /home/idcuser/HATest/etcd.log &

from python-etcd.

lavagetto avatar lavagetto commented on July 24, 2024

seems like a config issue

from python-etcd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.