We have a number of automations to facilitate configuring and deploying IPFS Clusters:
Ansible roles for configuring and deploying
go-ipfs (including templated configuration files) are available at https://github.com/hsanjuan/ansible-ipfs-cluster.
If you want to run one of the
/ipfs/ipfs-cluster Docker containers, it is important to know that:
- The container does not run
go-ipfsand you should run the IPFS daemon separately, for example, using the
ipfs/go-ipfsDocker container. The
ipfs_connector/ipfshttp/node_multiaddressconfiguration value will need to be adjusted accordingly to be able to reach the IPFS API. This path supports DNS addresses (
/dns4/ipfs1/tcp/5001) and is set from the
CLUSTER_IPFSHTTP_NODEMULTIADDRESSenvironment variable when starting the container and no previous configuration exists.
- By default, we use the
/data/ipfs-clusteras the IPFS Cluster configuration path. We recommend mounting this folder as means to provide custom configurations and/or data persistency for your peers. This is usually achieved by passing
The container (Dockerfile here runs an
entrypoint.sh script which initializes IPFS Cluster when no configuration is present. The configuration values can be controlled by setting environment variables as explained in the configuration reference.
crdt consensus is used to initialize the configuration. This can be overridden by setting
badger is used as the default backend, and can be overridden setting
--net=host, you will need to set
$CLUSTER_IPFSHTTP_NODEMULTIADDRESSor make sure the configuration has the correct
--net=host, the REST API endpoint will only listen locally inside the container. You may need to set
/ip4/0.0.0.0/tcp/9096if you wish to access this endpoint from outside the container, along with the necessary port forwarding (
We also provide an example
docker-compose.yml that is able to launch an IPFS Cluster with two Cluster peers and two IPFS daemons running.
During the first launch, configurations are automatically generated and will be persisted for next launches in the
./compose folder, along with the
ipfs ones. Delete this folder to reset the Docker Compose setup.
Only the IPFS swarm port (tcp
4101) and the IPFS Cluster API ports (tcp
9194) are exposed out of the containers.
This compose file is provided as an example on how to set up a multi-peer Cluster using Docker containers. You may need to adapt it for your own needs.