kubernetes (minikube) 中的 Fabric v2.0 - 问题 运行 docker inside for 运行 chaincode
Fabric v2.0 in kubernetes (minikube) - problem running docker inside peer for running chaincode
我正在尝试 运行 Kubernetes 中的 Fabric 2.0 测试网络(在本地,在 minikube 中),并且我面临着安装或 运行 链码由同行安装或 运行 的问题(似乎在 docker 容器中。
我基于 docker-compose-test-net.yaml 创建了 kubernetes 文件并成功部署了网络,生成了密码 material,创建并加入了频道,安装了节点上的链码,提交了它的定义。但是当我尝试调用它时,出现以下错误:
Error: endorsement failure during invoke. response: status:500 message:"error in simulation:
failed to execute transaction 68e996b0d17c210af9837a78c0480bc7ba0c7c0f84eec7da359a47cd1f5c704a:
could not launch chaincode fabcar_01:bb76beb676a23a9be9eb377a452baa4b756cb1dc3a27acf02ecb265e1a7fd3df:
chaincode registration failed: container exited with 0"
我在那个 pastebin 中包含了对等点的日志。我们可以在那里看到它启动了容器,但是我不明白它发生了什么:https://pastebin.com/yrMwG8Nd
然后我按照此处的说明进行了尝试:https://github.com/IBM/blockchain-network-on-kubernetes/issues/27。他们说的地方
IKS v1.11 and onwards now use containerd as its container runtime
instead of the docker engine therefore using docker.sock is no longer
possible.
并且他们建议使用 that file and that file 部署一个 docker pod (dind) 并将 unix:///host/var/run/docker.sock 的出现更改为 tcp://docker:2375.
但是当我尝试安装链代码时出现以下错误:
Error: chaincode install failed with status:
500 - failed to invoke backing implementation of 'InstallChaincode':
could not build chaincode:
docker build failed:
docker image inspection failed:
cannot connect to Docker endpoint
所以它似乎无法连接到 Docker 端点。但是我找不到解决方法。
如果你有想法,那会很有帮助!
我发现了我的问题:
对于同行,我是这样设置的:
- name: CORE_PEER_CHAINCODEADDRESS
value: peer0-org1-example-com:7052
- name: CORE_PEER_CHAINCODELISTENADDRESS
value: 0.0.0.0:7052
就像他们使用 docker-compose 对测试网络所做的那样。
删除那些使其工作。我想这对于 docker-compose 设置很重要,但对于 kubernetes 来说还不够。
我正在尝试 运行 Kubernetes 中的 Fabric 2.0 测试网络(在本地,在 minikube 中),并且我面临着安装或 运行 链码由同行安装或 运行 的问题(似乎在 docker 容器中。
我基于 docker-compose-test-net.yaml 创建了 kubernetes 文件并成功部署了网络,生成了密码 material,创建并加入了频道,安装了节点上的链码,提交了它的定义。但是当我尝试调用它时,出现以下错误:
Error: endorsement failure during invoke. response: status:500 message:"error in simulation:
failed to execute transaction 68e996b0d17c210af9837a78c0480bc7ba0c7c0f84eec7da359a47cd1f5c704a:
could not launch chaincode fabcar_01:bb76beb676a23a9be9eb377a452baa4b756cb1dc3a27acf02ecb265e1a7fd3df:
chaincode registration failed: container exited with 0"
我在那个 pastebin 中包含了对等点的日志。我们可以在那里看到它启动了容器,但是我不明白它发生了什么:https://pastebin.com/yrMwG8Nd
然后我按照此处的说明进行了尝试:https://github.com/IBM/blockchain-network-on-kubernetes/issues/27。他们说的地方
IKS v1.11 and onwards now use containerd as its container runtime instead of the docker engine therefore using docker.sock is no longer possible.
并且他们建议使用 that file and that file 部署一个 docker pod (dind) 并将 unix:///host/var/run/docker.sock 的出现更改为 tcp://docker:2375.
但是当我尝试安装链代码时出现以下错误:
Error: chaincode install failed with status:
500 - failed to invoke backing implementation of 'InstallChaincode':
could not build chaincode:
docker build failed:
docker image inspection failed:
cannot connect to Docker endpoint
所以它似乎无法连接到 Docker 端点。但是我找不到解决方法。
如果你有想法,那会很有帮助!
我发现了我的问题:
对于同行,我是这样设置的:
- name: CORE_PEER_CHAINCODEADDRESS
value: peer0-org1-example-com:7052
- name: CORE_PEER_CHAINCODELISTENADDRESS
value: 0.0.0.0:7052
就像他们使用 docker-compose 对测试网络所做的那样。
删除那些使其工作。我想这对于 docker-compose 设置很重要,但对于 kubernetes 来说还不够。