网络“hbase”被声明为外部网络,但找不到。在部署堆栈之前,您需要创建一个 swarm 范围的网络

network `hbase` is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed

我在 docker swarm 集群下面。

    $ sudo docker node ls
    ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
    iq7i01ns7ku7zrtaemiucoawi *   master.com          Ready               Active              Leader              19.03.2
    g6mug58tld4aikobdv3ic9p9y     worker1.com         Ready               Active                                  19.03.2
    uc13xcl9ttauzkqdz03kbrewt     worker2.com         Ready               Active                                  19.03.2
    c8uhfvyhhlmuxp2p3ei3ymrj5     worker3.com         Ready               Active                                  19.03.2

我想将 hadoop platform 部署到集群中。

    $ sudo docker stack deploy -c docker-compose-v3.yml hadoop
    network "hbase" is declared as external, but could not be found. You need to create a swarm-scoped network before the stack is deployed

我该如何解决这个错误?

您需要先创建您的网络:

docker network create --driver overlay hbase

在您的 compose 中,您将网络 hbase 指定为 external 但似乎不存在这样的网络