CentOS 7搭建Fabric,测试network_setup例子

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install -y kernel-lt

如果是CentOS6,使用grub,修改/etc/grub.conf里的default为0。

如果是CentOS7,使用grub2,执行grub-set-default 0命令。

reboot
uname -a可看到内核版本已经改变

安装docker、docker-compose等

  • 卸载docker,无论之前下载的是docker-io还是docker,都卸载了。
  • 依赖包,yum install -y yum-utils device-mapper-persistent-data lvm2
添加国内源和下载
yum-config-manager \
  --add-repo \
  https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
更新缓存 yum makecache fast
安装 yum install docker-ce docker镜像源 其中的地址需要登录阿里云,去到镜像加速器那里复制过来。 vim /etc/docker/daemon.json {   "registry-mirrors": [   "https://8fu72j8a.mirror.aliyuncs.com"   ] }
安装epel-release,基础包,pip yum -y install epel-release yum -y install python-pip
安装docker-compose pip install docker-compose

参考:https://www.cnblogs.com/yu-hailong/p/7629120.html

安装go

curl -O https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
tar xvf go1.6.linux-amd64.tar.gz
mv go /usr/local/
vim /etc/profile
export GOROOT=/usr/local/go
export GOPATH=/opt/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

下载fabric

在/opt/gopath下新建src/github.com/hyperledger/

git clone -b release-1.0 https://github.com/hyperledger/fabric
cd fabric/example/e2e_cli/
source download-dockerimages.sh -c x86_64-1.0.6 -f x86_64-1.0.6
chmod +x network_setup.sh
./network_setup.sh up