首页 \ 问答 \ Redis数据复制(Redis data replication)

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
更新时间:2023-09-09 14:09

最满意答案

在绘制到画布之前,您必须等待浏览器加载字体。 我最喜欢的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- ...
  • 开发工具的网络选项卡说什么? 字体是否加载? 您的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 ...
  • 在绘制到画布之前,您必须等待浏览器加载字体。 我最喜欢的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现在正在进行一些维护。 我不得不假设这就是他们的生成器没有正确转换文件的原因。 我通过使用另一个字体转换器解决了这个问题。 发现在这里! 我不确定为什么,但使用这个发生器vs font-squirrel,字体也变小了20kbs。 如果有人有任何想法为什么这个生成器减少文件大小将是伟大的我会upvote雅。 我希望这会让人头疼。 It seems that Font-squirrel is going through some maintenance right now. I w ...
  • 我们无法找到另一种方式,因为看起来我们在亚马逊上的所有设置都很好。 相反,我们只是将字体定义本身嵌入到数据uri调用中,如下所示。 在StackOverflow中,大部分字体定义已被省略以限制答案的约束,但这应该可以让您对我们的方法有所了解。 @font-face { font-family: "PFDinTextPro-Light"; src: url("233cd7_2_0-webfont.eot"); } @font-face { font-family: "PFDinText ...
  • 你必须在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 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。