2017-10-10 67 views
1

我試圖將Fabric配置爲在Kubernetes集羣內工作,雖然我有所有東西站起來,但我卻在網絡中部署鏈式代碼(使用composer-cli)。看來鏈代碼容器不能看到創建它們的對等體。正確配置Kubernetes中的Fabric Peers

2017-10-10 20:51:12.590 UTC [ccprovider] NewCCContext -> DEBU 437 NewCCCC (chain=lynnhurst,chaincode=lynnhurst-composer,version=0.13.2,txid=14cc34b63f20838b904116a03d39fba2a0eabf8ab7076f51982c746a17c667f1,syscc=false,proposal=0xc42195c0f0,canname=lynnhurst-composer:0.13.2 
2017-10-10 20:51:12.605 UTC [chaincode] Launch -> DEBU 438 launchAndWaitForRegister fetched 2902002 bytes from file system 
2017-10-10 20:51:12.605 UTC [chaincode] launchAndWaitForRegister -> DEBU 439 chaincode lynnhurst-composer:0.13.2 is being launched 
2017-10-10 20:51:12.605 UTC [chaincode] getArgsAndEnv -> DEBU 43a Executable is chaincode 
2017-10-10 20:51:12.605 UTC [chaincode] getArgsAndEnv -> DEBU 43b Args [chaincode -peer.address=peer-0.peer:7052] 
2017-10-10 20:51:12.605 UTC [chaincode] launchAndWaitForRegister -> DEBU 43c start container: lynnhurst-composer:0.13.2(networkid:dev,peerid:peer-0.peer) 
2017-10-10 20:51:12.605 UTC [chaincode] launchAndWaitForRegister -> DEBU 43d start container with args: chaincode -peer.address=peer-0.peer:7052 
2017-10-10 20:51:12.605 UTC [chaincode] launchAndWaitForRegister -> DEBU 43e start container with env: 
    CORE_CHAINCODE_ID_NAME=lynnhurst-composer:0.13.2 
    CORE_PEER_TLS_ENABLED=true 
    CORE_CHAINCODE_LOGGING_LEVEL=info 
    CORE_CHAINCODE_LOGGING_SHIM=warning 
    CORE_CHAINCODE_LOGGING_FORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message} 
2017-10-10 20:51:12.605 UTC [container] lockContainer -> DEBU 43f waiting for container(dev-peer-0.peer-lynnhurst-composer-0.13.2) lock 
2017-10-10 20:51:12.605 UTC [container] lockContainer -> DEBU 440 got container (dev-peer-0.peer-lynnhurst-composer-0.13.2) lock 
2017-10-10 20:51:12.606 UTC [dockercontroller] Start -> DEBU 441 Cleanup container dev-peer-0.peer-lynnhurst-composer-0.13.2 
2017-10-10 20:51:12.607 UTC [dockercontroller] stopInternal -> DEBU 442 Stop container dev-peer-0.peer-lynnhurst-composer-0.13.2(No such container: dev-peer-0.peer-lynnhurst-composer-0.13.2) 
2017-10-10 20:51:12.608 UTC [dockercontroller] stopInternal -> DEBU 443 Kill container dev-peer-0.peer-lynnhurst-composer-0.13.2 (No such container: dev-peer-0.peer-lynnhurst-composer-0.13.2) 
2017-10-10 20:51:12.609 UTC [dockercontroller] stopInternal -> DEBU 444 Remove container dev-peer-0.peer-lynnhurst-composer-0.13.2 (No such container: dev-peer-0.peer-lynnhurst-composer-0.13.2) 
2017-10-10 20:51:12.609 UTC [dockercontroller] Start -> DEBU 445 Start container dev-peer-0.peer-lynnhurst-composer-0.13.2 
2017-10-10 20:51:12.609 UTC [dockercontroller] getDockerHostConfig -> DEBU 446 docker container hostconfig NetworkMode: bridge 
2017-10-10 20:51:12.610 UTC [dockercontroller] createContainer -> DEBU 447 Create container: dev-peer-0.peer-lynnhurst-composer-0.13.2 
2017-10-10 20:51:12.648 UTC [dockercontroller] createContainer -> DEBU 448 Created container: dev-peer-0.peer-lynnhurst-composer-0.13.2-49b014bf4f406b2b248c840a95c16be5a45845e67e4f7c1af9a5e7b7e69037bf 
2017-10-10 20:51:12.836 UTC [dockercontroller] Start -> DEBU 449 Started container dev-peer-0.peer-lynnhurst-composer-0.13.2 
2017-10-10 20:51:12.836 UTC [container] unlockContainer -> DEBU 44a container lock deleted(dev-peer-0.peer-lynnhurst-composer-0.13.2) 
2017-10-10 20:51:12.955 UTC [dev-peer-0.peer-lynnhurst-composer-0.13.2] func2 -> INFO 44b 2017-10-10 20:51:12.955 UTC [Composer] Info -> INFO 001 Setting the Composer pool size to 8 
2017-10-10 20:51:15.957 UTC [dev-peer-0.peer-lynnhurst-composer-0.13.2] func2 -> INFO 44c 2017-10-10 20:51:15.956 UTC [shim] userChaincodeStreamGetter -> ERRO 002 Error trying to connect to local peer: context deadline exceeded 
2017-10-10 20:51:16.001 UTC [dockercontroller] func2 -> INFO 44d Container dev-peer-0.peer-lynnhurst-composer-0.13.2 has closed its IO channel 
2017-10-10 20:56:12.567 UTC [eventhub_producer] validateEventMessage -> DEBU 44e ValidateEventMessage starts for signed event 0xc421507680 
2017-10-10 20:56:12.569 UTC [eventhub_producer] deRegisterHandler -> DEBU 44f deregistering event type: BLOCK 
2017-10-10 20:56:12.578 UTC [eventhub_producer] Chat -> ERRO 450 error during Chat, stopping handler: rpc error: code = Canceled desc = context canceled 
2017-10-10 20:56:12.836 UTC [chaincode] launchAndWaitForRegister -> DEBU 451 stopping due to error while launching Timeout expired while starting chaincode lynnhurst-composer:0.13.2(networkid:dev,peerid:peer-0.peer,tx:14cc34b63f20838b904116a03d39fba2a0eabf8ab7076f51982c746a17c667f1) 
2017-10-10 20:56:12.836 UTC [container] lockContainer -> DEBU 452 waiting for container(dev-peer-0.peer-lynnhurst-composer-0.13.2) lock 
2017-10-10 20:56:12.836 UTC [container] lockContainer -> DEBU 453 got container (dev-peer-0.peer-lynnhurst-composer-0.13.2) lock 
2017-10-10 20:56:12.837 UTC [dockercontroller] stopInternal -> DEBU 454 Stop container dev-peer-0.peer-lynnhurst-composer-0.13.2(Container not running: dev-peer-0.peer-lynnhurst-composer-0.13.2) 
2017-10-10 20:56:12.838 UTC [dockercontroller] stopInternal -> DEBU 455 Kill container dev-peer-0.peer-lynnhurst-composer-0.13.2 (API error (500): {"message":"Cannot kill container dev-peer-0.peer-lynnhurst-composer-0.13.2: Container db3e259d3c98fbb97a10a100724b71f861a7ee6b60317686329e1e6439be1ebd is not running"} 
) 
2017-10-10 20:56:12.843 UTC [dockercontroller] stopInternal -> DEBU 456 Removed container dev-peer-0.peer-lynnhurst-composer-0.13.2 
2017-10-10 20:56:12.843 UTC [container] unlockContainer -> DEBU 457 container lock deleted(dev-peer-0.peer-lynnhurst-composer-0.13.2) 
2017-10-10 20:56:12.844 UTC [chaincode] launchAndWaitForRegister -> DEBU 458 error on stop Error stopping container: context canceled(Timeout expired while starting chaincode lynnhurst-composer:0.13.2(networkid:dev,peerid:peer-0.peer,tx:14cc34b63f20838b904116a03d39fba2a0eabf8ab7076f51982c746a17c667f1)) 
2017-10-10 20:56:12.844 UTC [chaincode] func1 -> DEBU 459 chaincode lynnhurst-composer:0.13.2 launch seq completed 
2017-10-10 20:56:12.844 UTC [chaincode] Launch -> ERRO 45a launchAndWaitForRegister failed Timeout expired while starting chaincode lynnhurst-composer:0.13.2(networkid:dev,peerid:peer-0.peer,tx:14cc34b63f20838b904116a03d39fba2a0eabf8ab7076f51982c746a17c667f1) 
2017-10-10 20:56:12.844 UTC [endorser] callChaincode -> DEBU 45b Exit 
2017-10-10 20:56:12.844 UTC [endorser] simulateProposal -> ERRO 45c failed to invoke chaincode name:"lscc" on transaction 14cc34b63f20838b904116a03d39fba2a0eabf8ab7076f51982c746a17c667f1, error: Timeout expired while starting chaincode lynnhurst-composer:0.13.2(networkid:dev,peerid:peer-0.peer,tx:14cc34b63f20838b904116a03d39fba2a0eabf8ab7076f51982c746a17c667f1) 
2017-10-10 20:56:12.844 UTC [endorser] simulateProposal -> DEBU 45d Exit 
2017-10-10 20:56:12.844 UTC [lockbasedtxmgr] Done -> DEBU 45e Done with transaction simulation/query execution [f693a082-3404-4f01-98a1-bed5c3f6b24e] 
2017-10-10 20:56:12.844 UTC [endorser] ProcessProposal -> DEBU 45f Exit 

我的配置目前安裝在主機的/var/run文件夾/host/var/run並設置CORE_VM_DOCKER_ENDPOINT=unix:///host/var/run/docker.sock。我目前有CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=bridge,但我不確定這是否是正確的設置(我試過host)以允許這些鏈碼容器連接到對等設備。任何提示將不勝感激。

面料版本1.0.3,作曲版本0.13.2

+0

它實際上是相反的,對等不能看到它創建鏈碼圖像,但看我爲進一步詳細的回答。 – PassKit

回答

2

我能得到這個工作,通過配置參數的組合:

CORE_PEER_ADDRESSAUTODETECT=true 
CORE_PEER_TLS_SERVERHOSTOVERRIDE=%(hostname).peer 

此外,我需要確保不設置爲CORE_PEER_CHAINCODELISTENADDRESS,以便將對等方的實際IP傳遞給鏈碼容器。