更新系统及初始化环境
sudo apt update
sudo apt -y upgradesudo apt install docker docker-compose -y
# time adjust
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime# install ulimit
rhn=`cat /etc/security/limits.conf |grep "root hard nofile 1048576"|wc -l`if [ $rhn -le 0 ]; then
ulimit -n 1048576
sed -i "/nofile/d" /etc/security/limits.conf
echo "* hard nofile 1048576" >> /etc/security/limits.conf
echo "* soft nofile 1048576" >> /etc/security/limits.conf
echo "root hard nofile 1048576" >> /etc/security/limits.conf
echo "root soft nofile 1048576" >> /etc/security/limits.conf
filocaldatadir="/data/bee"
if [ ! -d ${localdatadir} ] ; then
sudo mkdir -p ${localdatadir}
ficd localdatadir
wget -q https://raw.githubusercontent.com/ethersphere/bee/v0.6.2/packaging/docker/docker-compose.yml
wget -q https://raw.githubusercontent.com/ethersphere/bee/v0.6.2/packaging/docker/env -O .env
修改.env
BEE_FULL_NODE=true
BEE_PASSWORD=Fspoos.-om_s23s
BEE_SWAP_ENDPOINT=wss://goerli.infura.io/ws/v3/82b5e643d655*****
参考模板 env
修改docker-compose.yml
主要修改成两个节点的配制文件
把services里头的clef-1、bee-2、volumes、command、depends_on拷一份到"- clef-1"这一行的下面。
修改完大概变这样
version: "3"
services:
clef-1:
image: ethersphere/clef:0.4.12
restart: unless-stopped
environment:
- CLEF_CHAINID
volumes:
- clef-1:/app/data/clef-1
command: full
bee-1:
image: ethersphere/bee:beta
restart: unless-stopped
environment:
- BEE_API_ADDR
- BEE_BOOTNODE
- BEE_BOOTNODE_MODE
- BEE_CLEF_SIGNER_ENABLE
- BEE_CLEF_SIGNER_ENDPOINT=http://clef-1:8550
- *******ports:
- "${API_ADDR:-63301}${BEE_API_ADDR:-:63301}"
- "${P2P_ADDR:-63401}${BEE_P2P_ADDR:-:63401}"
- "${DEBUG_API_ADDR:-127.0.0.1:63501}${BEE_DEBUG_API_ADDR:-:63501}"volumes:
- bee-1:/home/bee2/.bee
command: start
depends_on:
- clef-1clef-2:
image: ethersphere/clef:0.4.12
restart: unless-stopped
environment:
- CLEF_CHAINID
volumes:
- clef-2:/app/data/clef-2
command: fullbee-2:
image: ethersphere/bee:beta
restart: unless-stopped
environment:
- BEE_API_ADDR
- *BEE_BOOTNODE
- BEE_BOOTNODE_MODE
- BEE_CLEF_SIGNER_ENABLE
- BEE_CLEF_SIGNER_ENDPOINT=http://clef-2:8550
- *********ports:
- "${API_ADDR:-63302}${BEE_API_ADDR:-:63302}"
- "${P2P_ADDR:-63402}${BEE_P2P_ADDR:-:63402}"
- "${DEBUG_API_ADDR:-127.0.0.1:63502}${BEE_DEBUG_API_ADDR:-:63502}"volumes:
- bee-2:/home/bee2/.beecommand: start
depends_on:
- clef-2volumes:
clef-1:
bee-1:
clef-2:
bee-2:
启动docker-compose
docker-compose up -d
完成后查看容器状态
docker ps -a
接水
docker-compose logs -f bee-1
docker-compose logs -f bee-2
得到节点的钱包地址,去官方频道接水。所用自己的钱包给节点地址打入1个gETH、1个gBZZ。
如果需要再多开些节点,道理是一样的只需要再加clef-3、bee-3就可以了。
需要写脚本监控各节点的状态,并汇总到监控主机上。