When executing the following command: #ipfs-cluster-ctl peers ls
An error occurred:
Code: 0
Message: Get “http://127.0.0.1:9094/peers”: dial tcp 127.0.0.1:9094: connect: connection refused
Why?How to solve it?
Thank!
Per your logs, your API is not listening on the local interface 127.0.0.1 (you must have overwritten the default listen multiaddress in the configuration).
Try ipfs-cluster-ctl --host /ip4/192.168.67.204/tcp/9094 peers ls instead.
I now have a cluster of three nodes. I did a test to add a file to a node and pin to all nodes. My steps are as follows:
# ipfs add hello-isos.txt
added QmSH7NYxNYhBKkbedSKoKh84NvBMAKznyo8MPtUe1jZZ3x hello-isos.txt
18 B / 18 B [=========================================================] 100.00%root@isosipfs1:~/test# ipfs-cluster-ctl pin add QmSH7NYxNYhBKkbedSKoKh84NvBMAKznyo8MPtUe1jZZ3x
QmSH7NYxNYhBKkbedSKoKh84NvBMAKznyo8MPtUe1jZZ3x:
> isosipfs1 : PINNED | 2020-10-08T09:38:59.647384655Z
> isosipfs2 : PINNED | 2020-10-08T09:38:59.647014951Z
> isosipfs3 : PINNED | 2020-10-08T09:38:59.643731679Z
root@isosipfs1:~/test# ipfs pin ls QmSH7NYxNYhBKkbedSKoKh84NvBMAKznyo8MPtUe1jZZ3x
QmSH7NYxNYhBKkbedSKoKh84NvBMAKznyo8MPtUe1jZZ3x recursive
I have two questions
So where is the file stored on each node?
If I delete this file in one node, is the file still stored in the other two nodes? What should I do to verify it?
If you manually unpin it on IPFS and run ipfs repo gc on one node, then IPFS cluster will detect that it is not pinned anymore and retrigger the pin operation.
If one is added to node A, should this file also be stored on the other two nodes? If it is, then I add A file to node A, and Then I delete that file on node A, then there will still be that file in the other two nodes, right?
What commands can I verify?
I executed the following command on node A:
#ipfs add file1.txt (A file is added to node A)
#ipfs-cluster-ctl pin add file1.txt hash (synchronize file1.txt to the other two nodes in the cluster)
#ipfs file rm file1.txt (delete file file1.txt on node A)
So does filea.txt still exist in the other two nodes? Filea.txt in the /root/.ipfs/blocks of the other two nodes?
I executed the following command on node B: #ipfs cat file1.txt hash
You should see the contents of file1.txt?
Thank you again!
Just like you did before with ipfs add and ipfs-cluster-ctl pin add.
WebUI does not display pinned items from the pinset, but items from MFS. Cluster does not interact with MFS. (ipfs pin ls --type recursive vs ipfs files ls /)