Have a public network environment of the server can directly see Hyperledger Fabric 1.0 from scratch (ii)--Environmental Construction (public network), this article similar to the previous article, but the environment needs to build in the intranet, that is, the network is limited under the circumstances.
1: Environmental construction and testing
The host environment used in this article is CentOS, the version is centos.x86_647.2, runs the fabric node through the Docker container, the version is v1.0. Therefore, the nodes in the boot fabric network need to first install the Docker, Docker-compose, and go locale, then pull the relevant Docker mirrors online, and then configure the compose file to start each node.
1.1: Open intranet Ali Yum Source access rights
The company intranet environment is not absolutely no network environment, otherwise it is deployed hyperledger/fabric also has no meaning. Here need to apply for Ali Yum Source IP and port number as follows:
115.28.122.210:80
112.124.140.210:80
The reason why the use of Ali Yum Source, we should all know the reason, but also the intranet environment, here will not repeat.
"Note: If the visitor's company does not even have this, then basically do not build this set of environment, because the next need to perform Yum update operation, this step is very important, later will be mentioned." 】
The source address actually accesses the domain name http://mirrors.aliyun.com, this domain name IP and the port number is relatively stable, but also may change the situation, when the Ali Yum source request corresponding Ip/port cannot visit, please try the domain name to visit, view its newest ip/ Port and update Ali Yum's access rights.
The specific steps are as follows:
A: Back up the original Yum source
sudo cp/etc/yum.repos.d/centos-base.repo/etc/yum.repos.d/centos-base.repo.bak
B: Set the source of Ali Yum
sudo wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-7.repo
C: Clean the cache and generate a new cache
1 sudo yum clean all
2 sudo yum makecache
D: Update the Yum Library
sudo yum update
The purpose of this operation is to update all of the built-in libraries to the latest edition, because the Docker of the most recent version of the installation needs of the corresponding dependencies are the new version, in order to avoid the installation dependencies of the trouble, so the operation is very important.
The author began to fall into this pit, one can constantly through the manual way to import various dependencies, various dependent download address here also share, everyone in the Linux environment if the lack of dependency, you can go to linux Packages search download and install.
1.2:docker Installation
Enter Docker official website
Getdocker-"Centos-" Get CE (Community Edition)-"Get Docker CE on Centos-" Install Docker CE on Centos.
Follow the steps given by the official website to install Docker CE version offline
If you have an older version of Docker on your server, you need to perform the uninstall operation as follows:
$ sudo yum remove docker \
docker-common \
docker-selinux \
docker-engine
Then start installing Docker CE
When the author writes this document Docker official newest edition is docker-ce-17.06.0.ce-1.el7.centos.x86_64.rpm, can download the newest edition in packages.
The latest version can be downloaded to the/tmp/docker/docker directory.
You then perform the following command to install:
1 Cd/tmp/docker/docker
2 yum install docker-ce-17.06.0.ce-1.el7.centos.x86_64.rpm
3 y
The final installation Success view is as follows:
Perform the following command to view the version information for the current Docker installation and to confirm that the installation was successful:
Docker--version
The result is the following view:
Docker Start:
Service Docker start
Docker Boot from:
Chkconfig Docker on
The result is the following view:
1.3:docker-compose Installation
Docker-compose's offline installation is slightly more cumbersome than curl installation, which requires downloading the latest version of docker-compose-linux-x86_64 from the GitHub project on the website and uploading it to/tmp/docker/ Docker-compose, the author of this document when the official offer Docker-compose the latest version of the 1.15.0.
Then perform the following command to complete the installation:
1 cd/tmp/docker/docker-compose
2 mv docker-compose-linux-x86_64/usr/local/bin/docker-compose
3 chmod +x/usr /local/bin/docker-compose
It is essential to give executable permissions, and then perform the following command to view the Docker-compose version information and confirm that the installation is in effect:
Docker-compose--version
The final full run view should be as follows:
1.4:go Language Installation
1, refer to go website, find the Linux version download path, do the following to download the latest version of the Go Language pack
Download the latest version directly through the https://golang.org/doc/install?download=go1.8.3.linux-amd64.tar.gz link.
Download can be uploaded to the/tmp/docker directory.
2, extract go1.8.3.linux-amd64.tar.gz to/usr/local directory, perform the following operations:
1 cd/tmp/docker
2 tar-c/usr/local-xzf go1.8.3.linux-amd64.tar.gz
3. Configure GO Environment variables
Modify the/etc/profile file to take effect permanently and take effect for all system users, adding the following two lines of code at the end of the file
1 export path= $PATH:/usr/local/go/bin
2 Export Gopath=/opt/gopath
The above modified/etc/profile file specifically implements the following operations:
1 cd/etc
2 Vim profile
After the modifications are performed, continue:
Source Profile
Make the changes take effect. The following order may then be adopted:
Echo $PATH
See if you added success.
Finally, you can pass
Go version
View the current Go version information, which is normally the following view:
Here I upload or specify the installation directory is not fixed, but note that if uploaded to the TMP directory, the Linux system will not periodically clear the contents.