Table of Contents Previous Next
Logo
IceStorm : 41.12 Configuring IceStorm
Copyright © 2003-2008 ZeroC, Inc.

41.12 Configuring IceStorm

IceStorm is a relatively lightweight service in that it requires very little configuration and is implemented as an IceBox service (see Chapter 40). The configuration properties supported by IceStorm are described in Appendix C; some of them control diagnostic output and are not discussed in this chapter.

41.12.1 Property Prefix

As you will see in the description of the IceStorm properties in Appendix C, IceStorm uses its IceBox service name as the prefix for all of its properties. For example, the property service.TopicManager.Endpoints becomes DemoIceStorm.TopicManager.Endpoints when IceStorm is configured as the IceBox service DemoIceStorm.

41.12.2 Server Configuration

The first step is configuring IceBox to run the IceStorm service:
IceBox.Service.DemoIceStorm=IceStormService,33:createIceStorm --Ice.Config=config.service
The following sample configuration file for a non-replicated IceStorm server presents the properties of primary interest for IceStorm itself:
Freeze.DbEnv.DemoIceStorm.DbHome=db
DemoIceStorm.TopicManager.Endpoints=tcp ‑p 9999
DemoIceStorm.Publish.Endpoints=tcp ‑p 9999
IceStorm uses Freeze to manage the service’s persistent state, therefore the first property specifies the pathname of the Freeze database environment directory (see Chapter 36) for the service. In this example, the directory db is used, which must already exist in the current working directory. This property can be omitted when the service is running in transient mode; see the description of the service.Transient property in Appendix C for more information.
The final two properties specify the endpoints used by the IceStorm object adapters; notice that their property names begin with DemoIceStorm, matching the service name. The TopicManager property specifies the endpoints on which the TopicManager and Topic objects reside; these endpoints typically use a connection-oriented protocol such as TCP or SSL. The Publish property specifies the endpoints used by topic publisher objects.

41.12.3 Deploying IceStorm Replicas

There are two ways of deploying IceStorm in its highly available (replicated) mode. In both cases, adding another replica requires that all active replicas be stopped while their configurations are updated; it is not possible to add a replica while replication is running.
To remove a replica, stop all replicas and alter the configuration as necessary. You must be careful not to remove a replica if it has the latest database state. This situation will never occur during normal operation since the database state of all replicas is identical. However, in the event of a crash it is possible for a coordinator to have later database state than all replicas. The safest approach is to verify that all replicas are active prior to stopping them. You can do this using the icestormadmin utility by checking that all replicas are in the Normal state (see Section 41.8).

IceGrid Deployment

IceGrid (see Chapter 35) is a convenient way of deploying IceStorm replicas. The term replica is also used in the context of IceGrid, specifically when referring to groups of object adapters that participate in replication, as described in Section 35.9. It is important to be aware of the distinction between IceStorm replication and object adapter replication; IceStorm replication uses object adapter replication when deployed with IceGrid, but IceStorm does not require object adapter replication as you will see in the next section.
An IceGrid deployment typically uses two adapter replica groups: one for the publisher proxies, and another for the topics, as shown below:
<replicagroup id="DemoIceStormPublishReplicaGroup">
</replicagroup>

<replicagroup id="DemoIceStormTopicManagerReplicaGroup">
    <object identity="DemoIceStorm/TopicManager"
        type="::IceStorm::TopicManager"/>
</replicagroup>
The object adapters are then configured to use these replica groups:
<adapter name="${service}.Publish"
    endpoints="tcp"
    replicagroup="${instancename}PublishReplicaGroup"/>

<adapter name="${service}.TopicManager"
    endpoints="tcp"
    replicagroup="${instancename}TopicManagerReplicaGroup"/>
As discussed in Section 41.7.5, an application may not want publisher proxies to contain multiple endpoints. In this case you should remove PublishReplicaGroup from the above deployment.
The next step is defining the endpoints for the adapter Node, which is used internally for communication with other IceStorm replicas and is not part of an adapter replica group:
<adapter name="${service}.Node" endpoints="tcp"/>
Finally, you must define the node id for each IceStorm replica using the NodeId property. The node id must be a non-negative integer:
<property name="${service}.NodeId" value="${index}"/>
You can find a complete example of an IceGrid deployment in the directory demo/IceStorm/replicated in the C++ distribution.

Manual Deployment

You can also deploy IceStorm replicas without IceGrid, although it requires more manual configuration; an IceGrid deployment is simpler to maintain.
The first step is defining the set of node proxies using properties of the form Nodes.id. These proxies allow replicas to contact each other; their object identities are composed using instance-name/nodeid.
For example, assuming we are using the IceBox service name IceStorm and have three replicas with the identifiers 0, 1, 2 and an instance name of DemoIceStorm, we can configure the proxies as shown below:
IceStorm.InstanceName=DemoIceStorm
IceStorm.Nodes.0=DemoIceStorm/node0:tcp p 13000
IceStorm.Nodes.1=DemoIceStorm/node1:tcp p 13010
IceStorm.Nodes.2=DemoIceStorm/node2:tcp p 13020
These properties must be defined in each replica. Additionally, each replica must define its node id, as well as the node’s endpoints. For example, we can configure node 0 as follows:
IceStorm.NodeId=0
IceStorm.Node.Endpoints=tcp p 13000
The endpoints for each replica and id must match the proxies configured in the Nodes.id properties.
Two additional properties allow you to configure replicated endpoints:
• service-name.ReplicatedTopicManagerEndpoints
Defines the endpoints contained in proxies returned by the topic manager.
• service-name.ReplicatedPublishEndpoints
Defines the endpoints contained in the publisher proxy returned by the topic.
For example, suppose we configure three replicas:
IceStorm.NodeId=0
IceStorm.TopicManager.Endpoints=tcp p 10000
IceStorm.Publish.Endpoints=tcp p 10001:udp p 10001

IceStorm.NodeId=1
IceStorm.TopicManager.Endpoints=tcp p 10010
IceStorm.Publish.Endpoints=tcp p 10011:udp p 10011

IceStorm.NodeId=2
IceStorm.TopicManager.Endpoints=tcp p 10020
IceStorm.Publish.Endpoints=tcp p 10021:udp p 10021
Each replica should also define these properties:
IceStorm.ReplicatedPublishEndpoints=tcp p 10001:tcp p 10011:tcp p 10021:udp p 10001:udp p 10011:udp p 10021
IceStorm.ReplicatedTopicManagerEndpoints=tcp p 10000:tcp p 10010:tcp p 10020
As discussed in Section 41.7.5, an application may not want publisher proxies to contain multiple endpoints. In this case you should remove the definition of the ReplicatedPublishEndpoints property from the above deployment.
You can find a complete example of a manual deployment in the directory demo/IceStorm/replicated2 in the C++ distribution.

41.12.4 Client Configuration

Clients of the service can define a proxy for the TopicManager object as follows:
TopicManager.Proxy=IceStorm/TopicManager:tcp ‑p 9999
The name of the property is not relevant, but the endpoint must match that of the service.TopicManager.Endpoints property, and the object identity must use the IceStorm instance name as the category and TopicManager as the name.

41.12.5 Object Identities

IceStorm hosts one well-known object, which implements the IceStorm::TopicManager interface. The default identity of this object is IceStorm/TopicManager, as seen in the stringified proxy example from Section 41.12.4. If an application requires the use of multiple IceStorm services, it is a good idea to assign unique identities to the well-known objects by configuring the services with different values for the service.InstanceName property, as shown in the following example:
DemoIceStorm.InstanceName=Measurement
This property changes the category of the object’s identity, which becomes Measurement/TopicManager. The client’s configuration must also be changed to reflect the new identity:
TopicManager.Proxy=Measurement/TopicManager:tcp ‑p 9999
Table of Contents Previous Next
Logo