Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy Fabric 1. 0 physical Machine Cluster

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "how to deploy Fabric 1.0physical machine cluster". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to deploy Fabric 1.0physical machine cluster".

Fabric 1.0 physical machine cluster deployment environment machine planning numbering host name IP address domain name remarks environment 1Node-1172.19.199.45kafka1.localzk-kafka node java2Node-2172.19.199.46kafka2.localzk-kafka node java3Node-3172.19.199.47kafka3.localzk-kafka node java4Node-4172.19.199.48peer0.org1.localpeer node docker, golang5Node-5172.19.199.49peer1.org1.localpeer node docker, golang6Node-6172.19.199.50peer0.org2.localpeer node docker Golang7Node-7172.19.199.51peer1.org2.localpeer node docker Golang8Node-9172.19.199.52ca.org1.localca node docker9Node-9172.19.199.53ca.org2.localca node docker10Node-10172.19.199.54order.localorder node dockerHosts configuration 172.19.199.45 Node-1 kafka1.local 172.19.199.46 Node-2 kafka2.local 172.19.199.47 Node-3 kafka3.local 172.19.199.48 Node-4 peer0.org1.local 172 .19.199.49 Node-5 peer1.org1.local 172.19.199.50 Node-6 peer0.org2.local 172.19.199.51 Node-7 peer1.org2.local 172.19.199.52 Node-8 ca.org1.local 172.19.199.53 Node-9 ca.org2.local 172.19.199.54 Node-10 orderer.local system environment

Operating system:

~ # cat / proc/version Linux version 4.4.0-82-generic (buildd@lgw01-43) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)) # 105-Ubuntu SMP Tue Jun 20 15:23:02 UTC 2017

Docker:

~ # docker-v Docker version 17.06.0-ce, build 02c1d87

Docker Compose

~ # docker-compose-v docker-compose version 1.14.0, build c7bdf9e

Golang

~ # go version go version go1.8.3 linux/amd64

System dependent installation

Deploying the peer node of chaincode requires the installation of golang and docker environment

Docker installation ~ # curl-fsSL https://get.docker.com/ | sh~# curl-L https://github.com/docker/compose/releases/download/1.14.0/docker-compose-`uname-s`-`uname-m` > / usr/local/bin/docker-compose~# sudo chmod + x / usr/local/bin/docker-composegolang install ~ # curl https://www.golangtc.com/static/go/1.8.3/go1.8.3.linux-amd64.tar.gz | | tar zx-C / opt/~# mkdir-p ~ / go/src ~ / go/pkg ~ / go/bin~# vi / etc/profileexport GOROOT=/opt/goexport GOPATH=~/goexport PATH=$PATH:$GOROOT/bin~# source / etc/profilefabric binary executable program installation |

Execute bootstrap-1.0.0.sh, download fabric 1.0 and install it to the / opt/fabric directory:

#! / bin/bash # # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # export VERSION=1.0.0 export ARCH=$ (echo "$(uname-s | tr'[: upper:]'[: lower:]'| sed's Universe W64Extennt.windows ppc64le,s390x,x86_64')-$(uname-m | sed's uname x86x6x6x6x6x6xx6xx6x6xx6x6xx6xx6xx6x6xx6xx6xx6xx6xx6xx6xx6xx6xx6xx6xx6xx6x6xx6xx6xx6x6xx6xx6xx6x6xx6x6xx6xx6xx6xx6xx6xx6xx6xx6xx6x6xx6xx6xx6xx6xx I386 MARCH= `uname-m`: ${CA_TAG:= "$MARCH-$VERSION"}: ${FABRIC_TAG:= "$MARCH-$VERSION"} echo "= = > Downloading platform binaries" mkdir / opt/fabric curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/hyperledger-fabric-${ARCH}-${VERSION}.tar.gz | tar xz-C / opt/fabric

The following tools will be available under / opt/fabric/bin/ after the installation is complete

~ # tree / opt/fabric/bin//opt/fabric/bin/ ├── configtxgen ├── configtxlator ├── cryptogen ├── get-byfn.sh ├── ├── orderer └── peer0 directories, 7 files fabric deployment kafka cluster deployment

Deploy a kafka cluster using Node-1,Node-3,Node-3 nodes

Reference: http://kafka.apache.org/documentation.html

Fabric initialization profile

~ / fabric/configs/configtx.yaml:

# Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 #-- # # # Profile # #-Different configuration profiles may be encoded here to Be specified # as parameters to the configtxgen tool # Profiles: TwoOrgsOrdererGenesis: Orderer:% {level:.4s}% {id:03x}% {color:reset}% {message}'# Peer section # # peer: # The Peer id is used for identifying this Peer instance. Id: jdoe # The networkId allows for logical seperation of networks networkId: dev # The Address at local network interface this Peer will listen on. # By default, it will listen on all network interfaces listenAddress: 0.0.0.0:7051 # The endpoint this peer uses to listen for inbound chaincode connections. # # The chaincode connection does not support TLS-mutual auth. Having a # separate listener for the chaincode helps isolate the chaincode # environment for enhanced security, so it is strongly recommended to # uncomment chaincodeListenAddress and specify a protected endpoint. # # If chaincodeListenAddress is not configured or equals to the listenAddress, # listenAddress will be used for chaincode connections. This is not # recommended for production. # # chaincodeListenAddress: 127.0.0.1:7052 # When used as peer config, this represents the endpoint to other peers # in the same organization for peers in other organization, see # gossip.externalEndpoint for more info. # When used as CLI config, this means the peer's endpoint to interact with address: 0.0.0.0:7051 # Whether the Peer should programmatically determine its address # This case is useful for docker containers. AddressAutoDetect: false # Setting for runtime.GOMAXPROCS (n). If n

< 1, it does not change the # current setting gomaxprocs: -1 # Gossip related configuration gossip: # Bootstrap set to initialize gossip with. # This is a list of other peers that this peer reaches out to at startup. # Important: The endpoints here have to be endpoints of peers in the same # organization, because the peer would refuse connecting to these endpoints # unless they are in the same organization as the peer. bootstrap: 127.0.0.1:7051 # NOTE: orgLeader and useLeaderElection parameters are mutual exclusive. # Setting both to true would result in the termination of the peer # since this is undefined state. If the peers are configured with # useLeaderElection=false, make sure there is at least 1 peer in the # organization that its orgLeader is set to true. # Defines whenever peer will initialize dynamic algorithm for # "leader" selection, where leader is the peer to establish # connection with ordering service and use delivery protocol # to pull ledger blocks from ordering service. It is recommended to # use leader election for large networks of peers. useLeaderElection: false # Statically defines peer to be an organization "leader", # where this means that current peer will maintain connection # with ordering service and disseminate block across peers in # its own organization orgLeader: true # Overrides the endpoint that the peer publishes to peers # in its organization. For peers in foreign organizations # see 'externalEndpoint' endpoint: # Maximum count of blocks stored in memory maxBlockCountToStore: 100 # Max time between consecutive message pushes(unit: millisecond) maxPropagationBurstLatency: 10ms # Max number of messages stored until a push is triggered to remote peers maxPropagationBurstSize: 10 # Number of times a message is pushed to remote peers propagateIterations: 1 # Number of peers selected to push messages to propagatePeerNum: 3 # Determines frequency of pull phases(unit: second) pullInterval: 4s # Number of peers to pull from pullPeerNum: 3 # Determines frequency of pulling state info messages from peers(unit: second) requestStateInfoInterval: 4s # Determines frequency of pushing state info messages to peers(unit: second) publishStateInfoInterval: 4s # Maximum time a stateInfo message is kept until expired stateInfoRetentionInterval: # Time from startup certificates are included in Alive messages(unit: second) publishCertPeriod: 10s # Should we skip verifying block messages or not (currently not in use) skipBlockVerification: false # Dial timeout(unit: second) dialTimeout: 3s # Connection timeout(unit: second) connTimeout: 2s # Buffer size of received messages recvBuffSize: 20 # Buffer size of sending messages sendBuffSize: 200 # Time to wait before pull engine processes incoming digests (unit: second) digestWaitTime: 1s # Time to wait before pull engine removes incoming nonce (unit: second) requestWaitTime: 1s # Time to wait before pull engine ends pull (unit: second) responseWaitTime: 2s # Alive check interval(unit: second) aliveTimeInterval: 5s # Alive expiration timeout(unit: second) aliveExpirationTimeout: 25s # Reconnect interval(unit: second) reconnectInterval: 25s # This is an endpoint that is published to peers outside of the organization. # If this isn't set, the peer will not be known to other organizations. externalEndpoint: # Leader election service configuration election: # Longest time peer waits for stable membership during leader election startup (unit: second) startupGracePeriod: 15s # Interval gossip membership samples to check its stability (unit: second) membershipSampleInterval: 1s # Time passes since last declaration message before peer decides to perform leader election (unit: second) leaderAliveThreshold: 10s # Time between peer sends propose message and declares itself as a leader (sends declaration message) (unit: second) leaderElectionDuration: 5s # EventHub related configuration events: # The address that the Event service will be enabled on the peer address: 0.0.0.0:7053 # total number of events that could be buffered without blocking send buffersize: 100 # timeout duration for producer to send an event. # if < 0, if buffer full, unblocks immediately and not send # if 0, if buffer full, will block and guarantee the event will be sent out # if >

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report