同一服务器上不能有多个fiware / orion-ld docker映像

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

我正在使用此fiware/orion-ld文件在服务器上成功运行docker-compose.yml docker映像:

version: "3.5"
services:
 orion:
  image: fiware/orion-ld
  hostname: orion
  container_name: fiware-orion
  depends_on:
   - mongo-db
  expose:
   - "1026"
  ports:
   - "1026:1026"
  command: -dbhost mongo-db -logLevel DEBUG
  healthcheck:
   test: curl --fail -s http://orion:1026/version || exit 1

 mongo-db:
  image: mongo:3.6
  hostname: mongo-db
  container_name: db-mongo
  expose:
    - "27017"
  ports:
    - "27017:27017"
  command: --nojournal
  volumes:
    - mongo-db:/data

volumes:
  mongo-db: ~

[在另一个目录上,我创建了第二个docker-compose.yml文件,以启动第二个fiware/orion-ld服务器,以检查我是否可以在同一服务器上拥有多个docker orion-ld映像。这是我的辅助docker-compose.yml文件:

version: "3.5"
services:
 orion:
  image: fiware/orion-ld
  hostname: orion-test
  container_name: fiware-orion-test
  depends_on:
   - mongo-db
  expose:
   - "1021"
  ports:
   - "1021:1021"
  command: -dbhost mongo-db -logLevel DEBUG
  healthcheck:
   test: curl --fail -s http://orion-test:1021/version || exit 1

 mongo-db:
  image: mongo:3.6
  hostname: mongo-db
  container_name: db-mongo-test
  expose:
    - "27011"
  ports:
    - "27011:27011"
  command: --nojournal
  volumes:
    - mongo-db:/data

volumes:
  mongo-db: ~

尽管开始,但最终我得到了:

fiware-orion-test | time=Wednesday 11 Mar 14:34:09 2020.119Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionld.cpp[1108]:main | msg=Startup completed
fiware-orion-test | time=Wednesday 11 Mar 14:34:09 2020.119Z | lvl=WARN | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=orionld.cpp[1114]:main | msg=Initialization ready - accepting requests on port 1026

似乎我无法在另一个端口(不是1026)上运行fiware/orion-ld图像的第二个副本。是这样吗?我做错什么了吗?

((使用centOS 7)

docker docker-compose fiware fiware-orion
1个回答
1
投票

在同一台机器上启动多个实例或Orion-LD(或Orion-LD)是没有问题的。要获得帮助,请使用-u CLI。请特别注意您要使用第二个实例的数据库。相同或其他数据库。

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