错误!错误! hosts_kafka.yml:5:期望的键=值主机变量分配,得到:本地

时间:2019-06-11 07:34:59

标签: hyperledger-fabric hyperledger

我正在使用最新的 Altoros / Ansible-Fabric-Starter ,并且在运行 ansible-playbook install-python.yml -i hosts_kafka.yml 时,它在终端中显示一条错误消息:错误!错误! hosts_kafka.yml:5:预期的key = value主机变量分配,得到:local 我正在本地系统上运行它。这是我的卡夫卡。 yml

all:
  hosts:
    localhost: # localhost connection parameters, used for storing configuration while transferring it between nodes
      ansible_connection: local
  vars:
    domain: example.com
    additional_channels: # optional, common channels are created by default. Just comment it out, if you don't need additional channels.
      - name: a-b # channel name
        particapants: # Organizations, should be included in channel
        - a
        - b
      - name: a-c
        particapants:
        - a
        - c
      - name: b-c
        particapants:
        - b
        - c
    orderer_type: kafka  # Enable kafka orderer, we'll have 4 brokers and 3 zookeepers.
    orderer_count: 3 # Amount of orderers in network, assumed that it equals to amount of organization, so each org will have an own orderer copy
    kafka_replicas: 2 # Set kafka_replicas parameter
    kafka_replication_factor: 3 # Set kafka_replication_factor parameter (https://hyperledger-fabric.readthedocs.io/en/release-1.2/kafka.html)
  children:
    nodes:
      hosts:
        kafka.example.com: # Describes which containers will run on this node
          node_roles:
            - zookeeper # Apache zookeeper instance
            - kafka_broker # Apache kafka instance
          org: kafka # Organization name
          zookeeper_id: 0 # ID for zookeeper
          kafka_broker_id: 0 # ID for kafka-broker
          ansible_host: 172.16.16.1 # Real ip address or domain name of the machine
          ansible_user: username  # User with sudo access
          ansible_private_key_file: ~/path-to-private-key # Private key to identify ourselves
          ansible_ssh_port: 22 # Specify ssh-port here, if case of it's not defaulted.
        # Same structure for any other nodes
        a.example.com:
          node_roles:
            - root_orderer # This node will be used to generate crypto-config for other orderers
            - orderer # This node will host an orderer-service
            - peer # This node will host peers and api containers for organization
            - root_peer # This node will be used to create channels and instantiate chaincode
            - zookeeper # Hosts zookeeper container for kafka-cluster
            - kafka_broker # Hosts broker container for kafka-cluster
            - explorer
          org: a
          orderer_id: 0 # ID of orderer-service which is running on this host
          zookeeper_id: 1
          kafka_broker_id: 1
          ansible_host: 172.16.16.2
          ansible_user: username
          ansible_private_key_file: ~/path-to-private-key
          ansible_ssh_port: 22
        b.example.com:
          node_roles:
            - orderer
            - peer
            - zookeeper
            - kafka_broker
          org: b
          orderer_id: 1
          zookeeper_id: 2
          kafka_broker_id: 2
          ansible_host: 172.16.16.3
          ansible_user: username
          ansible_private_key_file: ~/path-to-private-key
          ansible_ssh_port: 22
        c.example.com: # This node will host only kafka-broker and peer.
          node_roles:
            - peer
            - orderer
            - kafka_broker
          org: c
          orderer_id: 2
          kafka_broker_id: 3
          ansible_host: 172.16.16.4
          ansible_user: username
          ansible_private_key_file: ~/path-to-private-key
          ansible_ssh_port: 22

1 个答案:

答案 0 :(得分:1)

您好,我经过研究后在这里找到了答案,我发现可以通过重新安装 ansible 2.5.0 + 来解决此问题,您已完成。