Home Help Center

Glacier2 Server Error

soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
I change Ice-3.3.1-VC90\demo\Glacier2\callback like this:
Glacier2Router run on Server A(192.168.0.75)
Server and SessionServer run on the Server B(192.168.0.22)
Client Run on the Client A,all of them run in the same internal ntework.
Config File like this:
config.glacier2
Glacier2.InstanceName=DemoGlacier2
Glacier2.Client.Endpoints=ssl -p 4064 -h 192.168.0.75
Glacier2.Server.Endpoints=tcp -h 192.168.0.75
Glacier2.SessionManager=sessionmanager:tcp -h 192.168.0.22 -p 10001
Glacier2.PermissionsVerifier=verifier:tcp -h 192.168.0.22 -p 10001
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
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
Callback.Server.Endpoints=tcp -h 192.168.0.22 -p 10000
Ice.Warn.Connections=1
config.sessionserver
SessionServer.Endpoints=tcp -h 192.168.0.22 -p 10001
Ice.Warn.Connections=1
config.client
Ice.Default.Router=DemoGlacier2/router:ssl -p 4064 -h 192.168.0.75
Callback.Client.Endpoints=
Callback.Proxy=callback:tcp -h 192.168.0.22 -p 10000
Ice.ACM.Client=0
Ice.RetryIntervals=-1
Ice.Plugin.IceSSL=IceSSL:createIceSSL
IceSSL.DefaultDir=../../../certs
IceSSL.CertAuthFile=cacert.pem
IceSSL.CertFile=c_rsa1024_pub.pem
IceSSL.KeyFile=c_rsa1024_priv.pem

Client Error Code
C:\Ice-3.3.1-VC90\demo\Glacier2\callback>client
This demo accepts any user-id / password combination.
user id: foo
password: bar
client: Outgoing.cpp:478: Ice::UnknownLocalException:
unknown local exception:
Network.cpp:1220: Ice::ConnectionRefusedException:
connection refused: WSAECONNREFUSED

Glacier2Router Message show:
C:\Ice-3.3.1-VC90\demo\Glacier2\callback>client
This demo accepts any user-id / password combination.
user id: foo
password: bar
client: Outgoing.cpp:478: Ice::UnknownLocalException:
unknown local exception:
Network.cpp:1220: Ice::ConnectionRefusedException:
connection refused: WSAECONNREFUSED



I Can see the session build success,but can't connect to server,maybe some error in my config file,ZEROC staff help pls.

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    It looks like your server isn't running on machine B or not listening on the right port. The best way to debug this is to enable network tracing with Ice.Trace.Network=2 on the Glacier2 router and server.

    Cheers,
    Benoit.
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    Here is the Trace

    If put the glacier2router back to 192.168.0.22,everything is OK.Client can work fine.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    It looks like this NullHandleException raised from the Glacier2 router indicates that you have not correctly set the Glacier2.Server.Endpoints property for the Glacier2 router (it looks fine however from the configuration file you have posted in your first post...).

    Are you sure to have enabled this endpoint in the configuration file of your Glacier2 router? Can you copy paste the network traces of the Glacier2 router after starting it?

    Note that you can easily copy/paste text from a Windows command shell using a right click in the window and: Mark -> <select the text> -> Copy.

    Cheers,
    Benoit.
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    benoit,Thanks for you reply,i always have no idea for this,i sure config file not change,and i have no idea why router can connect session server but can't connect server.
    and i have a other question,if behind router have several servers(same server), can router admin push message to the one?if can ,how to edit the config file?

    thank you!
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Please copy/paste the network tracing of your Glacier2 router after it's started if you need more help with this.

    Cheers,
    Benoit
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    C:\Ice-3.3.1-VC90\bin>glacier2router --Ice.Config=config.glacier2
    [ 08/18/09 16:07:37.203 glacier2router: Network: attempting to bind to ssl socke
    t 192.168.0.79:4064 ]
    [ 08/18/09 16:07:37.218 glacier2router: Network: accepting ssl connections at 19
    2.168.0.79:4064 ]
    [ 08/18/09 16:07:37.218 glacier2router: Network: created adapter `Glacier2Intern
    al.Verifiers' without endpoints ]
    [ 08/18/09 16:07:37.218 glacier2router: Network: trying to establish tcp connect
    ion to 192.168.0.22:10001 ]
    [ 08/18/09 16:07:37.234 glacier2router: Network: tcp connection established
      local address = 192.168.0.79:1249
      remote address = 192.168.0.22:10001 ]
    


    I change router run on (192.168.0.79),other not changed.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    This tracing shows that only the Glacier2.Client.Endpoints are enabled on your Glacier2 router. If the Glacier2.Server.Endpoints were correctly set you should see an additional trace like the following:
    [ 08/18/09 16:07:37.203 glacier2router: Network: attempting to bind to tcp socket 192.168.0.79:xxxx ]
    

    Where xxxx is a random port.

    Are you sure there are no typos in your config.glacier2 configuration file? Can you please attach the file (no copy/paste) so that we can check it out?

    Cheers,
    Benoit.
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    #glacier2router --Ice.Config=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 192.168.0.79
    
    #
    # 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=
    
    # 
    # The configures the session manager. If no external session manager
    # is used, sessions are only handled Glacier2 internally.
    #
    Glacier2.SessionManager=sessionmanager:tcp -h 192.168.0.22 -p 10001
    
    # 
    # For this demo, we use a dummy permissions verifier that is
    # collocated with the session server process. This dummy permissions
    # verifier allows any user-id / password combination.
    # 
    Glacier2.PermissionsVerifier=verifier:tcp -h 192.168.0.22 -p 10001
    
    #
    # 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=2
    
    #
    # 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=c_rsa1024_pub.pem
    IceSSL.KeyFile=c_rsa1024_priv.pem
    
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    To fix your problem, you either need to set Glacier2.Server.Endpoints to a non-empty value (if your client needs to receive callbacks) or your client shouldn't call getCategoryForClient (if it doesn't need to receive callbacks). See the Glacier2 chapter in the Ice manual for more information on this.

    Cheers,
    Benoit.
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    and i have a other question,if behind router have several servers(same server), can router admin push message to the one?if can ,how to edit the config file?
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    A Glacier2 router can definitely forward client requests to multiple Ice servers. There's no need to change the Glacier2 router configuration to support this, the client just needs to use different proxies, each pointing to Ice objects hosted on the different servers.

    I encourage you to checkout the manual for more information, you'll also find some more elaborate use of Glacier2 in our newsletter articles. Among others, you should also definitely checkout Michi's "Teach yourself Glacier2 in 10 minutes" newsletter article here for a quick introduction to Glacier2.

    Cheers,
    Benoit.
  • soff.dongsoff.dong Member qiao dongOrganization: accuradProject: v6's net project ✭✭
    benoit,appreciate for your help!TKS!
Sign In or Register to comment.