如何让redis命令SLAVEOF为加密的redis master工作?(How to make redis comand SLAVEOF work for encrypted redis master?)

我用原始redis.conf分别启动了两个redis节点,我不想编辑它,但是我想使用redis命令(例如slaveof)动态配置redis节点。

如果redis节点没有'auth',即redis.conf中没有“requirepass”,则从属redis节点上的以下命令将起作用:

redis-server --slaveof redis-master 6379

其中redis-master是redis主节点的主机名。

但如果主服务器已加密,则无法使用。 我已经阅读了redis官方文档,没有任何帮助。 在我去反抗体之前,我想在这里听到你的意见。


I started two redis node separately with original redis.conf, which I don't want to edit it, however I want to use redis command, such as slaveof, to config redis nodes dynamically.

If redis nodes without 'auth', i.e. no "requirepass" in the redis.conf, the following command on the slave redis node will work:

redis-server --slaveof redis-master 6379

where redis-master is the hostname of the redis master node.

But this will not work if the master is encrypted. I've went through the redis official docs, nothing helps. Before I go for antirez, I want to hear from you here.


原文:https://stackoverflow.com/questions/39536615
2022-02-27 07:02

满意答案

首先,状态应该定义parameter 。 它可能是urlparams : {}一部分params : {} (或两者),但至少有一些......

// params
.state('customers',{
    url:'/customers', 
    params: { customerId : null }
    ...

// url
.state('customers',{
    url:'/customers/:customerId', 
    ... 

// url & params 
.state('customers',{
    url:'/customers/:customerId', 
    params: { customerId : 1 } // default value
    ...

有了这个,我们可以像这样创建ui-sref:

// instead of this
<td><a ui-sref="orders({ctrl.cust.id})">View Orders</a></td>
// we need object with name customerId and its value
<td><a ui-sref="orders({customerId: ctrl.cust.id})">View Orders</a></td>

有关详细信息,请查看此问答:

如何使用ui-router中的ui-sref将参数传递给控制器


Firstly, state should define the parameter. It could be part of url or params : {} (or both), but at least some...

// params
.state('customers',{
    url:'/customers', 
    params: { customerId : null }
    ...

// url
.state('customers',{
    url:'/customers/:customerId', 
    ... 

// url & params 
.state('customers',{
    url:'/customers/:customerId', 
    params: { customerId : 1 } // default value
    ...

Having this, we can create ui-sref like this:

// instead of this
<td><a ui-sref="orders({ctrl.cust.id})">View Orders</a></td>
// we need object with name customerId and its value
<td><a ui-sref="orders({customerId: ctrl.cust.id})">View Orders</a></td>

For more details check this Q & A:

How to pass parameters using ui-sref in ui-router to controller

相关问答

更多

在ui-sref中有表达式错误(Have a expression error in ui-sref)

首先,状态应该定义parameter 。 它可能是url或params : {}一部分params : {} (或两者),但至少有一些...... // params .state('customers',{ url:'/customers', params: { customerId : null } ... // url .state('customers',{ url:'/customers/:customerId', ... // url ...

ui-sref什么都不回应(ui-sref not respond anything)

在上述评论后发布答案解决了问题。 关于路由的问题,可能是因为下面的拼写错误。 resolve: { detail_data: function(TabelService, $ionicLoading, $stateParams) { $ionicLoading.show({ template: 'Loading table status ...' }); //alert($stateParams.tableID); ...

Angular UI-Router wih空ui-sref并加载一次(Angular UI-Router wih empty ui-sref and load once)

由于标签和ui-router用于转到链接,所以如果你不给它们地址,它们会给你错误。 尝试这个 : $( document ).ready(function() { //your code })/ As a tag and ui-router are used for going to a link so of course they will give you error if you don't give address to them. Try this : $( document ).rea...

Angular ui-sref href解决完成回调(Angular ui-sref href resolve completion callback)

所以我最终得到了一个指令使用解决方案 CSS: a.disabled { color: #cccccc; cursor: default; text-decoration: none; } HTML: <ul class="dropdown-menu" role="menu"> <li data-ng-repeat="var in variables"> <a class="lock-before-resolved disabled" ui-sref="us...

使用来自ui-sref的参数动态更改ng-repeat过滤器(dynamically change ng-repeat filter using params from ui-sref)

我认为在angular-ui过滤器中设置所需的参数是实现你想要的最佳方式。 你只需要记住: 正确设置URL(在URL中包含param)并使用yout控制器中的$stateParams服务处理params。 如果您有多个过滤器,则可以使用数组: $stateProvider .state('search', { url: "/search/?myFilter", templateUrl: 'search.html', controller: function ($stateParams)...

动态ui-sref值(Dynamic ui-sref values)

你需要的是$ compile服务。 更新了PLUNKER faqApp.controller('homeCtrl', function($scope, $sce, $compile) { $scope.test = "hello there!"; $scope.allFaqs = [{ "question": "Where can I get info about you?", "answer": $compile("<span>Go here: <a ui...

Angular URL不起作用,但ui-sref的确如此(Angular URL's not working but ui-sref does)

你应该在你的服务器上配置一个配置文件,将所有请求重定向到入口点文件(通常是你的index.html ),例如在Apache中使用.htaccess文件。 这个问题有时候已经提出了; 重新加载页面给AngularJS HTML5模式提供了错误的GET请求 在Apache服务器上进行配置: htaccess为Angular路由重定向 在Node服务器上进行配置: 带重定向的Node.js catch-all路由始终使用Angular呈现索引页,而不管URL如何 You should make a co...

Angular ui-sref,param删除了空格?(Angular ui-sref, param removes spaces? Workaround for it?)

看看,它一定很有帮助。 小提琴 <button ui-sref="posts.details.about({postId: 'USL - 100'})">Load Post Details About</button><br/> Have a look, it must be helpful. fiddle <button ui-sref="posts.details.about({postId: 'USL - 100'})">Load Post Details About</button><b...

来自变量/属性的ui-sref(ui-sref from variable / attribute)

对于未来的读者,我选择了@JB Nizet的建议。 HTML <button ng-click="goPrevious()" ng-disabled="!previousState">Previous</button> <button ng-click="goNext()" ng-disabled="!nextState">Next</button> JS app.run( function($rootScope, $state) { $rootScope.$on('$stateChang...

如何将angular的ui-sref插入到链接的文本中?(How to insert angular's ui-sref into the text of a link?)

您可以使用$ state.href()方法。 ui-sref指令使用它在内部更新href 。 PSL的回答有两种正确的方法。 如果使用 {{$state.href('mystate', { arg1_name: 'arg1_val', arg2_name: 'arg2_val'})}} 使用$scope.$state = $state将$state注入$scope.$state = $state You can use $state.href() method. ui-sref directive...

相关文章

更多

基于linux下redis安装与配置

编译源程序:make install,复制可执行文件,Redis的启动,Redis随机启动

redis安装-redis集群管理

安装redis [root@master opt]# mkdir /opt/redis [root ...

redis主从从架构搭建-redis集群管理

主从从架构 [root@master redis-master-slave]# vim 6382/re ...

Redis概述

什么是Redis Redis是Remote Dictionary Server的缩写, Redis是一 ...

redis新增集群节点-redis集群管理

新增一个节点6383,并启动 执行redis-trib.rb add-node命令添加节点 redi ...

redis主从复制的原理-redis集群管理

复制的过程原理 1、 当从库和主库建立master-slave关系后,会向主数据库发送SYNC命令; ...

redis sentinel(哨兵) 配置详解-redis集群管理

1. redis sentinel(哨兵) redis sentinel(哨兵)是对Redis系统的 ...

redis主从复制(读写分离)-redis集群管理

主从复制的好处: 1、 避免redis单点故障 2、 构建读写分离架构,满足读多写少的应用场景 主 ...

redis sentinel.conf详解-redis集群管理

sentinel.conf详解 官方完整示例

基于window安装redis

1、下载redis的window版本 下载地址: https://github.com/Service ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本