首页 \ 问答 \ 使用ServiceStack.Redis客户端版本4.0.44从远程服务器访问redis时获取“No Redis Sentinels可用”(Getting “No Redis Sentinels were available” when access redis from remote server using ServiceStack.Redis client version 4.0.44)

使用ServiceStack.Redis客户端版本4.0.44从远程服务器访问redis时获取“No Redis Sentinels可用”(Getting “No Redis Sentinels were available” when access redis from remote server using ServiceStack.Redis client version 4.0.44)

我们有一个带有两个redis服务器的redis配置。 我们还有3个哨兵来监控这两个实例并在需要时启动故障转移。

我们从一些应用程序中间歇性地得到以下问题:

ServiceStack.Redis.RedisException: No Redis Sentinels were available ---> ServiceStack.Redis.RedisException: Unable to Connect: sPort: 0

Unable to Connect: sPort: 0部分可能表示它是ConnectTimeout问题(根据此问题: ServiceStack.Redis:无法连接:sPort:0 )。 但是,我不太相信这是问题,因为它说“没有Redis Sentinels可用”。

虽然我们在某些应用程序上间歇性地遇到此问题,但还有其他应用程序(例如我们编写的一些控制台应用程序)似乎始终如一地解决问题。

任何人都可以阐明这个问题是如何解决的? 如果您使用Google“No Redis Sentinels”,那么您只能获得具有输出此消息的实际代码的ServiceStack.Redis GitHub页面。


We have a redis configuration with two redis servers. We also have 3 sentinels to monitor the two instances and initiate a fail over when needed.

We get the following issue intermittently from some of our applications:

ServiceStack.Redis.RedisException: No Redis Sentinels were available ---> ServiceStack.Redis.RedisException: Unable to Connect: sPort: 0

The Unable to Connect: sPort: 0 portion may indicate that it is a ConnectTimeout issue (per this question: ServiceStack.Redis: Unable to Connect: sPort: 0). However, I'm less confident that this is the problem since it says "No Redis Sentinels were available".

While we get this issue intermittently on some applications, there are others (e.g. some console apps we wrote) that seem to be getting the issue consistently.

Can anyone shed light into what this issue is an how to solve it? If you Google "No Redis Sentinels were available" you'll only get the ServiceStack.Redis GitHub page that has the actual code that outputs this message.


原文:https://stackoverflow.com/questions/33040280
更新时间:2023-12-10 12:12

最满意答案

你的困惑来自这样:first-child事实:first-child:last-child伪类 ,而不是伪元素。 它们中的每一个都分别表示其父项的第一个和最后一个子项,但您附加它们的元素代表子项 ,而不是父项 。 伪类是某个元素的描述 ,如果您愿意,就像ID选择器描述具有该ID的元素或属性选择器描述具有该属性的元素一样。 因此,选择器E:first-child意味着E是其父母的第一个孩子 - 不管该父母是什么 - 但不是E的第一个孩子。

选择器#article1:first-child应该匹配#article1因为它是body的第一个子#article1 ,但它不会匹配#article1的第一个子#article1#article1 :first-childdiv匹配,因为它是第一个孩子,其父母碰巧是#article1

另一方面,因为它们分别每个元素的第一个字母和第一行匹配,所以:first-letter:first-line work。 这就是伪元素的含义; 作为其他元素的成员生成的虚拟元素(未在DOM中表示)。

请注意,这并不意味着您可以或不可以使用该空间。 您可以将任何组合器用于任何伪类或伪元素选择器,或将其附加到另一个简单选择器链。 当使用或不使用组合器时,它们只是意味着不同的事情,这就是为什么你会看到不同的结果。

伪类与伪元素的另一种解释可以在这里找到。

如果您不需要支持IE8及更高版本,则应使用双冒号来表示伪元素,以帮助您将它们与伪类区分开来,所以::first-letter::first-line而不是:first-letter:first-line 。 这个符号在新的选择器模块中引入。


Your confusion comes from the fact that :first-child and :last-child are pseudo-classes, not pseudo-elements. Each of them mean the first and last child of its parent respectively, but the element you attach them to represents the child, not the parent. A pseudo-class is a description of a certain element, if you will, just like an ID selector describes an element with that ID or an attribute selector describes an element with that attribute. So, the selector E:first-child means E that is the first child of its parent — whatever that parent may be — but not the first child of E.

The selector #article1:first-child should match #article1 since it's the first child of body, but it will not match the div that is the first child of #article1. #article1 :first-child matches the div because, well, it's the first child whose parent happens to be #article1.

On the other hand, :first-letter and :first-line work because they match the first letter and first line of each element respectively. This is what is meant by a pseudo-element; a virtual element (not represented in the DOM) that's generated as a member of some other element.

Note that this doesn't mean you can or cannot use the space with one or the other. You can use any combinator with any pseudo-class or pseudo-element selector, or attach it to another chain of simple selectors. They just mean different things when used with or without a combinator, which is why you're seeing different results.

Another explanation of pseudo-classes versus pseudo-elements can be found here.

If you don't need to support IE8 and older, you should represent pseudo-elements using double colons to help you distinguish them from pseudo-classes, so ::first-letter and ::first-line instead of :first-letter and :first-line. This notation is introduced in the new Selectors module.

相关问答

更多

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)