Open didasy opened 6 years ago
I'm also facing a similar error. I was using this docker-compose file, https://github.com/komuW/kshaka/blob/master/docker-compose.yml
Another common error is, leadership lost while committing log
On Dec 16, 2017 4:50 PM, "Andida Syahendar" notifications@github.com wrote:
I tried summitdb in docker swarm, I first create a master service:
docker service create --name summitdb-master --network redis didasy/summitdb
Then I created a slave service
docker service create --name summitdb-slave --network redis didasy/summitdb -join summitdb-master:7481
The slave service won't go live, and when I check the log in the container it says
1:M 16 Dec 13:50:08.292 SummitDB 0.4.0 1:N 16 Dec 13:50:08.303 Node at :7481 [Follower] entering Follower state (Leader: "") 1:N 16 Dec 13:50:08.305 # failed to join node at summitdb-master:7481: peer already known
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tidwall/summitdb/issues/23, or mute the thread https://github.com/notifications/unsubscribe-auth/AE7LURcJEBsyoYWyr4BaTHSExbJxhuKlks5tA8qmgaJpZM4REVyl .
Now I understand the error.
SummitDB by default uses "localhost:7481" if you do not supply -host
and -port
flags, these will be sent to finn.Open
which uses net.ResolveTCPAddress
which will lookup localhost
on the server, and in a Docker container, this will return :7481
No wonder the slaves will tell us "peer already known" because ":7481" is their own address and master will see the peer request from their own address.
I am still finding out how to get around this.
One such solution is probably uses ifconfig eth0 | grep "inet addr:" | cut -d : -f 2 | cut -d " " -f 1
to get the container's IP address as -host
argument, and set this up in Dockerfile.
I tried summitdb in docker swarm, I first create a master service:
Then I created a slave service
The slave service won't go live, and when I check the log in the container it says
And this is from the master