Glacier in two machines

yeranarrailayeranarraila Tatiana PereiraOrganization: Universidade Federal de Santa CatarinaProject: An app to transfer mobile agentsMember
Hi!
I'm trying to run a client and a server using glacier. If I run it in same machine, its works. But if I pu client in machine A and server in machine B, I receive this error below. Telnet is working fine and firewall is disabled:

!! 17/10/11 15:56:46:546 Client: error: main: Ice.ConnectFailedException
error = 0
at IceInternal.ConnectRequestHandler.getConnection(ConnectRequestHandler.java:240)
at IceInternal.ConnectRequestHandler.sendRequest(ConnectRequestHandler.java:138)
at IceInternal.Outgoing.invoke(Outgoing.java:66)
at Ice._ObjectDelM.ice_isA(_ObjectDelM.java:30)
at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:111)
at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:77)
at Glacier2.RouterPrxHelper.checkedCast(RouterPrxHelper.java:2268)
at Client.createSession(Client.java:86)
at Glacier2.Application.doMain(Application.java:388)
at Glacier2.Application.doMain(Application.java:342)
at Ice.Application.main(Application.java:182)
at Ice.Application.main(Application.java:118)
at Client.main(Client.java:10)
Caused by: java.net.ConnectException: Connection timed out: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
at IceInternal.Network.doFinishConnect(Network.java:325)
at IceInternal.TcpTransceiver.initialize(TcpTransceiver.java:33)
at Ice.ConnectionI.initialize(ConnectionI.java:1831)
at Ice.ConnectionI.message(ConnectionI.java:1038)
at IceInternal.ThreadPool.run(ThreadPool.java:302)
at IceInternal.ThreadPool.access$300(ThreadPool.java:12)
at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:643)
at java.lang.Thread.run(Unknown Source)


My configs:

Client.glacier2

Ice.Default.Router=Glacier2/router:tcp -h 200.129.75.61 -p 20010
Ice.ACM.Client=0
Ice.RetryIntervals=-1

Callback.Proxy=callback:tcp -h 200.129.75.61 -p 20011

Ice.Warn.Connections=1

serverconfig.zeroc
Callback.Server.Endpoints=tcp -p 20011

Ice.Warn.Connections=1

glacier2config.zeroc

Glacier2.InstanceName=Glacier2

Glacier2.Client.Endpoints=tcp -p 20010
Glacier2.Server.Endpoints=tcp

Glacier2.PermissionsVerifier=Glacier2/NullPermissionsVerifier
#Glacier2.CryptPasswords=passwords.zeroc

Glacier2.SessionTimeout=30

Glacier2.Client.ForwardContext=1
Glacier2.Server.ForwardContext=1

Glacier2.Client.SleepTime=500
Glacier2.Server.SleepTime=500

Glacier2.Client.Trace.Request=1
Glacier2.Server.Trace.Request=1
Glacier2.Client.Trace.Override=1
Glacier2.Server.Trace.Override=1
Glacier2.Client.Trace.Reject=1
Glacier2.Trace.Session=1
Glacier2.Trace.RoutingTable=1

Ice.Warn.Connections=1


What's happen?
Hugs

Comments

  • bernardbernard Jupiter, FLBernard NormierOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hi Tatiana,

    It's difficult to spot the issue without seeing the code well.

    Could you take the demoj/Glacier2/callback demo, modify its configuration and try to run it? If this does not work, please post your configuration and the error message you get - we already have the code.

    For the server (Callback.Proxy, Callback.Server.Endpoints), you don't need an external interface or port reachable directly by your client. Glacier2 is an intermediary (router) between your client and your server, and it's Glacier2 that uses the Callback.Proxy to talk to the server, typically on an internal interface.

    Best regards,
    Bernard
  • yeranarrailayeranarraila Tatiana PereiraOrganization: Universidade Federal de Santa CatarinaProject: An app to transfer mobile agentsMember
    Hi!

    I run the demo, and receive this error:

    This demo accepts any user-id / password combination.
    user id: me
    password: me
    !! 19/10/11 12:21:47:187 Client: error: main: Ice.ConnectFailedException
    error = 0
    at IceInternal.ConnectRequestHandler.getConnection(ConnectRequestHandler.java:240)
    at IceInternal.ConnectRequestHandler.sendRequest(ConnectRequestHandler.java:138)
    at IceInternal.Outgoing.invoke(Outgoing.java:66)
    at Glacier2._RouterDelM.createSession(_RouterDelM.java:44)
    at Glacier2.RouterPrxHelper.createSession(RouterPrxHelper.java:129)
    at Glacier2.RouterPrxHelper.createSession(RouterPrxHelper.java:67)
    at Client.createSession(Client.java:80)
    at Glacier2.Application.doMain(Application.java:388)
    at Glacier2.Application.doMain(Application.java:342)
    at Ice.Application.main(Application.java:182)
    at Ice.Application.main(Application.java:118)
    at Client.main(Client.java:260)
    Caused by: java.net.ConnectException: Connection timed out: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at IceInternal.Network.doFinishConnect(Network.java:325)
    at IceInternal.TcpTransceiver.initialize(TcpTransceiver.java:33)
    at Ice.ConnectionI.initialize(ConnectionI.java:1831)
    at Ice.ConnectionI.message(ConnectionI.java:1038)
    at IceInternal.ThreadPool.run(ThreadPool.java:302)
    at IceInternal.ThreadPool.access$300(ThreadPool.java:12)
    at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:643)
    at java.lang.Thread.run(Unknown Source)


    Configs are:

    config.client

    #
    # The proxy to the Glacier2 router for all outgoing connections. This
    # must match the value of Glacier2.Client.Endpoints in config.glacier2.
    #
    #Ice.Default.Router=DemoGlacier2/router:ssl -p 4064 -h 150.162.64.184
    Ice.Default.Router=DemoGlacier2/router:tcp -p 4064 -h 150.162.64.184

    #
    # This must match the value of Callback.Server.Endpoints in
    # config.server.
    #
    Callback.Proxy=callback:tcp -h 150.162.64.184 -p 10000

    #
    # Warn about connection exceptions
    #
    #Ice.Warn.Connections=1

    #
    # Network Tracing
    #
    # 0 = no network tracing
    # 1 = trace connection establishment and closure
    # 2 = like 1, but more detailed
    # 3 = like 2, but also trace data transfer
    #
    #Ice.Trace.Network=1

    #
    # Protocol Tracing
    #
    # 0 = no protocol tracing
    # 1 = trace protocol messages
    #
    #Ice.Trace.Protocol=1

    #
    # Security Tracing
    #
    # 0 = no security tracing
    # 1 = trace messages
    #
    #IceSSL.Trace.Security=1

    #
    # SSL Configuration
    #
    #Ice.Plugin.IceSSL=IceSSL.PluginFactory
    #IceSSL.DefaultDir=../../../certs
    #IceSSL.Keystore=client.jks
    #IceSSL.Password=password

    config.glacier2

    #
    # Set the instance name
    #
    Glacier2.InstanceName=DemoGlacier2

    #
    # The client-visible endpoint of Glacier2. This should be an endpoint
    # visible from the public Internet, and it should be secure.
    #
    #Glacier2.Client.Endpoints=ssl -p 4064 -h localhost
    Glacier2.Client.Endpoints=tcp -p 4064 -h localhost

    #
    # The server-visible endpoint of Glacier2. This endpoint is only
    # required if callbacks are needed (leave empty otherwise). This
    # should be an endpoint on an internal network (like 192.168.x.x), or
    # on the loopback, so that the server is not directly accessible from
    # the Internet.
    #
    Glacier2.Server.Endpoints=tcp -h localhost

    #
    # For this demo, we use a null permissions verifier.
    #
    Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier

    #
    # The timeout for inactive sessions. If any client session is inactive
    # for longer than this value, the session expires and is removed. The
    # unit is seconds.
    #
    Glacier2.SessionTimeout=30

    #
    # Glacier can forward requests buffered or unbuffered. Unbuffered
    # means a lower resource consumption, as buffering requires one
    # additional thread per connected client or server. However, without
    # buffering, messages cannot be batched and message overriding doesn't
    # work either. Also, with unbuffered request forwarding, the caller
    # thread blocks for twoway requests.
    # The default is to use buffering (=1), in both directions.
    #Glacier2.Client.Buffered=0
    #Glacier2.Server.Buffered=0

    #
    # These two lines instruct Glacier2 to forward contexts both for
    # regular routing, as well as for callbacks (reverse routing).
    #
    Glacier2.Client.ForwardContext=1
    Glacier2.Server.ForwardContext=1

    #
    # To prevent Glacier2 from being flooded with requests from or to one
    # particular client, Glacier2 can be configured to sleep for a certain
    # period after all current requests for this client have been
    # forwarded. During this sleep period, new requests for the client are
    # queued. These requests are then all sent once the sleep period is
    # over. The unit is milliseconds.
    #
    Glacier2.Client.SleepTime=500
    Glacier2.Server.SleepTime=500

    #
    # With the two settings below, Glacier2 can be instructed to always
    # batch oneways, even if they are sent with a _fwd/o instead of a
    # _fwd/O context.
    # The default value for Glacier2.Client.AlwaysBatch and
    # Glacier2.Server.AlwaysBatch is 0.
    #Glacier2.Client.AlwaysBatch=1
    #Glacier2.Server.AlwaysBatch=1

    #
    # Glacier2 always disables active connection management so there is no
    # need to configure this manually. Connection retry does not need to
    # be disabled, as it's safe for Glacier2 to retry outgoing connections
    # to servers. Retry for incoming connections from clients must be
    # disabled in the clients.
    #

    #
    # Various settings to trace requests, overrides, etc.
    #
    Glacier2.Client.Trace.Request=1
    Glacier2.Server.Trace.Request=1
    Glacier2.Client.Trace.Override=1
    Glacier2.Server.Trace.Override=1
    Glacier2.Client.Trace.Reject=1
    Glacier2.Trace.Session=1
    Glacier2.Trace.RoutingTable=1

    #
    # Warn about connection exceptions
    #
    Ice.Warn.Connections=1

    #
    # Network Tracing
    #
    # 0 = no network tracing
    # 1 = trace connection establishment and closure
    # 2 = like 1, but more detailed
    # 3 = like 2, but also trace data transfer
    #
    #Ice.Trace.Network=1

    #
    # Protocol Tracing
    #
    # 0 = no protocol tracing
    # 1 = trace protocol messages
    #
    #Ice.Trace.Protocol=1

    #
    # Security Tracing
    #
    # 0 = no security tracing (default)
    # 1 = trace messages
    #
    #IceSSL.Trace.Security=1

    #
    # SSL Configuration
    #
    #Ice.Plugin.IceSSL=IceSSL:createIceSSL
    #IceSSL.DefaultDir=../../../certs
    #IceSSL.CertAuthFile=cacert.pem
    #IceSSL.CertFile=s_rsa1024_pub.pem
    #IceSSL.KeyFile=s_rsa1024_priv.pem

    config.server

    #
    # The endpoint of the server's object adapter. This should be an
    # endpoint on an internal network (like 192.168.x.x), or on the
    # loopback, so that the server is not directly accessible from the
    # Internet.
    #
    Callback.Server.Endpoints=tcp -h localhost -p 10000

    #
    # Warn about connection exceptions
    #
    Ice.Warn.Connections=1

    #
    # Network Tracing
    #
    # 0 = no network tracing
    # 1 = trace connection establishment and closure
    # 2 = like 1, but more detailed
    # 3 = like 2, but also trace data transfer
    #
    #Ice.Trace.Network=1

    #
    # Protocol Tracing
    #
    # 0 = no protocol tracing
    # 1 = trace protocol messages
    #
    #Ice.Trace.Protocol=1
  • yeranarrailayeranarraila Tatiana PereiraOrganization: Universidade Federal de Santa CatarinaProject: An app to transfer mobile agentsMember
    Server and router are running in the same machine. Client is in other machine.
  • bernardbernard Jupiter, FLBernard NormierOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    There are a few problems with your configuration:

    - The Ice.Default.Router endpoints must match the client endpoints of your router
    # '-h localhost' means listens only on loopback!
    Glacier2.Client.Endpoints=tcp -p 4064 -h localhost
    

    should be
    Glacier2.Client.Endpoints=tcp -p 4064 -h 150.162.64.184
    

    - likewise, the Callback.Proxy endpoint should match your server endpoints. Here, I would update the Callback.Proxy to:
    Callback.Proxy=callback:tcp -h localhost -p 10000
    
    (remember it's the Glacier2 router, not the client, that calls directly on this proxy)

    Cheers,
    Bernard
Sign In or Register to comment.