无法连接到 http://localhost:5984/_utils

Cannot connect to http://localhost:5984/_utils

在 Hyperledger Fabric 教程的创建和加入频道之后,我已成功创建并加入频道。我按照 Using CouchDB 的说明与 marbles02 链码交互,没有错误。

但是,我无法通过浏览器导航到 http://localhost:5984/_utils 通过 CouchDB 网络界面查看状态数据库。

我是否遗漏了任何设置网络的步骤?

如果您检查 docker-compose-couch.yaml,您会发现端口已映射到主机:

  couchdb1:
    container_name: couchdb1
    image: hyperledger/fabric-couchdb
    # Comment/Uncomment the port mapping if you want to hide/expose the CouchDB service,
    # for example map it to utilize Fauxton User Interface in dev environments.
    ports:
      - "6984:5984"

在这种情况下,撰写文件将主机上的默认 CouchDB 端口 5984 映射到 6984。如果要检查本示例中启动的容器中的 CouchDB 运行,请在浏览器中打开 http://localhost:6984/_utils/

在VirtualBox上设置端口映射,以下步骤仅供参考。

  1. 启动 VirtualBox 管理器。
  2. Select 运行 虚拟机称为“默认”。点击“设置”。 Select“网络”。
  3. 打开“高级”部分,然后单击“端口转发”。
  4. 点击“添加新的端口转发规则”按钮。然后将 Host Port 设置为 6984,Guest Port 设置为 5984,如 the screenshot.