Zeroc Ice Grid Research and learning

Source: Internet
Author: User
Tags node server

First, the concept

Slice:ice provides its own interface definition language. The interface and object used to define the RPC.

The interface called by the Ice.object:rpc must inherit from ice. Object

Servant:ice. The instantiation object of object called Servant,rpc is called the servant object, so servant requires thread safety

Endpoints: Address of client RPC call servant

Containers for Icebox:servant

Containers for Icenode:icebox

Registry: Registry, responsible for the management of Icenode registration, responsibility and release.

II. deployment

Steps:

    1. Start Registry

    2. Start node, register to registry

    3. Deploy code on a node server

    4. Apply the app profile to registry, and node will automatically start application

Iii. Configuration Files

Registry configuration file One: registry.cfg

Node config file n: node1.cfg, node2.cfg

Application description File App.xml

Configuration file Details:

Registry.cfg

# Grid Instance Name icegrid.instancename=szcicegrid# the client connects to the registry address Icegrid.registry.client.endpoints=tcp-p 4061icegrid.registry.server.endpoints=tcpicegrid.registry.internal.endpoints= Tcpicegrid.registry.permissionsverifier=szcicegrid/ nullpermissionsverifiericegrid.registry.adminpermissionsverifier=szcicegrid/nullpermissionsverifier# Registration Center Data Save Path , you need to create the folder manually icegrid.registry.data=/data/shizc/desktop/ice/registryicegrid.registry.dynamicregistration= 1ice.admin.instancename=admininstanceice.admin.serverid=admin

Node1.cfg

# Registration Center Address ice.default.locator=szcicegrid/locator:tcp-h 192.168.7.7-p 4061#node name icegrid.node.name= Node1icegrid.node.endpoints=tcp#node Storage Path icegrid.node.data=/data/shizc/desktop/ice/nodes/ node1icegrid.node.output=/data/shizc/desktop/ice/nodes/node1icegrid.node.collocateregistry=0# icegrid.node.trace.replica=2#icegrid.node.trace.activator=3#icegrid.node.trace.adapter=3# Icegrid.node.trace.server=3

Node2.cfg

# Registration Center Address ice.default.locator=szcicegrid/locator:tcp-h 192.168.7.7-p 4061icegrid.node.name= node2icegrid.node.endpoints=tcpicegrid.node.data=/data/shizc/desktop/ice/nodes/node2icegrid.node.output=/data/ shizc/desktop/ice/nodes/node2icegrid.node.collocateregistry=0#icegrid.node.trace.replica=2# Icegrid.node.trace.activator=3#icegrid.node.trace.adapter=3#icegrid.node.trace.server=3

App.xml

<icegrid>  <application name= "Filesystemapp" >    <properties  id= "Multithreaded"  >      <property name= " Ice.printstacktraces " value=" 1 " ></property>      < Property name= "IceSSL.Trace.Security"  value= "2"  ></property>       <property name= "Ice.ThreadPool.Client.Size"  value= "2"  ></property>       <property name= "Ice.ThreadPool.Client.SizeMax"  value= "50"  ></property>      <property name= " Ice.ThreadPool.Server.Size " value="  ></property>      < Property name= "Ice.ThreadPool.Server.SizeMax"  value= " ></property>  "     <property name= "Icebox.inheritpropertieS " value=" 1 " ></property>      <property name=" Ice.Override.ConnectTimeout " value="  ></property>       <property name= "Ice.Override.Timeout"  value= "10000"  ></property>       <property name= "IceBox.Trace.ServiceObserver"  value= "1"  ></property >      <property name= "Ice.Default.LocatorCacheTimeout"  value= " " ></property>      <property name=" Ice.backgroundlocatorcacheupdates " value=" 1 " ></property>    </ properties>    <!--  Configuration template  -->    <server-template  id= "Filesystemservericeboxtemplate" >        <parameter  name= "index"  default= "0" ></parameter>        <!-- exe Specify Java startup  -->         <icebox id= "Filesystemservericebox${index}"  exe= "Java"   activation= "On-demand"  >          <properties>             <properties refid= " Multithreaded " />          </properties>           <option>-Xmx512M</option>           <!-- icebox Start the Main method  -->           <option>IceBox.Server</option>           <!--  Development code Paths  -->           <env>classpath=.:/usr/share/java/*:/data/shizc/desktop/ice/bin</env>           <!-- entry Specifies the endpoints group that the icebox starts Service, replica-group specified  -->           <service name= "Filesystemservice"  entry= "service. Filesystemservice ">            <adapter  name= "Filesystemservice"  id= "Filesystemservice${index}"  endpoints= "Default"  replica-group = "Filesystemservicerep"  ></adapter>           </service>        </icebox>    </ Server-template>        <replica-group id= " Filesystemservicerep ">      <load-balancing type=" Round-robin "  n-replicas= "0"  />      <!--  Specify name of servant  -->      <object  Identity= "RootDir"  type= ":: FileSystem::D irectory" ></object>       <object identity= "Iamfile"  type= ":: Filesystem::file" ></object>     </replica-group>    <!--  2 icebox -->    per node definition  <node name= "Node1" >      <server-instance template= " Filesystemservericeboxtemplate " index=" ></server-instance>       <server-instance template= "Filesystemservericeboxtemplate"  index= "></" Server-instance>    </node>    <node name= "Node2" >       <server-instance template= "Filesystemservericeboxtemplate"   index= "&GT;&LT;/SERVER-INSTANCE&GT;&NBSP;&NB"Sp;    <server-instance template= "Filesystemservericeboxtemplate"  index= "22" ></server-instance>    </node>  </application></icegrid >

Four, start
    1. Icegridregistry--ice.config=registry.cfg

    2. Icegridnode--ice.config=node1.cfg

    3. Icegridnode--ice.config=node2.cfg

    4. Icegridadmin--ice.config=node1.cfg

      After landing

      Application Add App.xml

Five, the Code

Tomorrow plus ...

Zeroc Ice Grid Research and learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.