返回介绍

18.2. Ubuntu 环境安装 Hyperledger Fabric v1.1.0

发布于 2023-06-19 14:14:32 字数 4992 浏览 0 评论 0 收藏 0

18.2. Ubuntu 环境安装 Hyperledger Fabric v1.1.0

18.2.1. 安装 Docker

Ubuntu apt 库中携带的 docker.io 版本过低,我们从官网安装Docker CE(社区版)取代他。

确保环境是干净的,卸载旧版本的 Docker

			
sudo apt-get remove docker docker-engine docker.io			
			
			

从官网安装新版本的 Docker

			
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

sudo apt-get update
sudo apt-get install docker-ce

sudo apt-get install python-pip
pip install docker-compose
			
			

启动 docker

			
neo@netkiller ~ % sudo systemctl start docker
neo@netkiller ~ % sudo systemctl status docker 
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-03-10 04:56:01 HST; 4s ago
     Docs: https://docs.docker.com
 Main PID: 27572 (dockerd)
    Tasks: 18
   Memory: 21.9M
      CPU: 578ms
   CGroup: /system.slice/docker.service
           ├─27572 /usr/bin/dockerd -H fd://
           └─27587 docker-containerd --config /var/run/docker/containerd/containerd.toml

Mar 10 04:56:00 netkiller dockerd[27572]: time="2018-03-10T04:56:00.020801698-10:00" level=warning msg="Your kernel does not support swap memory limit"
Mar 10 04:56:00 netkiller dockerd[27572]: time="2018-03-10T04:56:00.020948715-10:00" level=warning msg="Your kernel does not support cgroup rt period"
Mar 10 04:56:00 netkiller dockerd[27572]: time="2018-03-10T04:56:00.020991877-10:00" level=warning msg="Your kernel does not support cgroup rt runtime"
Mar 10 04:56:00 netkiller dockerd[27572]: time="2018-03-10T04:56:00.024334084-10:00" level=info msg="Loading containers: start."
Mar 10 04:56:00 netkiller dockerd[27572]: time="2018-03-10T04:56:00.786564515-10:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be use
Mar 10 04:56:01 netkiller dockerd[27572]: time="2018-03-10T04:56:01.243512581-10:00" level=info msg="Loading containers: done."
Mar 10 04:56:01 netkiller dockerd[27572]: time="2018-03-10T04:56:01.262158514-10:00" level=info msg="Docker daemon" commit=7390fc6 graphdriver(s)=btrfs version=17.12.1-ce
Mar 10 04:56:01 netkiller dockerd[27572]: time="2018-03-10T04:56:01.262329696-10:00" level=info msg="Daemon has completed initialization"
Mar 10 04:56:01 netkiller dockerd[27572]: time="2018-03-10T04:56:01.280874987-10:00" level=info msg="API listen on /var/run/docker.sock"
Mar 10 04:56:01 netkiller systemd[1]: Started Docker Application Container Engine.			
			
			

18.2.2. 安装 Hyperledger Fabric v1.1.0 Docker 镜像

			
sudo docker pull hyperledger/fabric-ca:x86_64-1.1.0
sudo docker pull hyperledger/fabric-peer:x86_64-1.1.0 
sudo docker pull hyperledger/fabric-orderer:x86_64-1.1.0 
sudo docker pull hyperledger/fabric-couchdb:x86_64-1.1.0 
sudo docker pull hyperledger/fabric-tools:x86_64-1.1.0

sudo docker tag hyperledger/fabric-ca:x86_64-1.1.0 hyperledger/fabric-ca 
sudo docker tag hyperledger/fabric-peer:x86_64-1.1.0 hyperledger/fabric-peer 
sudo docker tag hyperledger/fabric-orderer:x86_64-1.1.0 hyperledger/fabric-orderer 
sudo docker tag hyperledger/fabric-couchdb:x86_64-1.1.0 hyperledger/fabric-couchdb 
sudo docker tag hyperledger/fabric-tools:x86_64-1.1.0 hyperledger/fabric-tools
			
			

			
neo@netkiller ~ % sudo docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
hyperledger/fabric-couchdb   latest              380446aa57b6        2 weeks ago         1.5GB
hyperledger/fabric-couchdb   x86_64-1.1.0        380446aa57b6        2 weeks ago         1.5GB
hyperledger/fabric-tools     latest              322eaa2b8786        3 weeks ago         1.33GB
hyperledger/fabric-tools     x86_64-1.1.0        322eaa2b8786        3 weeks ago         1.33GB
hyperledger/fabric-orderer   latest              659d92c1be85        3 weeks ago         151MB
hyperledger/fabric-orderer   x86_64-1.1.0        659d92c1be85        3 weeks ago         151MB
hyperledger/fabric-peer      latest              28c7c07db540        3 weeks ago         154MB
hyperledger/fabric-peer      x86_64-1.1.0        28c7c07db540        3 weeks ago         154MB
hyperledger/fabric-ca        latest              fe3c9b6542cf        3 weeks ago         238MB
hyperledger/fabric-ca        x86_64-1.1.0        fe3c9b6542cf        3 weeks ago         238MB
			
			
			

18.2.3. docker-compose

			
neo@netkiller ~ % sudo apt install python3-pip
neo@netkiller ~ % pip3 install docker-compose
			
			

或者

			
neo@netkiller ~ % sudo curl -sL https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
neo@netkiller ~ % sudo chmod +x /usr/local/bin/docker-compose
neo@netkiller ~ % docker-compose --version
docker-compose version 1.19.0, build 9e633ef			
			
			

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文