Archived

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

Can IcePack Service and server run in different hosts?

Hello.

I've tested IcePack service and server run in the same host. It work well.

But I want to run IcePack Service and the server in different host. I tested about it many times but every time failed. Can you help me?

For example, I have three host. 192.168.1.1, 192.168.1.2, 192.168.1.3.
I want to run IcePackRegistry in 192.168.1.1, want to regist the server in 192.168.1.2 and run client in 192.168.1.3.

I run icepacknode.exe in 192.168.1.1
The config file of 192.168.1.1
#
# The IcePack locator proxy.
#
Ice.Default.Locator=IcePack/Locator:default -h 192.168.1.1 -p 12000

#
# IcePack registry configuration.
#
IcePack.Registry.Client.Endpoints=default -p 12000
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

I run icepackadmin to add node in 192.168.1.2
The config file of 192.168.1.2
#
# The IcePack locator proxy.
#
Ice.Default.Locator=IcePack/Locator:default -h 192.168.1.1 -p 12000
#
# IcePack node configuration.
#
IcePack.Node.Name=node
IcePack.Node.Endpoints=default -h 192.168.1.2
IcePack.Node.Data=db/node
IcePack.Node.CollocateRegistry=1

application.xml
<icepack>
<variable name="ice.dir" value="../../.."/>
<application name="hello">
<node name="node">
<include name="Server1" descriptor="server.xml"/>
</node>
</application>
</icepack>

server.xml
<icepack>
<server name="${name}" kind="cpp" exe="${ice.dir}/demo/IcePack/hello/server" activation="on-demand">
<adapters>
<adapter name="Hello" endpoints="default" register="true">
<object identity="${name}" type="::Demo::HelloFactory"/>
</adapter>
</adapters>
<properties>
<property name="Identity" value="${name}"/>
<property name="Ice.ThreadPool.Server.Size" value="5"/>
</properties>
<target name="debug">
<properties>
<property name="Ice.Trace.Location" value="1"/>
</properties>
</target>
</server>
</icepack>

I run client in 192.168.1.3
The config file of 192.168.1.3
#
# The IcePack locator proxy.
#
Ice.Default.Locator=IcePack/Locator:default -h 192.168.1.1 -p 12000


When I run the client, the IcePackNode show the exception:
Error: cannot convert '../../../demo/IcePack/hello/Server' into an absolute path
It seems that the client active the server in 192.168.1.1 but the the service doesn't exist in 192.168.1.1. How can I deploy the case successfully?

Thanks a lot!

Comments

  • mes
    mes California
    Hi,

    You must run an IcePack node server on each host that you want to activate an application server. If you do not need to activate application servers on 192.168.1.1, then you can use the icepackregistry server on that host, but you must run an icepacknode server on 192.168.1.2. The configuration for the icepacknode must specify IcePack.Node.CollocateRegistry=0, because the registry is running as a separate service on another host.

    Finally, you must modify your endpoints so that they include the correct hostname/address information. For example, the IcePack.Registry.*.Endpoints properties should contain "-h 192.168.1.1". The adapter endpoint in server.xml should contain "-h 192.168.1.2".

    Hope that helps,
    - Mark
  • It can work well now.
    Thank you for your kindly help, mes ;)
  • hi, Mes

    I am very interesting to the issue. There are multiple hosts and servers in my project. I hope the client could access one server to bind the different server by IcePack. It maybe "indirect bind" feature. I tested as above but failed. Would you please give the complete resolution and configuration in details. Thanks in advance.

    For example, I need run servers A, B, C on hosts a, b, c.

    Regards,
  • hi,

    I posted the thread two days ago but no any response is received. In my case, a naming service is necessary because my servers must be deployed in different hosts. The client knows one endpoint and can access all servers by the naming service. I think IcePack can do the job. Please show the resolution in detail.

    Regards,
  • Note that if you would like to have guaranteed response time to your questions, you must purchase commercial support from us. We cannot give unlimited free support.
  • Thanks for your reply. The response of mes is too simple to understand. Would you please give me more details if possible? The sample will be useful to every fans of Ice. ;)

    Thanks in advance.
  • mes
    mes California
    Every user has different requirements. Rather than trying to guess what example would be appropriate, we would prefer that you attempt to get a simple example running. If you have trouble, provide us with the source code and configuration files of your example, as well as a detailed description of the problem.

    - Mark
  • Thanks for your reply. I read the thread and want to rebuild the example as eyexercise described. I modified the configuration as your advice. I attempt to run Icepacknode on 192.168.1.2 but failed. The Icepacknode on 192.168.1.1 has run above all. The tracing information is "error: couldn't contact the IcePack registry". The attachment is the configuration. I must make some mistake.:o

    Would you please give me some advice? Thanks.
  • mes
    mes California
    You should add a -h option with the appropriate address to each of the Endpoints properties, as well as to the Ice.Default.Locator property.

    - Mark
  • I have just developed a project using ICE. the solutioin just like you want:
    There are many severs run in diffent host(windows and linux).
    The client only need a Interface Name to revoke the expected service.
    What the client know is just a "Ice.Default.Locator" configuration item.

    I can share my experience with you, but the configuration is too complex to explain at here. I can help you if you call me at 0755-81378389,
    remember call after 17:30 or saturday, sunday.
  • Thank you two. Maybe I ignore the "Locator" property.

    Good Luck