Dear All,
I am new in learning ipfs technologies. I have successfully run ipfs cluster using docker-compose.yaml file.
When I pin a file, it is pinned to all cluster peers.
My intention is to pin my file to a specific peer in the cluster peer
how can I modify the docker-compose file for this purpose?
version: β3.4β
services:
cluster peer0
ipfs0:
container_name: ipfs0
image: ipfs/go-ipfs:release
ports:
- β4001:4001β # ipfs swarm - expose if needed/wanted
- β5001:5001β # ipfs api - expose if needed/wanted
- β8080:8080β # ipfs gateway - expose if needed/wanted
volumes:
- ./data/ipfs0:/data/ipfs
cluster0:
container_name: cluster0
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs0
environment:
CLUSTER_PEERNAME: cluster0
CLUSTER_SECRET: f5cd39fc1145a3efadb3fc36ad36c9279fe34fe1e6e289ee7b5be79615dccd6f # From shell variable if set
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs0/tcp/5001
CLUSTER_CRDT_TRUSTEDPEERS: β*β # Trust all peers in Cluster
CLUSTER_RESTAPI_HTTPLISTENMULTIADDRESS: /ip4/0.0.0.0/tcp/9094 # Expose API
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery
ports:
# Open API port (allows ipfs-cluster-ctl usage on host)
- β9094:9094β
# The cluster swarm port would need to be exposed if this container
# was to connect to cluster peers on other hosts.
# But this is just a testing cluster.
# - β9096:9096β # Cluster IPFS Proxy endpoint
volumes:
- ./data/cluster0:/data/ipfs-cluster
cluster peer1
ipfs1:
container_name: ipfs1
image: ipfs/go-ipfs:release
volumes:
- ./data/ipfs1:/data/ipfs
cluster1:
container_name: cluster1
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs1
environment:
CLUSTER_PEERNAME: cluster1
CLUSTER_SECRET: f5cd39fc1145a3efadb3fc36ad36c9279fe34fe1e6e289ee7b5be79615dccd6f
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs1/tcp/5001
CLUSTER_CRDT_TRUSTEDPEERS: '*'
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery
volumes:
- ./data/cluster1:/data/ipfs-cluster
cluster peer2
ipfs2:
container_name: ipfs2
image: ipfs/go-ipfs:release
volumes:
- ./data/ipfs2:/data/ipfs
cluster2:
container_name: cluster2
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs2
environment:
CLUSTER_PEERNAME: cluster2
CLUSTER_SECRET: f5cd39fc1145a3efadb3fc36ad36c9279fe34fe1e6e289ee7b5be79615dccd6f
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs2/tcp/5001
CLUSTER_CRDT_TRUSTEDPEERS: '*'
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery
volumes:
- ./data/cluster2:/data/ipfs-cluster
cluster peer3
ipfs3:
container_name: ipfs3
image: ipfs/go-ipfs:release
volumes:
- ./data/ipfs3:/data/ipfs
cluster3:
container_name: cluster3
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs3
environment:
CLUSTER_PEERNAME: cluster3
CLUSTER_SECRET: f5cd39fc1145a3efadb3fc36ad36c9279fe34fe1e6e289ee7b5be79615dccd6f
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs3/tcp/5001
CLUSTER_CRDT_TRUSTEDPEERS: '*'
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery
volumes:
- ./data/cluster3:/data/ipfs-cluster
cluster peer4
ipfs4:
container_name: ipfs4
image: ipfs/go-ipfs:release
volumes:
- ./data/ipfs4:/data/ipfs
cluster4:
container_name: cluster4
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs4
environment:
CLUSTER_PEERNAME: cluster4
CLUSTER_SECRET: f5cd39fc1145a3efadb3fc36ad36c9279fe34fe1e6e289ee7b5be79615dccd6f
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs4/tcp/5001
CLUSTER_CRDT_TRUSTEDPEERS: '*'
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery
volumes:
- ./data/cluster4:/data/ipfs-cluster
cluster peer5
ipfs5:
container_name: ipfs5
image: ipfs/go-ipfs:release
volumes:
- ./data/ipfs5:/data/ipfs
cluster5:
container_name: cluster5
image: ipfs/ipfs-cluster:latest
depends_on:
- ipfs5
environment:
CLUSTER_PEERNAME: cluster5
CLUSTER_SECRET: f5cd39fc1145a3efadb3fc36ad36c9279fe34fe1e6e289ee7b5be79615dccd6f
CLUSTER_IPFSHTTP_NODEMULTIADDRESS: /dns4/ipfs5/tcp/5001
CLUSTER_CRDT_TRUSTEDPEERS: '*'
CLUSTER_MONITORPINGINTERVAL: 2s # Speed up peer discovery
volumes:
- ./data/cluster5:/data/ipfs-cluster