File tree 3 files changed +35
-0
lines changed
3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 5
5
* [ supervisor 管理 ipfs] ( ipfs/supervisor.md )
6
6
* [ IPFS Cluster] ( ipfs-cluster/readme.md )
7
7
* [ 概述] ( ipfs-cluster/overview.md )
8
+ * [ 多集群通信] ( ipfs-cluster/cluster-of-clusters.md )
8
9
* [ supervisor 管理 ipfs-cluster-service] ( ipfs-cluster/supervisor.md )
9
10
* [ 集群启动方式一:预设置集群节点] ( ipfs-cluster/peerset.md )
10
11
* [ 集群启动方式二:动态添加新节点] ( ipfs-cluster/bootstrap.md )
Original file line number Diff line number Diff line change
1
+ # 多集群通信
2
+
3
+ ![ cluster-of-clusters] ( imgs/cluster-of-clusters.png )
4
+
5
+
6
+ ipfs-cluster-service 提供了对 ipfs 节点的代理功能,使得整个 cluster 可以对外当做一个 ipfs 节点一样来使用。
7
+
8
+ - 代理端口默认开在 9095
9
+ - 对一部分命令进行了封装,例如:` ipfs --api /ip4/127.0.0.1/tcp/9095 add myfile.txt `
10
+ - 对于没有进行封装的命令,将会穿透访问到 ipfs 节点本身,例如访问 ` ipfs --api /ip4/127.0.0.1/tcp/9095 repo gc ` 和访问 ` ipfs repo gc ` 效果一致。
11
+
12
+ ### 常用命令
13
+
14
+ ```
15
+ (1) ipfs --api /ip4/127.0.0.1/tcp/9095 add myfile.txt
16
+ 该命令将本地 myfile.txt 的内容添加到本地 IPFS 节点中,并且将文件对应的哈希值添加到集群中。
17
+
18
+ (2) ipfs --api /ip4/127.0.0.1/tcp/9095 pin add <cid>
19
+ 根据 cid 获取网络中对应的内容,写入本地 IPFS 节点,并且将该哈希值添加到集群中。
20
+
21
+ (3) ipfs --api /ip4/127.0.0.1/tcp/9095 pin rm <cid>
22
+ 将该 cid 记录从本集群中移除。
23
+
24
+ (4) ipfs --api /ip4/127.0.0.1/tcp/9095 pin ls
25
+ 显示本集群中所有的 pin 记录。
26
+
27
+ (5) ipfs repo gc
28
+ 该命令会触发 gc 操作,回收所有 unpin 的内容在 IPFS 节点中所占用的存储空间。
29
+ ```
30
+
31
+
32
+ ### 参考文献
33
+
34
+ https://cluster.ipfs.io/documentation/composite-clusters/
You can’t perform that action at this time.
0 commit comments