Connecting two instance peers

60 views
Skip to first unread message

William Sleeman

unread,
Sep 3, 2020, 2:53:12 PM9/3/20
to Orthanc Users
I need to run two different instances of Orthanc and send data from one to the other. The documentation seemed pretty clear so I started two Docker containers on the same machine with the following commands and modified key configuration values:

A:

"HttpPort" : 8042
"DicomPort" : 4242
"OrthancPeers" : {
    "peer" : [ "http://127.0.0.1:8043/" ]
}
"RemoteAccessAllowed" : true
"AuthenticationEnabled" : false

docker run -p 4242:4242 -p 8042:8042 --rm -v /tmp/orthancLocal.json:/etc/orthanc/orthanc.json -v orthanc-local-storage:/var/lib/orthanc/db jodogne/orthanc

B:

"HttpPort" : 8043
"DicomPort" : 4243
RemoteAccessAllowed" : true
"AuthenticationEnabled" : false

docker run -p 4243:4243 -p 8043:8043 --rm -v /tmp/orthancLocal2.json:/etc/orthanc/orthanc.json:ro -v orthanc-local-storage2:/var/lib/orthanc/db jodogne/orthanc


After running both A and B, I tried the `curl http://localhost:8042/peers?expand` command and got:

{
   "peer" : {
      "HttpHeaders" : [],
      "Pkcs11" : false,
      "Url" : "http://127.0.0.1:8043/"
   }
}

Then I tried to test the connection with `curl http://localhost:8042/peers/peer/system` and got:

{
   "Details" : "libCURL error: Couldn't connect to server",
   "HttpError" : "Internal Server Error",
   "HttpStatus" : 500,
   "Message" : "Error in the network protocol",
   "Method" : "GET",
   "OrthancError" : "Error in the network protocol",
   "OrthancStatus" : 9,
   "Uri" : "/peers/peer/system"
}

Both A and B versions are up and running but I could not find any information about what might be causing this issue. Any further attempts of sending data via POST also fails as expected. Is there another step I am missing or am I using the peer set up incorrectly?



James Manners

unread,
Sep 3, 2020, 4:50:20 PM9/3/20
to Orthanc Users
Hi William,

The problem is by default docker uses bridge networking and in this mode local host refers to the container itself. Not your host machine. See https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach#24326540 for more info. 

The easiest way to get around this is change localhost to the up address of your host machine. 

Hope that helps. 

James

Binary Logo
James Manners • Director
Suite 3, Level 2, 10 Queens Road, Melbourne, Victoria 3004, Australia

On 4 Sep 2020, at 4:53 am, William Sleeman <wcsl...@mymail.vcu.edu> wrote:

I need to run two different instances of Orthanc and send data from one to the other. The documentation seemed pretty clear so I started two Docker containers on the same machine with the following commands and modified key configuration values:
--
You received this message because you are subscribed to the Google Groups "Orthanc Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orthanc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orthanc-users/fa2fca59-02e0-4fe2-9ef3-c5e71d7b5c7bn%40googlegroups.com.

William Sleeman

unread,
Sep 3, 2020, 5:01:52 PM9/3/20
to Orthanc Users

Thanks James, that was the problem and it looks like everything is working now.
Reply all
Reply to author
Forward
0 new messages