Add initial instructions for joining the IPFS cluster

Refs #4
This commit is contained in:
Greg Karékinian 2019-04-30 17:18:43 +02:00
parent c6c997fcd1
commit 21987c502e

66
doc/ipfs_cluster.md Normal file
View File

@ -0,0 +1,66 @@
# Join the IPFS cluster
## On your local machine
Get the `encrypted_data_bag_secret` from another core member and copy it to
`.chef/encrypted_data_bag_secret`. It is required to decrypt the infrastructure
secrets. The cluster secret can be used to remove peers and pins, so we cannot make it public.
From a clone of repository:
```
$ ./script/bootstrap # Requires Ruby
$ ./bin/knife solo data bag show credentials ipfs_cluster --secret-file .chef/encrypted_data_bag_secret
WARNING: The encrypted_data_bag_secret option defined in knife.rb was overriden by the command line.
id: ipfs_cluster
secret: *SECRET*
```
## On your server
Install the latest version of go-ipfs, as well as ipfs-cluster-ctl and
ipfs-cluster-service 0.10.1 from https://dist.ipfs.io/
ipfs-cluster-ctl and ipfs-cluster-service must be the same version as the rest
of the cluster.
For basic usage of IPFS, see [the docs](https://docs.ipfs.io/introduction/usage/)
You need to open port 9096 from the outside using your firewall for the cluster
Join the cluster through a known host (andromeda):
```
ipfs@your_server:~$ CLUSTER_SECRET=*SECRET* ipfs-cluster-service daemon --bootstrap "/ip4/46.4.18.160/tcp/9096/ipfs/QmNVfAhxJrmkqkCHdoD6iZgJJaWkhehskeWWZ9cNZxNwo1"
```
If joining was successful, you should see your server in the list of peers of
the cluster, and each peer should see the same number of peers. Here's an
example of the current peers:
```
ipfs@andromeda:~$ ipfs-cluster-ctl peers ls
QmNVfAhxJrmkqkCHdoD6iZgJJaWkhehskeWWZ9cNZxNwo1 | andromeda.kosmos.org | Sees 1 other peers
> Addresses:
- /ip4/127.0.0.1/tcp/9096/ipfs/QmNVfAhxJrmkqkCHdoD6iZgJJaWkhehskeWWZ9cNZxNwo1
- /ip4/46.4.18.160/tcp/9096/ipfs/QmNVfAhxJrmkqkCHdoD6iZgJJaWkhehskeWWZ9cNZxNwo1
- /p2p-circuit/ipfs/QmNVfAhxJrmkqkCHdoD6iZgJJaWkhehskeWWZ9cNZxNwo1
> IPFS: QmZ4Lpzhz8bafbTYvEMMCmrbrMM4JfyHDR23WbCSAd9bo7
- /ip4/127.0.0.1/tcp/4001/ipfs/QmZ4Lpzhz8bafbTYvEMMCmrbrMM4JfyHDR23WbCSAd9bo7
- /ip4/46.4.18.160/tcp/4001/ipfs/QmZ4Lpzhz8bafbTYvEMMCmrbrMM4JfyHDR23WbCSAd9bo7
- /ip6/2a01:4f8:221:39c1::2/tcp/4001/ipfs/QmZ4Lpzhz8bafbTYvEMMCmrbrMM4JfyHDR23WbCSAd9bo7
- /ip6/::1/tcp/4001/ipfs/QmZ4Lpzhz8bafbTYvEMMCmrbrMM4JfyHDR23WbCSAd9bo7
QmTVC6eguRWoS2W18QnPHt64h8t5yQmYRhvoZcdgr4Ax2V | dev | Sees 1 other peers
> Addresses:
- /ip4/127.0.0.1/tcp/9096/ipfs/QmTVC6eguRWoS2W18QnPHt64h8t5yQmYRhvoZcdgr4Ax2V
- /ip4/144.76.39.171/tcp/9096/ipfs/QmTVC6eguRWoS2W18QnPHt64h8t5yQmYRhvoZcdgr4Ax2V
- /p2p-circuit/ipfs/QmTVC6eguRWoS2W18QnPHt64h8t5yQmYRhvoZcdgr4Ax2V
> IPFS: QmWY7vNysM1jgHFBuSr9Y2ayG5tUeKmGBjwjN9x6pEVxRb
- /ip4/127.0.0.1/tcp/4001/ipfs/QmWY7vNysM1jgHFBuSr9Y2ayG5tUeKmGBjwjN9x6pEVxRb
- /ip4/144.76.39.171/tcp/4001/ipfs/QmWY7vNysM1jgHFBuSr9Y2ayG5tUeKmGBjwjN9x6pEVxRb
- /ip6/2a01:4f8:191:40aa::2/tcp/4001/ipfs/QmWY7vNysM1jgHFBuSr9Y2ayG5tUeKmGBjwjN9x6pEVxRb
- /ip6/::1/tcp/4001/ipfs/QmWY7vNysM1jgHFBuSr9Y2ayG5tUeKmGBjwjN9x6pEVxRb
```
You can now stop the daemon process (ctrl+c) and start it using the service of your choice
(probably Systemd)