Error tried all peers unsuccessfully in docker compose

53 views
Skip to first unread message

Phuc Truong

unread,
Feb 18, 2021, 6:50:04 AM2/18/21
to rqlite
Hi, I am using rqlite by docker compose like this:

  rqlite:
    image: rqlite/rqlite:latest
    container_name: rqlite
    ports:
      - 4001:4001
      - 4002:4002
    restart: always
    logging:
      driver: "json-file"
      options:
        max-file: "10"
        max-size: 20m
    healthcheck:
      test: ["CMD", "curl", "http://localhost:4001/status"] 

In the client, I used connection url like: http://rqlite:4001       
The connection is ok, but when I make a request, it returns: "tried all peers unsuccessfully. here are the results: peer #0: http://0.0.0.0:4001/status failed due to Get "http://0.0.0.0:4001/status": dial tcp 0.0.0.0:4001: connect: connection refused"

So what is the problem here?

Many thanks!

Philip O'Toole

unread,
Feb 18, 2021, 9:04:00 AM2/18/21
to rql...@googlegroups.com
Thanks for your report, this mailing list is a good place to ask this question. I did comment on the issue:


--
You received this message because you are subscribed to the Google Groups "rqlite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rqlite+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rqlite/2f0b2b28-f594-4457-ac40-49947b4c3831n%40googlegroups.com.

techyugadi

unread,
Feb 18, 2021, 1:25:07 PM2/18/21
to rqlite
You may be trying to connect to the docker container running rqlite from outside the docker network. Secondly, the master and slave instances of rqlite should be instantiated in a proper sequence. Kubernetes statefulsets (which can use docker containers underneath) can be one way of creating a cluster in a more reliable way. You could find one such implementation here: https://github.com/techyugadi/kubestash/tree/master/stateful/rqlite
Reply all
Reply to author
Forward
0 new messages