Closed quayilab closed 7 years ago
Hi @quayi,
Try this,
In terminal 1:
$ summitdb-server -p 7481 -dir data1
Then in terminal 2:
$ summitdb-server -p 7482 -dir data2 -join localhost:7481
... and the same process for other nodes.
Thank You @tidwall for the fast response. I tried the solution but still can't join the first. Here's the screenshot of what happening:
Fyi, I'm using Win10, Core i5, RAM 4gb in case You needed. Thank You.
The second screenshot shows X:\>
as the last line. Did the application quit automatically or did you close it?
No, it was the application. It quitted after it echoing those message.
This is a capture if I start the second server without ip addr on the -join
argument.
X:\>summitdb-server -p 7482 -dir data2 -join :7481
6160:M 18 Mar 20:46:30.341 [1m*[0m SummitDB 0.4.0
6160:N 18 Mar 20:46:30.397 [1m*[0m Node at :7482 [33m[Follower][0m entering Follower state (Leader: "")
6160:N 18 Mar 20:46:30.397 [33m#[0m failed to join node at :7481: dial tcp :7481: connectex: The requested address is not valid in its context.
But it also quitted after it prints the message. Here is the capture of first server:
X:\>summitdb-server -p 7481 -dir data1
5268:M 18 Mar 20:45:54.689 [1m*[0m SummitDB 0.4.0
5268:N 18 Mar 20:45:54.765 [1m*[0m Enable single node
5268:N 18 Mar 20:45:54.831 [1m*[0m Node at :7481 [33m[Follower][0m entering Follower state (Leader: "")
5268:N 18 Mar 20:45:56.667 [33m#[0m Heartbeat timeout from "" reached, starting election
5268:N 18 Mar 20:45:56.667 [1m*[0m Node at :7481 [36m[Candidate][0m entering Candidate state
5268:N 18 Mar 20:45:56.799 [1m*[0m Election won. Tally: 1
5268:N 18 Mar 20:45:56.799 [1m*[0m Node at :7481 [32m[Leader][0m entering Leader state
On this first server, there's nothing happened, like it didn't even know that the second server tried to join it.
I've never seen the connectex: The requested address is not valid in its context.
error before.
After some research it looks like this might be related to a this issue. I need to do some more investigating to make sure.
I just pushed an update to the master branch that hopefully fixes this issue.
Make sure to delete the data1
and data2
directories.
Terminal 1:
$ summitdb-server -p 7481 -dir data1
Terminal 2:
$ summitdb-server -p 7482 -dir data2 -join localhost:7481
Let me know if this works.
Hi @tidwall, your fix works great, here's a capture:
Thank You very much for taking time to solve the problem. I'll play around with the fix and I'll get back to You soon.
@quayi That's great to hear. You're welcome.
Hi, I found this project is really interesting. However when I'm trying to create a cluster of two summitdb server, first server was okay. But then when I started the second one to join the first I was unable to get it work:
Can someone point me out what might I've been doing wrong? Thank You.