Commit Graph

22 Commits

Author SHA1 Message Date
Hector Sanjuan
34fdc329fc Fix #24: Auto-join and auto-leave operations for Cluster
This is the third implementation attempt. This time, rather than
broadcasting PeerAdd/Join requests to the whole cluster, we use the
consensus log to broadcast new peers joining.

This makes it easier to recover from errors and to know who exactly
is member of a cluster and who is not. The consensus is, after all,
meant to agree on things, and the list of cluster peers is something
everyone has to agree on.

Raft itself uses a special log operation to maintain the peer set.

The tests are almost unchanged from the previous attempts so it should
be the same, except it doesn't seem possible to bootstrap a bunch of nodes
at the same time using different bootstrap nodes. It works when using
the same. I'm not sure this worked before either, but the code is
simpler than recursively contacting peers, and scales better for
larger clusters.

Nodes have to be careful about joining clusters while keeping the state
from a different cluster (disjoint logs). This may cause problems with
Raft.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-02-07 18:46:09 +01:00
Hector Sanjuan
6c18c02106 Issue #10: peers/add and peers/rm feature + tests
This commit adds PeerAdd() and PeerRemove() endpoints, CLI support,
tests. Peer management is a delicate issue because of how the consensus
works underneath and the places that need to track such peers.

When adding a peer the procedure is as follows:

* Try to open a connection to the new peer and abort if not reachable
* Broadcast a PeerManagerAddPeer operation which tells all cluster members
to add the new Peer. The Raft leader will add it to Raft's peerset and
the multiaddress will be saved in the ClusterPeers configuration key.
* If the above fails because some cluster node is not responding,
broadcast a PeerRemove() and try to undo any damage.
* If the broadcast succeeds, send our ClusterPeers to the new Peer along with
the local multiaddress we are using in the connection opened in the
first step (that is the multiaddress through which the other peer can reach us)
* The new peer updates its configuration with the new list and joins
the consensus

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-02-02 13:51:49 +01:00
Hector Sanjuan
77b8830419 Rename captain's log to CAPTAIN.LOG.md
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-27 15:33:45 +01:00
Hector Sanjuan
58a8a9f9ce Update catchline
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-27 13:35:28 +01:00
Hector Sanjuan
43dea68edb Update README, Captain log, fix logging.
Addresses some stuff in #19.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-27 13:30:15 +01:00
Hector Sanjuan
4c1e0068f5 Fix #15: Peers() provides lots of information now
I have renamed "members" to "peers".

Added IPFS daemon ID and addresses to the ID object and
have Peers() return the collection of ID() objects from the cluster.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-26 20:24:00 +01:00
Hector Sanjuan
af177bfde6 Address formatting, mispellings, lint errors from goreportcard
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-24 12:39:08 +01:00
Hector Sanjuan
24c8253c9e Fix config example
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-24 00:46:21 +01:00
Hector Sanjuan
afa8a5c33f Improve startup messages and information
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-23 23:58:04 +01:00
Hector Sanjuan
d987073201 Improve docs for the new configuration formats
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-23 20:56:35 +01:00
Hector Sanjuan
365c549d7c Fix #5: Rename apps to ipfs-cluster-service and ipfs-cluster-ctl
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-23 13:34:22 +01:00
Hector Sanjuan
2983544561 Fix #27: Add captain's log and ROADMAP
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-23 13:16:20 +01:00
Hector Sanjuan
b5bb6e9cc3 Readme: Fix "pin rm" example
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-17 19:29:52 +01:00
Hector Sanjuan
19c75fdbfe Expand ipfs-cluster-server usage section
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-15 16:18:22 +01:00
Hector Sanjuan
95e31ace87 Address small typos pointed out by @mateon1
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2017-01-15 16:06:47 +01:00
Hector Sanjuan
b92b598db1 ipfscluster tool. A CLI app wrapping the Cluster API.
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2016-12-22 17:14:15 +01:00
Hector Sanjuan
0746ccd11e ipfscluster-server
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2016-12-21 20:04:28 +01:00
Hector Sanjuan
744751b117 README badges
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2016-12-08 17:47:43 +01:00
Hector Sanjuan
e0840df267 WIP: basic functionality 2016-12-02 19:33:39 +01:00
Juan Benet
a5ad1fcf97 illustrations 2016-10-10 12:43:59 -04:00
Juan Benet
ea856b9fa8 Update README.md 2016-07-01 15:01:27 -04:00
Juan Benet
f9209592fd Initial commit 2016-07-01 14:41:15 -04:00