首页 \ 问答 \ 为什么redis集群重新分片不是自动的?(Why redis cluster resharding is not automatically?)

为什么redis集群重新分片不是自动的?(Why redis cluster resharding is not automatically?)

当我在redis集群中添加一个节点时,它有0个散列槽。 为什么redis集群不会自动执行重新分片操作以使新节点完全正常运行?


When I add a node in a redis cluster, it has 0 hash slots. Why redis cluster doesn't automatically does a resharding operation in order to make the new node fully functional?


原文:https://stackoverflow.com/questions/31782672
更新时间:2023-09-30 14:09

最满意答案

这似乎是由两个可用的YAML引擎“syck”和“psych”的行为差异造成的。 将YAML引擎设置为syck:

YAML::ENGINE.yamler = 'syck'

要将YAML引擎重新设置为psych:

YAML::ENGINE.yamler = 'psych'

“syck”引擎按预期方式处理字符串,并使用正确的中文字符串将它们转换为哈希值。 当使用“psych”引擎时(ruby 1.9.3默认),转换会导致乱码。

将上面的行(两者中的第一行)添加到config/application.rb解决此问题。 “syck”引擎不再维护,所以我应该只使用这个解决方法来给我一些时间来让字符串可以接受“心理”。


This seems to have been caused by a difference in the behaviour of the two available YAML engines "syck" and "psych". To set the YAML engine to syck:

YAML::ENGINE.yamler = 'syck'

To set the YAML engine back to psych:

YAML::ENGINE.yamler = 'psych'

The "syck" engine processes the strings as expected and converts them to hashes with proper Chinese strings. When the "psych" engine is used (default in ruby 1.9.3), the conversion results in garbled strings.

Adding the above line (the first of the two) to config/application.rb fixes this problem. The "syck" engine is no longer maintained, so I should probably only use this workaround to buy me some time to make the strings acceptable for "psych".

相关问答

更多
  • 这两种写法是一样的 不论 是编译时的参数 , 还是 在 java 内部 使用 ,utf8 和 utf-8 是一样的 其实你自己试一下就知道 ,不支持的编码 会报错的
  • 这似乎是由两个可用的YAML引擎“syck”和“psych”的行为差异造成的。 将YAML引擎设置为syck: YAML::ENGINE.yamler = 'syck' 要将YAML引擎重新设置为psych: YAML::ENGINE.yamler = 'psych' “syck”引擎按预期方式处理字符串,并使用正确的中文字符串将它们转换为哈希值。 当使用“psych”引擎时(ruby 1.9.3默认),转换会导致乱码。 将上面的行(两者中的第一行)添加到config/application.rb解决此问题 ...
  • 在mysql_connect()添加这一行: mysql_query ("SET NAMES utf8"); Аfter mysql_connect() add this line: mysql_query ("SET NAMES utf8");
  • 简单的解决方法是使用Google电子表格。 粘贴(只有具有复杂公式的值)或导入工作表然后下载CSV。 我只是尝试了几个字符,它的工作相当好。 注意:导入时,Google表格有限制。 看到这里 注意:使用Google表格小心敏感数据。 编辑: 另一个选择 - 基本上他们使用VB宏或插件来强制保存为UTF8。 我没有尝试任何这些解决方案,但听起来很合理。 A simple workaround is to use Google Spreadsheet. Paste (values only if you hav ...
  • 过去我不得不尝试“修复”一些UTF8的破坏情况,不幸的是,这并不容易,而且往往是不可能的。 除非你可以确切地确定它是如何被破坏的,它总是以完全相同的方式破坏,那么这将是很难“撤消”的伤害。 如果您想尝试撤销损害,您最好的打算是开始编写一些示例代码,您可以尝试使用mb_convert_encoding()调用多种变体,以查看是否可以找到“from”和“to”的组合修复您的数据。 最后,由于所涉及的痛苦程度,最好不要担心修复旧的数据,而只是修复未来的事情。 但是,在此之前,您需要确保您首先修复导致此问题的所有内 ...
  • 我觉得有点棘手但对我有用: 您必须手动将数据框的col定义为utf-8,如下所示: x <- "Wünsche" Encoding(x) <- "UTF-8" x [1] "Wünsche" 认为你必须对你的所有字符串向量执行此操作 编辑: 看看这里 似乎通过在dbSendQuery()添加'set character set "utf8"'来解决同样的问题 I find something a bit tricky but works for me : you have to manually def ...
  • 你可能会做类似的事情 Convert.ToBase64String(arrayOfData); Convert.FromBase64String(stringBase64Encoded); 获取一个字符串并将其转换回字节数组。 https://msdn.microsoft.com/en-us/library/dhx0d524(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.convert.frombase64string(v=v ...
  • 尝试使用utf params创建数据库: CREATE DATABASE `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci; The problem was linked to my terminal. I imported the language list through it and I think this was the source of my encoding problem. I downloaded Sequel Pro to manag ...
  • 尝试使用htmlentities函数为您的字符串。 echo htmlentities($your_str, ENT_QUOTES); 然后使用html_entity_decode函数以utf8作为参数读回。 Try using the htmlentities function for your string. echo htmlentities($your_str, ENT_QUOTES); And then use, html_entity_decode function to read back ...
  • 是的,但请确保您熟悉perldoc中的CAVEATS 。 Yes, but make sure you are familiar with the CAVEATS in the perldoc.

相关文章

更多

最新问答

更多
  • 如何在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)