They all are privately connected through the swarm.key and when I run the nodes they show the PEERID1 that they are connected too. I have added the address in the peerstore.
But still it is not able to retrieve the contents after pinning to PEERID1 and when the peer which have the actual file goes offline.
Sorry, can you explain again your setup? Is the node that has the content part of the cluster? I’m confused about what is running and what is not running when you pin.
I think you did things right wrt cluster. This looks like a problem with IPFS daemons not being connected.
What is ipfs swarm peers showing?
They are in a private network so they cannot rely on bootstrappers. You need to let them bootstrap to, for example, the ipfs daemon in peer one. Cluster attempts to connect ipfs daemons among peers, but this depends on what IPs they are reporting to have. Are peers on the same LAN? If not, you need to ensure that IPFS daemons are connected among themselves too.
As a small node, I would re-use the same peerstore file for all 3 cluster peers, containing all 3 addresses. You want Peer2 and Peer3 to be connected too to each other.
PEER1 and PEER2 are not on same LAN so as you mentioned I connected them through swarm connect.
Then I was able to pin the file on the PEER1. I could see the status as pinned.
I don’t want to connect any other nodes in the cluster.
The model looks like many to one (n-1 nodes in the cluster which are all connected to the 1 remaining node in the cluster).
When I did from PEER2
ipfs-cluster-ctl pin add --wait <file CID/hash>
The file cid was pinned on the PEER1. I could see the status as PINNED
But when I do
ipfs-cluster-ctl pin add --wait --replication 1 --allocations <file CID/hash>
The status shows as REMOTE.
Not sure on how to pin a cid on to a particular node/peer.
What is the value to be used for --allocations flag ? Is it the ipfs id? or ipfs-cluster-ctl id?
And is it sufficient if we give the id itself of the whole address like /ip4//tcp/9096/p2p/
Note if your replication factor is 1, and you already pinned in 1 peer, I think it won’t pin it somewhere else because the replication factor is satisfied. The allocations flag is a priority list of where things should be pinned, but it does not need to make that decision since things are already pinned. So if you want to move the pin from one allocation to other the best way is to unpin and then pin again.
Yes. I think that was the problem, as the replication value is satisfied it wasn’t pinning. So, I changed the replication flag value to 2 and gave one allocation value (PEER 1) and then it pinned. Showing the two peerid values in the allocation.
The hashes that we pin on to the cluster node are shown in ipfs pin ls.
How do we add the file paths in such a way when we do ipfs files ls on the node shows the paths added by the other nodes.
I used ipfs-cluster-ctl add filename.txt
The above command seems to work same as ipfs add as they don’t show on ipfs files ls until and unless explicitly we run ipfs cp hash /filename.txt
So, doing cluster-ctl add command doesn’t show the file paths in ipfs files ls in the node that we are trying to add too.
Is there any way on how we can add file paths when we pin the hashes from local to remote node in the cluster?
ipfs-cluster-ctl add doesn’t show up file names in remote machine when we type ipfs files ls. and I didn’t find any ipfs-cluster-clt cp command so that the hash can be assigned to path and can be listed in ipfs files ls.