jaknap
October 28, 2020, 6:13am
1
Is there a way for inter ipfs cluster communication ?
hector
October 28, 2020, 12:24pm
2
Can you provide more details on what you want to do?
hector
October 28, 2020, 1:37pm
4
You can create a composite cluster. This is not a use-case we actively support/show, but for simple cases it should work.
The idea is that the cluster daemon offers an IPFS-proxy API. Thus, instead of having a cluster peer talk to an IPFS-daemon, you could actually point it to talk to an IPFS-cluster peer, that belongs to a different cluster.
When cluster1 pins something in that cluster peer, it will trigger a pin request. This request will be received by a cluster-peer in cluster2 (via the ipfs-proxy api), which will in turn trigger a pin request in that cluster.
Some links with documentation that might be helpful but has not been maintained:
+++
title = "Composite clusters"
+++
# Composite clusters
The `ipfs-cluster-service` process provides a Proxy-To-IPFS endpoint, which effectively allows a cluster peer to present itself as if it were an IPFS daemon. This allows to use a cluster peer (from a different cluster) instead of an IPFS daemon, giving origin to the *composite clusters* idea.
## The IPFS Proxy
The IPFS Proxy is an endpoint which presents the IPFS HTTP API in the following way:
* Some requests are intercepted and trigger cluster operations
* All non-intercepted requests are forwarded to the IPFS daemon attached to the cluster peer
This endpoint listens by default on `/ip4/127.0.0.1/tcp/9095` and is provided by the `ipfshttp` connector component.
The requests that are intercepted are the following:
This file has been truncated. show original
# Usecase: composite clusters
## Introduction
The idea of composite ipfs-clusters is based on the capacity of a cluster node to provide an ipfs-proxy endpoint in which HTTP requests are partially hijacked and used to trigger cluster operations or retrieve cluster information. This means that ipfs-clusters offers a partial IPFS API.
If this API were to be completely handled by cluster (at least for all the applicable endpoints in which cluster may play a part), we would find that an IPFS API endpoint could be instead an ipfs-cluster peer, and it could be used to control an ipfs-cluster.
Because each ipfs-cluster peer is attached to an IPFS daemon, using the IPFS HTTP API, composition can be achieved by associating cluster peers to cluster-ipfs-proxy-endpoints. Thus, when a cluster peers signals the ipfs daemon to pin an item, it would be instead pinning an item in an underlying cluster. When a cluster peer obtains avaiable repository space, it would be instead obtaining the aggregation of all available space in an underlying cluster.
## Definitions
* Overcluster: the cluster at the top of a cluster composition topology
* Undercluster(s): the clusters at the bottom of a cluster composition topology
* "Peer attached to a peer": A cluster peer that uses the ipfs-proxy-endpoint provided by another cluster daemon as its IPFS daemon address.
## Topologies
### 1. Each cluster peer attached to a peer from different underlying clusters (multi-ring clusters)
This file has been truncated. show original
jaknap
October 28, 2020, 1:50pm
5
Thanks a lot hector . I will go through the docs and try to implement it.
jaknap
October 30, 2020, 6:35pm
6
Hi Hector ,
I followed steps as explained by you to setup a composite cluster.
cluster 1 peer ------> cluster 3 peer .
I am getting below error :
|cluster3 | 2020-10-30T18:30:20.383Z|ERROR|ipfsproxy|error making request for header extraction to ipfs: dial tcp 127.0.0.1:5001: connect: connection refused|
|—|---|—|---|
|cluster3 | 2020-10-30T18:30:20.385Z|INFO|ipfsproxylog|192.168.48.9 - - [30/Oct/2020:18:30:20 +0000] “POST /api/v0/pin/ls?arg=QmdZgGrpCWUkiL6EWesfEtsTWtWwE3Rf3Dm4Uka4KgVNPo&type=recursive HTTP/1.1” 200 80|
Could you please point it out , what i am missing here ?
hector
November 2, 2020, 10:55am
7
Seems cluster3
cannot talk to a local IPFS daemon on 127.0.0.1:5001 ?