每个主机的多个vespa docker容器?

问题描述 投票:1回答:1

PB:我曾尝试在两个不同的主机上部署5个vespa容器,但我没有成功使我的vespa节点上升。

我将第3个容器vespa0,vespa1,vespa2分别命名为第一个主机上的端口8080,8081,8082,vespa3分别命名为vespa4,端口8080,8081

我用这种方式启动vespa容器

sudo docker run --detach --net=host --name vespa0 --hostname admin_paul0 --privileged --volume $PWD/sample-apps:/vespa-sample-apps --publish 8080:8080 vespaengine/vespa

然后我部署应用程序:

sudo docker exec vespa0 bash -c '/opt/vespa/bin/vespa-deploy prepare /vespa-sample-apps/site_search_multi_node_on_multi_server/src/main/application && /opt/vespa/bin/vespa-deploy activate'

当我写命令

sudo docker exec vespa0 bash -c '/opt/vespa/bin/vespa-get-cluster-state'

群集检测到两台主机上的节点,但只有一台已启动。

Cluster site:
site/distributor/0: down
site/distributor/1: down
site/distributor/3: down
site/distributor/4: up
site/storage/0: down
site/storage/1: down
site/storage/3: down
site/storage/4: up

特此申请的配置

host.hml

    <?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
    <hosts>
     <host name="admin_paul0">
    <alias>admin_paul0</alias>
  </host>

  <host name="stateless_paul0">
    <alias>stateless_paul0</alias>
  </host>

  <host name="content_paul0">
    <alias>content_paul0</alias>
  </host>

  <host name="content_paul1">
    <alias>content_paul1</alias>
  </host>

  <host name="stateless_paul1">
    <alias>stateless_paul1</alias>
  </host>
</hosts>

的services.xml

<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
<services version="1.0">
  <admin version="2.0">
    <adminserver hostalias="admin_paul0"/>
    <configservers>
      <configserver hostalias="admin_paul0"/>
    </configservers>
  </admin>

  <container id="container" version="1.0">
    <document-api/>
    <search/>
    <nodes>
      <node hostalias="stateless_paul0"/>
      <node hostalias="stateless_paul1"/>
      <node hostalias="content_paul0"/>
      <node hostalias="content_paul1"/>
    </nodes>
  </container>

  <content id="site" version="1.0">
    <redundancy>1</redundancy>
    <documents>
      <document type="site" mode="index"/>
    </documents>
    <nodes>
      <node hostalias="content_paul0" distribution-key="0"/>
      <node hostalias="content_paul1" distribution-key="1"/>
      <node hostalias="stateless_paul0" distribution-key="3"/>
      <node hostalias="stateless_paul1" distribution-key="4"/>
    </nodes>
  </content>
</services>

你有什么提示可以使它工作吗? :)

docker vespa
1个回答
4
投票

您必须隔离网络以使其工作,因为Vespa使用一系列其他冲突的端口(即没有--net = host)。在裸机主机上运行,​​您可以使用macvlan网络驱动程序为容器分配跨主机IP,否则您需要设置NPT或类似的东西。

© www.soinside.com 2019 - 2024. All rights reserved.