当前位置:网站首页>IPFs cluster setup process
IPFs cluster setup process
2022-06-13 08:02:00 【Boiled soybeans in brine】
IPFS-Cluster Construction process
preparation
- Pull the code :
git clone https://github.com/ipfs/go-ipfs.git
git clone https://github.com/ipfs/ipfs-cluster.git
go get -u github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen
Compile code ( Or directly github from releases Download executable binaries from )
#ipfs cd go-ipfs/cmd/ipfs go build #ipfs-cluster cd ipfs-cluster/ipfs-cluster-ctl go build cd ipfs-cluster/ipfs-cluster-service go buildGenerate the key
#ipfs secret key
ipfs-swarm-key-gen > ~/.ipfs/swarm.key
#ipfs-cluster secret key
od -vN 32 -An -tx1 /dev/urandom | tr -d ' \n'
# Remember key
c8d92b6783558b7f10d480b1b8c5e9c9c9c8a5e72f65ea8e9d0c36d72d0016a2
The following will be deployed on five machines ipfs-cluster
172.18.3.1( Master node )
172.18.3.2
172.18.3.3
172.18.3.4
172.18.3.5
build IPFS Private network
take ipfs and swarm.key Copy to five machines
from 172.18.3.1-3.5 To start ipfs
#172.18.3.1
# initialization
./ipfs init
# Delete all default connection nodes
./ipfs bootstrap rm --all
# Copy the private network key to the configuration folder
cp swarm.key ~/.ipfs/
# start-up ipfs
./ipfs daemon
# see ipfs id
./ipfs id
#12D3KooWMuLfL5g2i91z3bQtecjHNH6dtbP42eEDQZCsYdx7H83f
#172.18.3.2
# initialization
./ipfs init
# Delete all default connection nodes
./ipfs bootstrap rm --all
# Copy the private network key to the configuration folder
cp swarm.key ~/.ipfs/
# Join node 1 The Internet
./ipfs bootstrap add /ip4/172.18.3.1/tcp/4001/ipfs/12D3KooWMuLfL5g2i91z3bQtecjHNH6dtbP42eEDQZCsYdx7H83f
# start-up ipfs
./ipfs daemon
# see ipfs id
./ipfs id
#12D3KooWFNcYF7HzAHk5a5KAQutXfSQWsyEyHrQDxtmQCwX5wUAR
#172.18.3.3
# initialization
./ipfs init
# Delete all default connection nodes
./ipfs bootstrap rm --all
# Copy the private network key to the configuration folder
cp swarm.key ~/.ipfs/
# Join other node networks
./ipfs bootstrap add /ip4/172.18.3.1/tcp/4001/ipfs/12D3KooWMuLfL5g2i91z3bQtecjHNH6dtbP42eEDQZCsYdx7H83f
./ipfs bootstrap add /ip4/172.18.3.2/tcp/4001/ipfs/12D3KooWFNcYF7HzAHk5a5KAQutXfSQWsyEyHrQDxtmQCwX5wUAR
# start-up ipfs
./ipfs daemon
# see ipfs id
./ipfs id
#12D3KooWNUS86De4xyQpErMKagXREERZHDZnsqfiJRcCPxZc3sUZ
#172.18.3.4
# initialization
./ipfs init
# Delete all default connection nodes
./ipfs bootstrap rm --all
# Copy the private network key to the configuration folder
cp swarm.key ~/.ipfs/
# Join other node networks
./ipfs bootstrap add /ip4/172.18.3.1/tcp/4001/ipfs/12D3KooWMuLfL5g2i91z3bQtecjHNH6dtbP42eEDQZCsYdx7H83f
./ipfs bootstrap add /ip4/172.18.3.2/tcp/4001/ipfs/12D3KooWFNcYF7HzAHk5a5KAQutXfSQWsyEyHrQDxtmQCwX5wUAR
./ipfs bootstrap add /ip4/172.18.3.3/tcp/4001/ipfs/12D3KooWNUS86De4xyQpErMKagXREERZHDZnsqfiJRcCPxZc3sUZ
# start-up ipfs
./ipfs daemon
# see ipfs id
./ipfs id
#12D3KooWPam8PpjychftpzU4vXaZhHYWVpN6QJP68bwNRzeVLBt2
#172.18.3.5 Repeat
# Execute... On any node , Check the node connection
./ipfs swarm peers
build IPFS-Cluster
take ipfs-cluster-service、ipfs-cluster-ctl Copy to five machines
from 172.18.3.1-3.5 To start IPFS-Cluster
#172.18.3.1-3.5 Each unit executes commands
# initialization
./ipfs-cluster-service init
# Add the generated key to the environment variable , such as : c8d92b6783558b7f10d480b1b8c5e9c9c9c8a5e72f65ea8e9d0c36d72d0016a2
# Modify the... Of each node separately ~/.bashrc Add to environment variable :
export CLUSTER_SECRET=b55262c36de6f97bd50b5233f75866445ec51db74613bad78e906c4dc9ba1d30
# Finally, don't forget
source ~/.bashrc
#172.18.3.1 The master node starts
./ipfs-cluster-service daemon
# View cluster ID
./ipfs-cluster-ctl peers ls
# It can also be done through service see
ipfs-cluster-service id
#12D3KooWPVtHiq9AWnRQYKRXqQAr5WBKJtGDeZwfJxLxkBv3oBAg
#3.2-3.5 The child node starts
./ipfs-cluster-service daemon --bootstrap /ip4/172.18.3.1/tcp/9096/p2p/12D3KooWPVtHiq9AWnRQYKRXqQAr5WBKJtGDeZwfJxLxkBv3oBAg
# Check the cluster connection
./ipfs-cluster-ctl peers ls
IPFS-Cluster Test file storage
Add a file to one of the nodes :
./ipfs-cluster-ctl add test.txt
By adding files CID To see the file status , You can see the file and in all nodes PINNED
./ipfs-cluster-ctl status CID
Configure system process startup
- IPFS
For each IPFS Boot all join the system's daemons to start , add to /etc/systemd/system/ipfs.service
[Unit]
Description=IPFS Daemon
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
ExecStart=/usr/local/bin/ipfs daemon --enable-namesys-pubsub
User=root
[Install]
WantedBy=multi-user.target
Now you can start it with the following command IPFS The background daemons of :
systemctl daemon-reload
systemctl enable ipfs
systemctl start ipfs
systemctl status ipfs
- IPFS-Cluster
Add to /etc/systemd/system/ipfs-cluster.service:
[Unit]
Description=IPFS-Cluster Daemon
Requires=ipfs
After=syslog.target network.target remote-fs.target nss-lookup.target ipfs
[Service]
Type=simple
ExecStart=/root/go/bin/ipfs-cluster-service daemon
User=root
[Install]
WantedBy=multi-user.target
Now you can start it with the following command ipfs-cluster The background daemons of :
systemctl daemon-reload
systemctl enable ipfs-cluster
systemctl start ipfs-cluster
systemctl status ipfs-cluster
边栏推荐
- Redis interview questions
- MySQL Gtid_ Executed and gtid_ Purged modification time
- Redis underlying data structure - underlying principle of hash table
- 【博弈论-完全信息静态博弈】 Nash均衡
- Selenium reports an error deprecationwarning: executable_ path has been deprecated, please pass in a Service object
- Structural analysis of hyperledger fabric (I)
- 【PYTORCH】Expected object of type torch. xxxTensor but found type torch. cuda. xxxTensor(torch0.4.0)
- 获取类的属性
- 酒水批发行业应当如何高效管理商品与库存
- Basic operation of dfinity (ICP) development-4
猜你喜欢

AcWing 1977. 信息中继(基环树,并查集)

Effective Go - The Go Programming Language

Redis master-slave replication - underlying principle

疫情之下的远程办公解决方案

获取类的属性
![[problem record] json decoder. JSONDecodeError:Extra data: line xxx column xxx(char xxxx)](/img/29/ec3e5a1566b4c3ecb0eef1ceede98d.jpg)
[problem record] json decoder. JSONDecodeError:Extra data: line xxx column xxx(char xxxx)

ES6 deleting an attribute of an object

Redis Cluster - the underlying principle of slot assignment

Tidb certification guide PCTA Pctp

Dfinity (ICP) identity authentication and ledger quick start-3
随机推荐
Leetcode 163 Missing interval (June 12, 2022)
Overview of cross chain protocol IBC
2022 electrician (elementary) examination questions and simulation examination
[an example of MySQL startup error] innodb: failed to create check sector file, errno:13
Local shooting range 2- file upload vulnerability (III) - Network Security
21 | 面向流水线的指令设计(下):奔腾4是怎么失败的?
[MySQL] the most complete MySQL monitoring project
MySQL summary
[MySQL] methods for troubleshooting lock related problems
Coalesce() function
Go 接口实现原理【高阶篇】: type _interface struct
The way of distributed system: Lamport logical clock
[MySQL] online lock free delay free DDL artifact GH OST
Redis underlying data structure ----quicklist
redis面试题
Shell script Basics
uniapp 小程序根据权限动态生成 tabbar
Basic operation of dfinity (ICP) development-4
23 | adventure and prediction (II): relay race in the assembly line
【博弈论-完全信息静态博弈】 Nash均衡