PB:我试图在两个不同的主机上部署5个vespa容器,但是我没有成功建立我的vespa节点。
我在第一个主机上分别命名了3个容器vespa0,vespa1,vespa2和端口8080、8081和vespa4,分别具有端口8080、8081和8082
我这样启动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.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. -->
<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>
您有什么技巧可以使它起作用吗? :)
最佳答案
您必须隔离网络才能使此工作正常进行,因为Vespa会使用其他可能会冲突的其他端口范围(即--net = host)。在裸机主机上运行,您可以使用macvlan网络驱动程序为容器分配跨主机ip,否则您需要设置NPT或类似的东西。
关于docker - 每个主机有多个vespa docker容器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49115584/