我有一个基于工作对接的安装-对等程序,订单和浏览器(db & app),我的目标是部署在上。
对于对等程序和排序器,我使用了对接器映像并创建了Kubernetes yaml文件(StatefulSet、Service、NodePort和I)来部署在kubernetes上。
对于资源管理器,我有下面的停靠-合成文件,这取决于我的本地连接配置文件和密码文件。
我正努力在kubernetes上部署探险者,并寻求有关方法的建议。
有关于如何在集群中部署资源管理器的建议或示例吗?
谢谢
资源管理器Docker组成
version: '2.1'
volumes:
pgdata:
walletstore:
networks:
mynetwork.com:
external:
name: my-netywork
services:
explorerdb.mynetwork.com:
image: hyperledger/explorer-db:latest
container_name: explorerdb.mynetwork.com
hostname: explorerdb.mynetwork.com
environment:
- DATABASE_DATABASE=fabricexplorer
- DATABASE_USERNAME=hppoc
- DATABASE_PASSWORD=password
healthcheck:
test: "pg_isready -h localhost -p 5432 -q -U postgres"
interval: 30s
timeout: 10s
retries: 5
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- mynetwork.com
explorer.mynetwork.com:
image: hyperledger/explorer:latest
container_name: explorer.mynetwork.com
hostname: explorer.mynetwork.com
environment:
- DATABASE_HOST=explorerdb.mynetwork.com
- DATABASE_DATABASE=fabricexplorer
- DATABASE_USERNAME=hppoc
- DATABASE_PASSWD=password
- LOG_LEVEL_APP=info
- LOG_LEVEL_DB=info
- LOG_LEVEL_CONSOLE=debug
- LOG_CONSOLE_STDOUT=true
- DISCOVERY_AS_LOCALHOST=false
volumes:
- ./config.json:/opt/explorer/app/platform/fabric/config.json
- ./connection-profile:/opt/explorer/app/platform/fabric/connection-profile
- ../config/crypto-config:/tmp/crypto
- walletstore:/opt/explorer/wallet
ports:
- 8080:8080
depends_on:
explorerdb.mynetwork.com:
condition: service_healthy
networks:
- mynetwork.com资源管理器文档文件-多来自
# Updated to Fabric 2.x
#1. Docker file for setting up the Orderer
# FROM hyperledger/fabric-orderer:1.4.2
FROM hyperledger/explorer-db:latest
ENV DATABASE_DATABASE=fabricexplorer
ENV DATABASE_USERNAME=hppoc
ENV DATABASE_PASSWORD=password
FROM hyperledger/explorer:latest
COPY ./config/explorer/. /opt/explorer/
COPY ./config/crypto-config/. /tmp/crypto
ENV DATABASE_HOST=explorerdb.xxx.com
ENV DATABASE_DATABASE=fabricexplorer
ENV DATABASE_USERNAME=hppoc
ENV DATABASE_PASSWD=password
ENV LOG_LEVEL_APP=info
ENV LOG_LEVEL_DB=info
ENV LOG_LEVEL_CONSOLE=debug
ENV LOG_CONSOLE_STDOUT=true
ENV DISCOVERY_AS_LOCALHOST=false
ENV DISCOVERY_AS_LOCALHOST=false
# ENV EXPLORER_APP_ROOT=${EXPLORER_APP_ROOT:-dist}
# ENV ${EXPLORER_APP_ROOT}/main.js name - hyperledger-explorer
ENTRYPOINT ["tail", "-f", "/dev/null"]发布于 2022-02-17 00:46:02
此设置有两组必需的步骤。我测试过的一个是:
1.创建K8s集群
2.将集群与云外壳连接起来
3.克隆这个存储库
git clone https://github.com/acloudfan/HLF-K8s-Cloud.git4.设置存储类
cd HLF-K8s-Cloud/gcp kubectl apply -f . This will setup the storage class5.启动Acme订单程序
cd .. kubectl apply -f ./k8s-acme-orderer.yaml Check the logs for 'acme-orderer-0' to ensure there is no error6.启动Acme Peer
kubectl apply -f ./k8s-acme-peer.yaml Check the logs for 'acme-peer-0' to ensure there is no error7.建立频道,并与之连接。
kubectl exec -it acme-peer-0 /bin/bash ./submit-channel-create.sh
./join-channel.sh确保对等方已加入该通道
peer channel list
exit8.启动预算伙伴并将其加入频道
kubectl apply -f ./k8s-budget-peer.yaml Wait for the container to launch & check the logs for errors
kubectl exec -it budget-peer-0 /bin/bash ./fetch-channel-block.sh ./join-channel.sh确保对等方已加入该通道
peer channel list
exit ** At this point your K8s Fabric Network is up **验证网络
1.安装并实例化测试链代码
kubectl exec -it acme-peer-0 /bin/bash
./cc-test.sh install ./cc-test.sh instantiate2.调用/查询链码以查看a/b值的变化
./cc-test.sh query ./cc-test.sh invoke3.检查预算同行中的值
kubectl exec -it acme-peer-0 /bin/bash
./cc-test.sh install
./cc-test.sh query The query should return the same values as you see in acme-peer Execute invoke/query in both peers to validate此外,您还可以访问以下线程,查看选项2和有关设置环境基于GKE的生产网络、HLF-K8s-云、Google Kubernetes引擎上超分类器结构块链的部署和超级分类账/织物同行的适当步骤的更多引用。
https://stackoverflow.com/questions/71147402
复制相似问题