Archived

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

Hello Demo Question

Hi,

I know this is probably a completely newbie question, but I am puzzled. I am using the hello demo and trying to get IcePack to share objects among multiple nodes (physical computers).

First I tried doing the steps in the README. This launches fine in one computer, but multiple machines cannot see or look up eachother's objects. I then realized that I probably need to use IcePackRegistry in this case to make them span a joint domain. So I tried that with the configuration given. But when I try launching icepacknode in addition to that they have a shared resource problem (sockets returns a WSAEADDRINUSE error). So I tried modifying the node.Endpoints to tcp -p 9900. That resolved my conflict with the sockets, but made it so icepackadmin could not launch and returned an error about not being able to find the admin endpoint. I just tried launching the registry with the default options and not using the node because there is only one server and that has an IllegalIdentityException.

So, I guess my first question would be "Is it possible to use any of the demos for this purpose?" And second, how? Thank you.

Jennie

Comments

  • One More Detail...

    The two computers in question can ping eachother, so I know it is not a network issue between the two machines. Thanks.

    Jennie
  • mes
    mes California
    Hi Jennie,

    It's not completely clear to me what you're trying to do. The configuration files in the IcePack hello demo are written to be used on a single host (for the sake of simplicity), but they can be modified to allow any structure you like.

    The most important issue is to get your endpoints defined correctly. In the absence of a -h option, an endpoint always binds to the "localhost" interface (e.g., 127.0.0.1). This becomes apparent when you enable network tracing using --Ice.Trace.Network=2 on the various programs involved in the demo.

    So first you need to decide where the demo components will be running, and then modify the endpoints so that they use network-accessible addresses.

    I would recommend that you use a single IcePack node (with collocated registry) at first, just to simplify things.

    If you're still having trouble, please provide as much detail as you can.

    Take care,
    - Mark
  • More Details...

    Hello Mark,

    I have it working in single node form. Most of what I want to do is be able to have two machines at once be able to create hello objects and access eachothers objects.

    From my understanding of the documentation, I thought that the easiest way to do this would be to execute the IcePackRegistry and then launch a node, then server and client. Correct me if I am wrong. Do I have to change the locator to something other than default. Do all of the endpoints have to be bound to the same protocol (i.e. TCP)? What about ports? If they both match up (i.e. have the same protocol and port) will they be able to share objects? Thanks.

    Jennie
  • mes
    mes California
    Hi,

    It would help me to know more about the environment you're trying to setup. For example: "I want to run the IcePack registry on Host A, IcePack node #1 on Host A, and IcePack node #2 on Host B. IcePack node #1 will house Server X, and IcePack node #2 will house Server Y."

    - Mark
  • Layout

    Hi,

    Basically all I've changed so far is that my locator and Client.Endpoints in the file now both are tcp -P 12000. Currently I cannot seem to even get the registry and node to launch at the same time with this config on computer #1 without getting the address already in use later. But I thought that the Client.Endpoints and locator were supposed to be the same from reading the documentation...

    Here is my current layout (all executions are using the modified hello demo config I described above):

    Computer #1:
    IcePackRegistry
    IcePackNode 1
    IcePackAdmin (application add "application.xml") - launch hello server #1
    hello client 1


    Computer #2
    IcePackNode 2
    IcePackAdmin (application add "application.xml") launch second hello server
    hello client 2

    Is there anything wrong with this setup? What about endpoints? How can I make sure that the endpoints all communicate, but are not having address in use issues? I am going to continue trying out new endpoints for now, but if you have any suggestions, that would be great. Thanks again.

    Jennie
  • mes
    mes California
    There are a few issues to be concerned about. First of all, each server and object adapter must have a unique name where IcePack is concerned. Therefore you cannot have two hello servers deployed on different nodes of the same domain, each with the same server and adapter names. If you're trying to do this in order to replicate the servers, then unfortunately IcePack doesn't currently support it. That is something we are considering for a future release however.

    Second, in this environment you must modify certain endpoints to work across hosts. For example, Ice.Default.Locator must contain an option like -h Computer1 to specify the name or address of the host on which the registry is running. Similarly, all of the IcePack.Registry.*.Endpoints properties should contain a -h Computer1 option, and IcePack.Node.Endpoints should have one that matches the host on which it's running.

    Take care,
    - Mark
  • Simpler Question

    Ok, now I am just trying to get one to computer to work on a variant of the hello demo with TCP. Once I deal with that, then I will worry about multiple hosts. :) Here is my modified config file.

    Ice.Default.Locator=IcePack/Locator:tcp -p 12000 -h localhost

    IcePack.Registry.Client.Endpoints=tcp -p 12000 -h localhost
    IcePack.Registry.Server.Endpoints=default
    IcePack.Registry.Internal.Endpoints=default
    IcePack.Registry.Admin.Endpoints=default
    IcePack.Registry.Data=db/registry
    IcePack.Registry.Trace.ServerRegistry=2
    IcePack.Registry.Trace.AdapterRegistry=2
    IcePack.Registry.DynamicRegistration=1

    IcePack.Node.Name=node
    IcePack.Node.Endpoints=default
    IcePack.Node.Data=db/node
    IcePack.Node.CollocateRegistry=1
    IcePack.Node.WaitTime=12000

    I run it with the following commands:
    $ ../../../bin/icepackregistry --Ice.Config=config
    $ ../../../bin/icepacknode --Ice.Config=config --warn
    $ ../../../bin/icepackadmin --Ice.Config=config -e \
    'application add "application.xml"'
    $ ./client

    But I always get a WSAEADDRINUSE error when I try to run the icepacknode. When I change the port number I get the same error. I know this is from attempting to open a listening socket on an address already taken. But I got the impression from the documentation that Client.Endpoints should point to the locator. (And changing the port number does not fix the problem. It still has the same conflict.) What else could be causing this problem? (the hello demo runs fine until I try to use IcePackRegistry). Thank you.

    Jennie
  • mes
    mes California
    The WSAEADDRINUSE error occurs because you are trying to run both icepackregistry and icepacknode, yet you requested a collocated registry (because IcePack.Node.CollocateRegistry=1). When you use a collocated registry, it's not necessary (and in fact it's not possible, as you've seen) to run a separate registry process. In this configuration, the node creates an internal instance of the registry. This is done strictly for the convenience of having the node and registry in a single process.

    So, things should work better if you don't start an icepackregistry, or if you set IcePack.Node.CollocateRegistry=0.

    Take care,
    - Mark
  • Success!

    Hello Mark,

    It looks like it's all working now. I followed your advice and kept the registry internal to the first icepacknode launch. Thank you so much.

    Jennie