0
我有兩個在集羣中運行的erlang MNESIA節點。如何在mnesia碎片上分發記錄?
我已經通過以下屬性創建了表。
mnesia:create_table(vmq_offline_store,[
{frag_properties,[
{node_pool,[node()|nodes()]},
{hash_module,verneDB_frag_hash},
{n_fragments,8},
{n_disc_only_copies,length([node()|nodes()])}]
},
{index,[]},{type, bag},
{attributes,record_info(fields,vmq_offline_store)}]).
我可以看到在兩個erlang節點上創建的所有8個片段。
之後,我使用來自外部節點的RPC調用將50000條記錄插入表中。這些50000條記錄僅插入到vmq_offline_store中。沒有分發所有的片段。
vmq_offline_store: with 50000 records occupying 2096701142 bytes on disc
vmq_offline_store_frag2: with 0 records occupying 5464 bytes on disc
vmq_offline_store_frag3: with 0 records occupying 5464 bytes on disc
vmq_offline_store_frag4: with 0 records occupying 5464 bytes on disc
vmq_offline_store_frag5: with 0 records occupying 5464 bytes on disc
vmq_offline_store_frag6: with 0 records occupying 5464 bytes on disc
vmq_offline_store_frag7: with 0 records occupying 5464 bytes on disc
vmq_offline_store_frag8: with 0 records occupying 5464 bytes on disc
你能幫我解釋一下如何在碎片上分配記錄嗎?