1、系统安装
下载ubuntu-18.04.6-desktop-amd64,要求硬件:4GB内存;50GB磁盘空间
2、一些准备工作
1、受不了每次要输密码,直接用root ssh登录
2、各种源设置太麻烦,阿里源啥的还要注册,因此直接挂梯子,要求局域网内有梯子
准备工作
这个脚本执行前后都必须保证能联网
route -n
route add default gw 192.168.31.1
vi /etc/resolv.conf
ping www.baidu.com
3、写个shell脚本,复制本内容,并运行
#!/bin/sh
apt-get update
apt install git -y
apt install curl -y
apt install wget -y
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
apt-get -y update
apt-get -y install docker-ce
docker version
curl -L https://github.com/docker/compose/releases/download/1.23.1/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
wget https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz
tar -zxvf go1.15.2.linux-amd64.tar.gz -C /usr/local/
echo export GOROOT=/usr/local/go >> /etc/profile
echo export GOPATH=$HOME/go >> /etc/profile
echo "export PATH=\$PATH:\$GOROOT/bin:\$GOPATH/bin*/" >> /etc/profile
source /etc/profile
go version
source /etc/profile
# mkdir /usr/local/go/src/github.com
# mkdir /usr/local/go/src/github.com/hyperledger/
# cd /usr/local/go/src/github.com/hyperledger/
git clone https://github.com/hyperledger/fabric.git
cd ./fabric
git checkout -b v1.4.0
# cd ./fabric
curl -sSL https://bit.ly/2ysbOFE | bash -s -- 1.4.0
docker images
运行 source /etc/profile
测试安装
cd /root/fabric/fabric-samples/first-network/
./byfn.sh -m generate
#按照下面错误的处理方法修改错误,然后再输入下面的命令
./byfn.sh up
./byfn.sh down
出现问题
解决
首先我们把网络停止:
$ ./byfn.sh down
我们再输入:
$ sudo vim /etc/resolv.conf
然后重新执行 成功!