-
Notifications
You must be signed in to change notification settings - Fork 70
Consensus Protocol Implement method? #118
Comments
Hi @Peipeilvcm , Start indexer1: $ ./bin/blast indexer start \
--grpc-address=:5000 \
--grpc-gateway-address=:6000 \
--http-address=:8000 \
--node-id=indexer1 \
--node-address=:2000 \
--data-dir=/tmp/blast/indexer1 \
--raft-storage-type=boltdb \
--index-mapping-file=./example/wiki_index_mapping.json \
--index-type=upside_down \
--index-storage-type=boltdb Start indexer2: $ ./bin/blast indexer start \
--peer-grpc-address=:5000 \
--grpc-address=:5010 \
--grpc-gateway-address=:6010 \
--http-address=:8010 \
--node-id=indexer2 \
--node-address=:2010 \
--data-dir=/tmp/blast/indexer2 \
--raft-storage-type=boltdb Start indexer3:
You can see cluster info as following:
Stop indexer1, the leader, and check the cluster information using the following command:
You can see one of the followers has become a leader ( Restart indexer1 as follower: $ ./bin/blast indexer start \
--peer-grpc-address=:5010 \
--grpc-address=:5000 \
--grpc-gateway-address=:6000 \
--http-address=:8000 \
--node-id=indexer1 \
--node-address=:2000 \
--data-dir=/tmp/blast/indexer1 \
--raft-storage-type=boltdb Then, check the cluster information using the following command:
You can see indexer1 has become a follower ( |
start cluster as followings:
kill indexer1:
Indexing a document to indexer2 by curl
The document can be got from indexer2 & indexer3
indexing a document to indexer3 by curl
It works well, indexer2 & indexer3 can be both writen. Thanks. |
@mosuka no reply? |
Hi @Peipeilvcm ,
It may take some time to elect a leader. |
I added a |
Thanks for your replying. But there is an issue as following: @mosuka , can indexing happen on follower nodes? In my operations above, I can index a document enwiki_2(or maybe enwiki_1) on follower node by curl. |
In Blast, update requests received by followers are forwarded to the leader once. The followers do not update the data directly. |
I know from Readme, the cluster is built based on Raft consensus algorithm.
But when I try to use the cluster mode, when I kill the leader node, re-election didn't happened.
Does Blast support leader re-election?
And for consensus, The write operation(indexing, PUT) should only happen on Leader node. I use http indexing request to follower node when leader has been killed, it still works well, so I am a little confused. Can write operation work on followers?
If write operation can work on followers, when different write operations happen at the same time to different nodes, consensus and sequence may not be guaranteed
The text was updated successfully, but these errors were encountered: