mysql - 如何在 Hyperledger Fabric-ca 中将 Mysql 添加为数据库?
问题描述
我想将我的应用程序投入生产,因此我想在fabric-ca中添加mysql作为数据库。有人试过吗?我已经坚持了一个星期,在互联网上找不到任何东西。
解决方案
为什么是 mysql 而不是 PostgreSQL 的设计目的?
就像是...
# docker-compose.yaml
version: '2.4'
services:
postgres:
image: postgres:10.3-alpine
restart: unless-stopped
environment:
- POSTGRES_DB=ca
- POSTGRES_USER=admin_postgres
- POSTGRES_PASSWORD=admin_postgres_password
volumes:
- /volumes/ca_postgres:/var/lib/postgresql/data
fabric-ca:
image: hyperledger/fabric-ca:1.4
restart: unless-stopped
environment:
- FABRIC_CA_SERVER_PORT=7054
- FABRIC_CA_HOME=/root/home
volumes:
- /volumes/ca_home:/root/home
ports:
- 7054:7054
您必须事先将您的 fabric-ca-server-config.yaml 准备到您的 FABRIC_CA_HOME 中:
# fabric-ca-server-config.yaml
# ...
db:
type: postgres
datasource: host=postgres port=5432 user=admin_postgres password=admin_postgres_password dbname=ca sslmode=disable
# ...
推荐阅读
- graphql - graphql where 子句 Angular Apollo 客户端
- javascript - 如何将javascript变量的值传递给java变量
- marklogic - 更新到 DataHub 框架 4.1.0 后 Writer.sjs 中的 XDMP-CONFLICTINGUPDATES 错误
- java - Android:即使对象在屏幕上,RecyclerView `getChildAt()` 也会返回 null
- ruby-on-rails - 创建一个包含 has_many 关联的索引
- javascript - 图片在悬停时在其旁边显示文字
- c# - 将数组传递给 ASP.NET Core 中的数据属性
- django - 排序时:“NoneType”和“str”的实例之间不支持“<”
- python - 将多个值评估为一个条件
- c# - 如何将复杂的键值参数表单视图传递给mvc中的控制器?