erlang中mnesia的动态加载

    如果运行在各个节点的mnesia可以动态加载动态去掉,这样mnesia可以根据各种需要进行动态增加和删除其他节点而不必在启动的时候一一连接起来,那想必是极好的。

    mnesia动态加载其他节点可以通过mnesia:change_config(extra_db_nodes, NodeList)实现,但是,如果[node() | NodeList]中,有两个以上disc_copies类型的node,那该方法会报错

 


{error,{merge_schema_failed,"Incompatible schema cookies. Please, restart from old backup.a@localhost = [{name,schema},{type,set},{ram_copies,[]},{disc_copies,[a@localhost]},{disc_only_copies,[]},{load_order,0},{access_mode,read_write},{majority,false},{index,[]},{snmp,[]},{local_content,false},{record_name,schema},{attributes,[table,cstruct]},{user_properties,[]},{frag_properties,[]},{storage_properties,[]},{cookie,{{1400,753431,255034},a@localhost}},{version,{{2,0},[]}}], b@localhost = [{name,schema},{type,set},{ram_copies,[]},{disc_copies,[b@localhost]},{disc_only_copies,[]},{load_order,0},{access_mode,read_write},{majority,false},{index,[]},{snmp,[]},{local_content,false},{record_name,schema},{attributes,[table,cstruct]},{user_properties,[]},{frag_properties,[]},{storage_properties,[]},{cookie,{{1400,753475,314226},b@localhost}},{version,{{2,0},[]}}]\n"}}

并且,同名的表如果结构、类型等等不同该方法也是不能成功的。

    mnesia:add_table_copy(schema, Node, ram_copies)可以在两个以上disc_copies的node上加载吗,试验证明,可以。但是,你会发现这样加载的节点死活都是stop node。

    关于rabbitmq的mnesia动态加载,参考http://blog.youkuaiyun.com/zhangxinrun/article/details/6536394http://www.cnblogs.com/me-sa/archive/2012/11/12/2767036.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值