Archived

This forum has been archived. Please start a new discussion on GitHub.

Port forwarding

Hello, I have the next problem:
We have one server(hardware-hw1) and many processes with servants. And they can call each other(on localhost only). Also we have an other server(hardware-hw2). And it is my problem. May I use only one open port on hw1 to async/sync calls? *i'm going to use ssh-tunneling.* I tried to use something like this:
[PHP]
____________________________________
| Servant1
| Servant2 |
| | Req |prx |
| RegManager |Glacier| |
| | | | hw1 |
|
|
|
| | ssh |
| Req |______|
|
| hw2 |
[/PHP]

HW2 send to RegManager Request to get Servant1's Proxy. RegManager resend request to Servant1 and it through Glacier send own Proxy to HW2(create session and call function of hw2*setProxy(ObjectPrx)*. In glacier2router i put hw2 as server. Also hw2 work's not all time. But this doesn't work. Please tell me right way to make such scheme.

PS. sorry for my bad english

Comments

  • benoit
    benoit Rennes, France
    Hi,

    I'm afraid the ASCII schema is not very clear and I'm not sure I understand your application. Where do you run the Glacier2 router, on hw1 or hw2? Which process connects to Glacier2 as a client? Is it a process from hw1 or hw2?

    Cheers,
    Benoit.
  • Now:
    I run Glacier2 on hw1.
    Processes from hw1connect as clients to Glacier2.
    On hw1 there are processes with own servants and they communicate to each other.
    Scheme:
    http://pic.ipicture.ru/uploads/091008/bBtzbZTF2a.png
    But if i right undestand, then i call functions on hw2 of proxy it doesn't go throuth glacier.server.endpoint?


    But I want to call(sync/async) hw1's processes's functions from hw2 using only one open port on hw1 and one open port on hw2.
  • benoit
    benoit Rennes, France
    Without more information about your application it's difficult to give advices but if you want to limit the number of connections between hw1 and hw2, it seems to me that it would be easier if this process on hw2 was the Glacier2 client. This way, all requests from the different hw1 processes will go through Glacier2 through the unique connection established between the hw2 process and Glacier2.

    Cheers,
    Benoit.
  • benoit wrote: »
    This way, all requests from the different hw1 processes will go through Glacier2 through the unique connection established between the hw2 process and
    But, if i want to use async calls, i need have 1 open port for each process on hw1? And I should run for each process one glacier?

    PS. I updated my last message.
  • matthew
    matthew NL, Canada
    From the Ice protocol point of view sync/async calls are identical, and have no effect on the required number of ports.
  • Ok, But I don't understand. What should i do to solve problem? Can I can put all traffic between hw1 and hw2 in one tunnel(e.g 10000 port on hw1 and 22 on hw2)?
  • matthew
    matthew NL, Canada
    Yes, you can use Glacier2 to do that. In doing that the client will talk to the backend servers through Glacier2, and any data flowing back to the client from the servers behind Glacier2 will go back over the same connection that was established from the client to Glacier2.
  • But. I send proxy from client to server. And than I use this proxy on server-side, it doesn't work over glacier2 and connect make RPC direct(not use glacier2,netstat tell me about it)?

    config.glacier2:
    Glacier2.InstanceName=TestGlacier2
    Glacier2.Client.Endpoints=ssl -p 10005 -h 127.0.0.1
    Glacier2.Server.Endpoints=tcp -h 192.168.0.187
    Glacier2.SessionManager=PNASessionManager:tcp -h 192.168.0.189 -p 10003
    Glacier2.PermissionsVerifier=verifier:tcp -h 192.168.0.189 -p 10003
    Glacier2.SessionTimeout=30
    .....

    config.client:
    Ice.Default.Router=TestGlacier2/router:ssl -p 10005 -h 127.0.0.1
    FTPService.Client.Router=TestGlacier2/router:ssl -p 10005 -h 127.0.0.1
    LocalService.Endpoints=tcp -h 127.0.0.1 -p 10000


    config.server:
    PNAServer.Endpoints=tcp -h 192.168.0.189 -p 10003

    What is the right way to do tunnel?
  • matthew
    matthew NL, Canada
    devtty wrote: »
    But. I send proxy from client to server. And than I use this proxy on server-side, it doesn't work over glacier2 and connect make RPC direct(not use glacier2,netstat tell me about it)?

    config.client:
    Ice.Default.Router=TestGlacier2/router:ssl -p 10005 -h 127.0.0.1
    FTPService.Client.Router=TestGlacier2/router:ssl -p 10005 -h 127.0.0.1
    LocalService.Endpoints=tcp -h 127.0.0.1 -p 10000

    You should use createObjectAdapterWithRouter on the client side, and you should not set any endpoints for the object adapter. See demo/Glacier2/callback for an example of how to do this.