简体   繁体   中英

Can't have multiple fiware/orion-ld docker images on the same server

I am successfully running a fiware/orion-ld docker image on my server using this docker-compose.yml file:

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: ~

On another directory I have created a second docker-compose.yml file in order to start a second fiware/orion-ld server in order to check if I can have multiple docker orion-ld images on the same server. This is my secondary docker-compose.yml file:

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: ~

Although it starts, in the end I get this:

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

It seems that I can't have a second copy of fiware/orion-ld image running on another port (other than 1026). Is that so? Am I doing something wrong?

(using centOS 7)

There's no problem starting more than one instance or Orion-LD (or Orion for that matter) in the same machine. For help, use the -u CLI. Take special care about the database you want the second instance to use. The same or some other database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM