如何在Hyperledger Fabric中执行"peer node pause"命令?



如果我运行这个命令peer node pause -c mychannel,会出现以下错误;

Error: as another peer node command is executing, wait for that command to complete its execution or terminate it before retrying: lock is already acquired on file /var/hyperledger/production/ledgersData/fileLock
Usage:
peer node pause [flags]
Flags:
-c, --channelID string   Channel to pause.
-h, --help               help for pause
/opt/gopath/src/github.com/hyperledger/fabric/peer # peer node pause -h
Pauses a channel on the peer. When the command is executed, the peer must be offline. When the peer starts after a pause, it will not receive blocks for the paused channel.

I理解执行此命令需要对等体处于离线状态。但是我怎样才能让同伴脱机呢?没有Peer node stop这样的命令。我看到的唯一方法是使用docker命令来停止容器,但这没有任何意义,因为如果我停止容器,我将无法进入容器。

谁来帮我执行peer node pause命令!

检出启动容器的命令。

peer0.org1.example.com:
container_name: peer0.org1.example.com
image: hyperledger/fabric-peer:latest
labels:
service: hyperledger-fabric
environment:
#Generic peer variables
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=fabric_test
- FABRIC_LOGGING_SPEC=INFO
#- FABRIC_LOGGING_SPEC=DEBUG
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
# Peer specific variabes
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_CHAINCODEADDRESS=peer0.org1.example.com:7052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_PEER_LOCALMSPID=Org1MSP
volumes:
- /var/run/docker.sock:/host/var/run/docker.sock
- ../organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ../organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
- peer0.org1.example.com:/var/hyperledger/production
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start
ports:
- 7051:7051
networks:
- test

使用命令启动对等容器时:peer node start命令。根据fabric文档,peer node start命令—启动一个与网络交互的节点。因此,当您启动容器时,节点正在启动,我还没有尝试过,但是您可以使用peer node pause -c mychannel替换该命令,因为节点尚未启动,这意味着对等体处于脱机状态。你可以试试这个

相关内容

  • 没有找到相关文章

最新更新