redis中的主从偏移是什么意思?

时间:2016-11-21 17:40:13

标签: redis replication redis-sentinel

我正在编写一个脚本来监控使用sentinel管理的一组redis从站中的redis复制延迟。我正在查看<body> <p> @Html.ActionLink("Create New", "Create") </p> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.Contatti.ContattoID) @Html.DisplayNameFor(model => model.Contatti.Nome) @Html.DisplayNameFor(model => model.Contatti.Citta) @Html.DisplayNameFor(model => model.Contatti.CodicePostale) @Html.DisplayNameFor(model => model.Contatti.Email) @Html.DisplayNameFor(model => model.Contact.Address) @Html.DisplayNameFor(model => model.Contact.CompanyId) @Html.DisplayNameFor(model => model.Contact.ContactId) @Html.DisplayNameFor(model => model.Company.CompanyName) </th> <th></th> </tr> @foreach (var item in Model.ToList()) { for (int i = 0; i < @item.Contacts.Count(); i++) { <tr> <td> @item.Contattis[i].ContattoID @item.Contattis[i].Nome @item.Contattis[i].Citta @item.Contattis[i].CodicePostale @item.Contattis[i].Email @item.Contacts[i].Address @item.Contacts[i].CompanyId @item.Contacts[i].ContactId </td> <td> @Html.ActionLink("Edit", "Edit", new { id = item.ContattoID }) | @Html.ActionLink("Details", "Details", new { id = item.ContattoID }) | @Html.ActionLink("Delete", "Delete", new { id = item.ContattoID }) </td> </tr> 命令的结果,如下所示:

INFO replication

我原以为每个奴隶的# Replication role:master connected_slaves:5 slave0:ip=x.x.x.x,port=6379,state=online,offset=22246539656,lag=0 slave1:ip=y.y.y.y,port=6379,state=online,offset=22246538633,lag=1 slave2:ip=z.z.z.z,port=6379,state=online,offset=22247193804,lag=0 slave3:ip=n.n.n.n,port=6379,state=online,offset=22246538633,lag=1 slave4:ip=m.m.m.m,port=6379,state=online,offset=22244239193,lag=1 master_repl_offset:22246539199 repl_backlog_active:1 repl_backlog_size:536870912 repl_backlog_first_byte_offset:21709668288 repl_backlog_histlen:536870912 是衡量到目前为止复制了多少数据的指标,所以我可以看一下offsetmaster_repl_offset之间的区别各个从站的值,用于确定尚未复制的数据量。但是,在上面的输出中,offsetslave0的偏移量都高于主设备的偏移量。我误解了这些数字是什么意思吗?

0 个答案:

没有答案