You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何从Hyperledger Fabric 1.0/1.0.x版本升级至1.1版本?

Alright, let's walk through how to upgrade your Hyperledger Fabric 1.0.x deployment to 1.1 properly—this process needs to be done carefully to avoid downtime or data inconsistencies. I’ve helped a few teams work through this, so here’s a step-by-step breakdown that’s proven reliable.

1. Pre-Upgrade Prep (Don’t Skip This!)

Before touching any nodes, get your safety nets and resources ready:

  • Backup everything: Copy all node data directories (like /var/hyperledger/production for peers, /var/hyperledger/production/orderer for orderers) and configuration files (core.yaml, orderer.yaml, crypto materials, channel configs). If something goes sideways, you’ll thank yourself for this.
  • Patch up 1.0.x first: Make sure all your 1.0.x nodes are running the latest patch release (e.g., 1.0.9). This fixes known bugs that could cause issues during the cross-version upgrade.
  • Grab 1.1 resources: Download the 1.1 binaries (peer, orderer, configtxlator) and pull the corresponding Docker images on every node:
    # Pull core images
    docker pull hyperledger/fabric-peer:1.1.0
    docker pull hyperledger/fabric-orderer:1.1.0
    docker pull hyperledger/fabric-tools:1.1.0
    # Add CA/ccenv if you use them
    docker pull hyperledger/fabric-ca:1.1.0
    docker pull hyperledger/fabric-ccenv:1.1.0
    
  • Review configs: Check your configtx.yaml—1.1 adds new features like private data collections, but you can hold off on enabling them until after the upgrade is confirmed stable. Keep existing consensus (solo/kafka) and network configs intact for now.
2. Upgrade Orderer Cluster First

Orderers are the network’s core, so upgrade them one at a time to avoid cluster downtime:

  • For each orderer node:
    1. Stop and remove the old container:
      docker stop orderer.example.com
      docker rm orderer.example.com
      
    2. Launch the 1.1 orderer, reusing your existing data and config mounts (your 1.0.x orderer.yaml is fully compatible with 1.1):
      docker run -d \
        --name orderer.example.com \
        -v /var/hyperledger/production/orderer:/var/hyperledger/production/orderer \
        -v $(pwd)/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/msp \
        -v $(pwd)/config:/var/hyperledger/config \
        -p 7050:7050 \
        hyperledger/fabric-orderer:1.1.0 \
        orderer
      
    3. Verify it’s running properly by checking logs:
      docker logs -f orderer.example.com
      
      Look for messages confirming it’s connected to peers and syncing blocks with other orderers.
  • Wait until all orderers are upgraded and the cluster is stable before moving to peers.
3. Upgrade Peer Nodes

Upgrade peers one at a time (or one per organization at a time) to keep your network operational during the process:

  • For each peer node:
    1. Stop and remove the old container:
      docker stop peer0.org1.example.com
      docker rm peer0.org1.example.com
      
    2. Launch the 1.1 peer, reusing your existing data and configs (1.0.x core.yaml works with 1.1):
      docker run -d \
        --name peer0.org1.example.com \
        -v /var/hyperledger/production:/var/hyperledger/production \
        -v $(pwd)/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/var/hyperledger/msp \
        -v $(pwd)/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/var/hyperledger/tls \
        -v $(pwd)/config:/var/hyperledger/config \
        -p 7051:7051 -p 7052:7052 -p 7053:7053 \
        hyperledger/fabric-peer:1.1.0 \
        peer node start
      
    3. Check logs to confirm the peer joins the channel, syncs blocks, and connects to orderers:
      docker logs -f peer0.org1.example.com
      
  • After upgrading one peer, test chaincode queries and transactions to ensure everything works before moving to the next.

If you want to use 1.1 features like private data, you’ll need to upgrade your chaincode:

  1. Package the chaincode with the 1.1 peer tool:
    peer chaincode package -n mycc -v 1.1 -p github.com/chaincode/mycc/
    
  2. Install the new package on all peers:
    peer chaincode install mycc_1.1.tar.gz
    
  3. Upgrade the chaincode on your channel:
    peer chaincode upgrade -o orderer.example.com:7050 -C mychannel -n mycc -v 1.1 -c '{"Args":["init"]}'
    
  • Note: 1.0.x chaincodes will run fine on 1.1 peers, so this is only necessary if you need new features.
5. Upgrade Client Tools & SDKs

Don’t forget the client side:

  • Replace your local peer, configtxlator, and cryptogen binaries with 1.1 versions.
  • Upgrade your Fabric SDK (Node.js, Java, Go, etc.) to 1.1 to ensure compatibility with the new network.
6. Verify the Upgrade

Double-check everything is working as expected:

  • Check peer version:
    peer version
    
    You should see Version: 1.1.0 (or your specific 1.1 patch release).
  • Check orderer version:
    docker exec orderer.example.com orderer version
    
  • Run end-to-end tests: Execute chaincode queries, transactions, and channel updates to confirm no functionality is broken.
  • Scan all node logs for errors or warnings.
7. Rollback Plan (Just in Case)

If something goes wrong during the upgrade:

  1. Stop the new 1.1 container immediately.
  2. Launch the original 1.0.x container using your backed-up data directory and configs.
  3. Restore the network to its pre-upgrade state and troubleshoot before trying again.

内容的提问来源于stack exchange,提问作者christo4ferris

火山引擎 最新活动