分享

将Icegrid和icestrom 融合

 zale的图书馆 2011-06-14
修改了下列的application.xml 文件:
 16         <icebox id="IceStormServer" exe="icebox" activation="on-demand">
 17          <service name="IceStorm" entry="IceStormService,34:createIceStorm">
 18            <dbenv name="${service}"/>
 19            <adapter name="${service}.TopicManager"
 20                     endpoints="default"/>
 21            <adapter name="${service}.Publish"
 22                     endpoints="default"/>
 23            <properties>
 24              <property name="${service}.InstanceName" value="eveMonitor"/>
 25              <property name="${service}.Trace.TopicManager" value="2"/>
 26              <property name="${service}.Trace.Topic" value="1"/>
 27              <property name="${service}.Trace.Subscriber" value="1"/>
 28              <property name="${service}.Flush.Timeout" value="2000"/>
 29              <property name="Freeze.DbEnv.IceStorm.DbHome" value="db"/>
 30             </properties>
 31          </service>
 32        </icebox>

这个应该可以动态启动吧动态启动icebox,然后在ServiceManage的目录下创建了目录db。
直接启动报./eveMonitor: error: Network.cpp:1243: Ice::ConnectionRefusedException:
   connection refused: Connection refused的错误
icebox没有动态启动哈,难道是联系不上registry? 加上了client.cfg也不行
程序停在createTopic这块
最终停在了IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(
 54     communicator->propertyToProxy("TopicManager.Proxy"));
这个语句上

propertyToProxy 估计就是去查找配置文件中的信息了哈。我把后面的端口信息删除了

在config.eveMoni中,

第一个参数是干什么的哈?

  2 # This property is used to configure the endpoints of the clock 
  3 # subscriber adapter. These endpoints are where the client receives
  4 # topic messages from IceStorm.
  5 #
  6 GlobalMsgAPI.Subscriber.Endpoints=tcp:udp
  7 
  8 #
  9 # This property is used by the clients to connect to IceStorm.
 10 #
 11 TopicManager.Proxy=eveMonitor/TopicManager:default -p 10000

把端口删掉了,然后加了Ice.Config=client.cfg 就报TopicManger没有注册

把config.grid可以关注一下。不需要修改啊。
在原来的时候TopicManger什么时候注册的??

原来的IceBox.ServiceManager.Endpoints=tcp -p 9998 在xml文件中没有贴现哈??这个是个什么东西?
在我们的application xml 文件中有这个语句
<adapter name="${service}.TopicManager"
                    endpoints="default"/>

在原来的代码中,pub和sub均没有创建TopiceManger,估计这个是系统自己创建的。但是为什么我找不到嘞?

是因为 <service name="IceStorm"  没有写成 <service name="eveMonitor" 的吗?
不是的,这个 */TopicManager 左边应该填instance name 那这样的话,我填的应该是正确的哈。
其实是应该填application name(到底是哪一个??) 确实应该是 ${service}.InstanceName对应的东西哈

将config.eveMoni 中改为这个了TopicManager.Proxy=ServiceAPI/TopicManager 但是怎么还是找不到?
但是通过icegridadmin可以将icebox手动起起来了

将xml文件中service name 改回IceStorm了

NND,在  <replica-group id="DemoIceStorm-TopicManagerReplicaGroup">
       <object identity="DemoIceStorm/TopicManager" type="::IceStorm::TopicManager"/>
     </replica-group>

这replia-group里面创建了 object!!!!! 原来理解的replica-group理解错了,也就是相当于一个adapter!~
以后对于自己不熟悉的代码或者东西,不要随意精简,越小改动越好。这样造成的问题就会越少。 
没有创建就可以用是不是因为这个type元素在里面?
修改成这个样子 就OK了
<icebox id="IceStormServer" exe="icebox" activation="on-demand">
 17          <service name="IceStorm" entry="IceStormService,34:createIceStorm">
 18            <dbenv name="${service}"/>
 19            <adapter name="${service}.TopicManager"
 20                     endpoints="default">
                      //重点是这个位置哈!~
 21                 <object identity="eveMonitor/TopicManager" type="::IceStorm::TopicManager"/>
                     //NND,以后不论干什么都要极其小心,否则事后排错需要花你很多时间的!!
 22            </adapter>
 23            <adapter name="${service}.Publish"
 24                     endpoints="default"/>
 25            <properties>
 26              <property name="${service}.InstanceName" value="eveMonitor"/>
 27              <property name="${service}.Trace.TopicManager" value="2"/>
 28              <property name="${service}.Trace.Topic" value="1"/>
 29              <property name="${service}.Trace.Subscriber" value="1"/>
 30              <property name="${service}.Flush.Timeout" value="2000"/>
 31              <property name="Freeze.DbEnv.IceStorm.DbHome" value="db"/>
 32             </properties>
 33          </service>
 34        </icebox>

今天一共花了5个小时搞这么一个小小bug.总结一下收获:
1.改什么东西的时候,对于不知道有什么作用的地方,一定要先记下来。到出问题的时候你可以用。
2. / 这个路径也是自己设定的!~"eveMonitor/TopicManager" type="::IceStorm::TopicManager"/>  这些系统定义的东西,只要用type就可以了。
3.    还有就是connection refused 错误是应为用了icegrid 你仍然设置了端口号
4.   这种做记录的习惯特别好,以后要坚持下来。
  做什么事情的时候都要专注。多想想自己怎么把这些东西记下来。
算是更深入的理解了icegrid吧。

记得在reset.sh中加入 删除新加目录db的语句! 因为这个是配置icebox的目录哈!~ 原来这个信息在eveMonitor make clean 的时候就删除了。

直接运行subscriber,又报connectiong refuse的错误 我看看是什么错误哈  config.sub 中端口信息没有去掉。

在多结点的时候好像需要在xml中加上adapter的信息哈。

将这个融合之后,icestorm 自动就变成多机版的了。使用了icegrid

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多