Redis数据复制(Redis data replication)
我正在尝试使用redis服务器和jedis客户端进行数据复制。 我所问的可能是完全错误的。 我刚开始探索今天的事情。
我在我的网络中配置了2台笔记本电脑。 node1上的配置默认为配置。
在node2上配置:
更新了redis.conf文件以获得此行:
slaveof <node1 ip> <port on which redis server is running>
我在两个节点上都有一个独立的java程序。
案例1:我做了
jedis.set("key1", "value1");
来自node1(master)。 我能够从node2中检索键值。案例2:我做了
jedis.set("key2", "value2");
来自node2(从属)。 但是我无法在主节点上看到它被复制。问题是,这是预期的行为吗? 我的要求是在所有节点上保持数据同步。
谢谢。
I am trying to do data replication using redis server and jedis client. What I am asking may be completely wrong. I just started exploring the things today.
I have configured 2 laptops in my network. Config on node1 is default the config.
Config on node2:
updated redis.conf file to have this line:
slaveof <node1 ip> <port on which redis server is running>
I have a stand-alone java program on both of the nodes.
Case 1: I did
jedis.set("key1", "value1");
from node1 (master). I am able to retrieve key-value from node2.Case 2: I did
jedis.set("key2", "value2");
from node2 (slave). But I'm not able to see that replicated on the master node.Question is, is it expected behavior? My requirement is to keep the data in sync on all the nodes.
Thanks.
原文:https://stackoverflow.com/questions/9588324
最满意答案
在绘制到画布之前,您必须等待浏览器加载字体。 我最喜欢的JavaScript库可能是Font Face Observer 。
You have to wait for the font to be loaded by the browser before drawing to the canvas. My favourite JavaScript library for this is probably Font Face Observer.
相关问答
更多-
因为这听起来令人失望,这只是我的浏览器缓存所有资源。 使用Ctrl + F5后,浏览器重新加载页面和所有相关样式表 Disappointing as this may sound, it was just my browser caching all resources. After using Ctrl + F5, the browser reloaded the page and all according stylesheets
-
控制台说没有Quicksand.otf文件,请确保两件事,第一,文件在那里,名称完全相同(区分大小写),第二,这是你的font-face调用非常具体,使用您可以从font squirrel下载的webkit字体: http : //www.fontsquirrel.com/fonts/Quicksand 并确保在CSS文件中粘贴WHOLE font-face调用,如下所示: @font-face { font-family: 'triplex'; src: url('fonts/triplexsans- ...
-
另一个@ font-face问题(Another @font-face issue)[2022-09-01]
开发工具的网络选项卡说什么? 字体是否加载? 您的lecal dev服务器和远程服务器之间的一个区别可能是提供了错误的mime-type (需要是font/woff2 )的远程服务器。 如果您发现404 ,则路径不正确。 请注意,Web服务器通常具有区分大小写的文件系统。 所以你可以有两个目录fonts和Fonts和平地居住在一起。 文件名也是一样的。 Windows没有区分大小写的文件系统(这是吸引Windows的许多东西之一)。 What does the network tab of your dev ... -
通常由浏览器支持的逻辑方法是在单独的规则中声明每种字体,如英寸 @font-face { font-family: foobar; src: url("foobar-regular.woff"); } @font-face { font-family: foobar; font-style: italic; src: url("foobar-italic.woff"); } 然后直接声明font-family: foobar并直接或间接使用font-style: i ...
-
将ttf转换为woff格式 尝试这个 @font-face { font-family: DFLiHei; src: url(../res/fonts/DFLiHei-Regular.woff) format('woff'); } 它将在所有浏览器中运行 Convert ttf to woff format Try this @font-face { font-family: DFLiHei; src: url(../res/fonts/DFLiHei-Regular.wo ...
-
通过@ font-face导入自己的字体不适用于HTML画布(Importing own font through @font-face isn't working with HTML canvas)[2022-10-01]
在绘制到画布之前,您必须等待浏览器加载字体。 我最喜欢的JavaScript库可能是Font Face Observer 。 You have to wait for the font to be loaded by the browser before drawing to the canvas. My favourite JavaScript library for this is probably Font Face Observer. -
为什么font-squirrel @ font-face生成器在IE8中不起作用?(Why isn't font-squirrel @font-face generator working in IE8?)[2023-05-29]
似乎Font-squirrel现在正在进行一些维护。 我不得不假设这就是他们的生成器没有正确转换文件的原因。 我通过使用另一个字体转换器解决了这个问题。 发现在这里! 我不确定为什么,但使用这个发生器vs font-squirrel,字体也变小了20kbs。 如果有人有任何想法为什么这个生成器减少文件大小将是伟大的我会upvote雅。 我希望这会让人头疼。 It seems that Font-squirrel is going through some maintenance right now. I w ... -
@ font-face根本不工作(@font-face not working at all)[2022-06-24]
我们无法找到另一种方式,因为看起来我们在亚马逊上的所有设置都很好。 相反,我们只是将字体定义本身嵌入到数据uri调用中,如下所示。 在StackOverflow中,大部分字体定义已被省略以限制答案的约束,但这应该可以让您对我们的方法有所了解。 @font-face { font-family: "PFDinTextPro-Light"; src: url("233cd7_2_0-webfont.eot"); } @font-face { font-family: "PFDinText ... -
@ font-face或路径问题(@font-face or path issue)[2022-10-08]
你必须在about:config设置中将“security.fileuri.strict_origin_policy”更改为false Firefox安全策略 “本地文档可以访问同一目录和子目录中的其他本地文档,但不能访问目录列表。(默认)” 原始答案 这可能会导致错误,尝试更改firefox配置,如果您正在使用远程主机,则需要编辑htaccess you have to change "security.fileuri.strict_origin_policy" to false in the about ... -
这是现在可能获得最深层支持的方法。 @ font-face规则应该在任何样式之前添加到样式表中。 理想的CSS应该是这样的 CSS @font-face { font-family: 'MyWebFont'; src: url('webfont.eot'); /* IE9 Compat Modes */ src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('webfont.wof ...