Catalog
1 Preface
2 Operating system environment settings
2.1 Host and Operating System
2.2 Set Host Name
2.3 Setting up DNS
2.4 Close the firewall
2.5 Turn off selinux
2.6 Turn off swap
3 Operating system software installation
4 Install docker
5 Install docker-compose
5.1 jsonschema version mismatch
5.2 cffi version mismatch
5.3 dnspython version mismatch
5.4 python-ldap version mismatch
5.5 subprocess32 uninstall failed
6 Installation Configuration go
6.1 Install go
6.2 Configuration go
7 Download fabric s source
1 Preface
This paper describes how to manually deploy a fabrics block chain to understand the network structure and component usage of the block chain by building a fabrics.
2 Operating system environment settings
Each host, except 2.2, needs to perform the following steps.
2.1 Host and Operating System
This block chain requires three hosts.The underlying operating system is centos7.
2.2 Set Host Name
The host names of the three hosts are peer0.example.com, peer1.example.com, and peer2.example.com.
hostnamectl set-hostname peer0.example.com
hostnamectl set-hostname peer1.example.com
hostnamectl set-hostname peer2.example.com
2.3 Setting up DNS
Three hosts run four nodes (one of them is both an order node and a peer node).Edit/etc/hosts:
192.168.182.168 peer0.example.com order.example.com
192.168.182.169 peer1.example.com
192.168.182.170 peer2.example.com
2.4 Close the firewall
systemctl disable firewalld && systemctl stop firewalld
2.5 Close selinux
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
setenforce 0
2.6 Close swap
sed -i '$d' /etc/fstab
swapoff -a
3 Operating system software installation
Each host needs to be installed.
yum update
yum install -y git
yum install -y curl
yum install -y epel-release
yum install -y openldap-devel
yum install -y python-devel
yum install -y python-pip
pip install --upgrade pip
4 Install docker
docker version 1.13.1.Each host needs to be installed.
yum install docker
systemctl enable docker && systemctl start docker
docker version // Verify successful installation
5 Install docker-compose
docker-compose version 1.25.0.Each host needs to be installed.
pip install docker-compose
docker-compose version // Verify successful installation
If an installation error occurs, you can modify it with reference to the following.
5.1 jsonschema version mismatch
ERROR: jsonschema 3.2.0 has requirement six>=1.11.0, but you'll have six 1.9.0 which is incompatible.
Execute the following statements:
pip install six --user -U
pip install ipython --user -U
5.2 cffi version mismatch
ERROR: cryptography 2.8 has requirement cffi!=1.11.3,>=1.8, but you'll have cffi 1.6.0 which is incompatible.
Execute the following statements:
pip install cffi --user -U
5.3 dnspython version mismatch
ERROR: ipapython 4.6.5 has requirement dnspython>=1.15, but you'll have dnspython 1.12.0 which is incompatible.
Execute the following statements:
pip install dnspython --user -U
5.4 python-ldap version mismatch
ERROR: ipapython 4.6.5 has requirement python-ldap>=3.0.0b1, but you'll have python-ldap 2.4.15 which is incompatible.
Execute the following statements:
pip install --upgrade python-ldap --user -U
5.5 subprocess32 uninstall failed
ERROR: Cannot uninstall 'subprocess32'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Execute the following statements:
pip install docker-compose --ignore-installed subprocess32
6 Installation Configuration go
Each host installs and configures go.
6.1 Install go
cd /usr/local
wget https://studygolang.com/dl/golang/go1.13.1.linux-amd64.tar.gz
tar -xvf go1.13.1.linux-amd64.tar.gz
mkdir -p /workspace // fabric Source Storage Directory
mkdir -p /workspace/fabric/bin // fabric target code store directory
6.2 Configuration go
vi /etc/profile
export GOROOT=/usr/local/go
export GOPATH=/workspace/fabricexport
PATH=$PATH:$GOROOT/bin:$GOPATH/bin
7 Download fabric s source
Each host needs to download the fabric s source.
cd /workspace
git clone https://github.com/hyperledger/fabric.git
Edit/workspace/fabric/scripts/bootstrap.sh, modify the download() method, and remove the silent mode of curl download, otherwise you will not see any download status throughout the download process.
curl -L -s "${URL}" | tar xz || rc=$?
Change to:
curl -L "${URL}" | tar xz || rc=$?
After modification, execute the bootstrap.sh script, which downloads fabric-sample code and a lot of mirroring.And the download process may be interrupted from time to time. For specific reasons, think about it for yourself and don't scream. That's what life is like. Just accept it.Once the script is executed, there will be more mirrors locally as follows:
Fabrics have been installed successfully since then.The next section describes the deployment of fabric s.