Ipfs-cluster issue

anybody knows how to run ipfs-cluster on linux?
I downloaded a Pre-compiled binaries and tar it in centos 7.2( no GO environment installed in this machine so I just tar the ipfs-cluster-service and ipfs-cluster-ctl)

but when I entered the ipfs-cluster-service folder and tried to run it, then I got a problem that “ipfs-cluster-service command not found”

maybe the problem is how to install ipfs-cluster-service and ipfs-cluster-ctl on linux by pre-built binaries?

hey, @Tim

are you sure you are running $ ./ipfs-cluster-service and not $ ipfs-cluster-service from the folder in which you downloaded it (and unpacked it)?

Otherwise you’d need to place it in your PATH.

1 Like

thank you @hector
but I am still confused about how to add a " friend node " into my ipfs-cluster in “bootstrap” and “cluster_peers”


is this id the ipfs id or ipfs-cluster id?

the tutorial shows I need to share same cluster secret with other nodes,so do I need to cover others’ secret?


first, download 0.2.1 as there were some bugs in 0.2.0 reading the config file.

Is this id the ipfs id or ipfs-cluster id?

That’s the ID from the ipfs-cluster peer that you are bootstrapping to. (Found in the config of that peer or with ipfs-cluster-ctl --host id

Note that you can add that node to the bootstrap section of the other, or you can start both peers with their multiaddresses in peers.

The secret should be the same in all peers configuration.

This is explained here: https://github.com/ipfs/ipfs-cluster/blob/master/docs/ipfs-cluster-guide.md#starting-your-cluster

If it’s not clear enough, let me know how we can improve it!

thank you @hector
I still have some questions about ipfs-cluster.
I “ipfs add” a file at one ipfs-cluster node, but the other node didnt "pin " that file automatically even over the time . I thought the other node would pin that file automatically.

I didnt know the function of ipfs-cluster-ctl…

did you ipfs add or ipfs-cluster-ctl pin add ?

yes,I “ipfs add” a file at a ipfs-cluster node A, and I want that file is automatically pinned to other node B in the same iPad-cluster, but it didn’t succeed.

If I ipfs-cluster-ctl pin add that file manually, I can read that file even A is closed…but I want this operation should be automatic.

Thank u @hector


please have a look here: https://github.com/ipfs/ipfs-cluster/blob/master/docs/ipfs-cluster-guide.md#using-the-ipfs-proxy

If you do ipfs pin add, you are interacting with ipfs only, and cluster has no way of tracking your pin.

1 Like

@hector tnx
yes I know that. I just want to “ipfs add” a file at A node, and when ipfs of A is shutdown and ipfs-cluster of A is also shutdown, I can stil “ipfs cat” at B node. and I want that process should be automatical.

@Tim, just do ipfs-cluster-ctl pin add at any of the nodes and configure your cluster replication factor to -1, or 2 (if you just have 2 nodes). This will ensure all nodes have the file automatically and you can ipfs cat it regardless of who is down.

@hector ohh. Do u mean I need to "ipfs-cluster-Ctl pin add " manually?then it’s ok even other node is down.

So how can I do ipfs-cluster-ctl pin add automatically by the machine if there is a new file at other node

@Tim, then you need to use the IPFS proxy as explained in the link above:

ipfs --api /ip4/ add myfile.txt: this is like ipfs add except you point to cluster and not to ipfs directly. This will 1) Add the file to ipfs 2) pin it in cluster. It is equivalent to:

$ cid=$(ipfs add -q myfile.txt)
$ ipfs-cluster-ctl pin add $cid

so how can I achieve it in Java,coz I use ipfs.add(File file) to upload a file

I don’t know which java library your are using, if it allows you to modify the ipfs api endpoint, or how it is implemented…

https://github.com/ipfs/java-ipfs-api @hector

I dont know why…

Heads up: the 0% bar should be fixed in latest master, but regardless of it, adding was successful.

ohh, I see. but 9095 port seems not stable if other peers down