问题描述:

[root@eshop-cache01 init.d]# redis-trib.rb create --replicas 1 192.168.1.110:7001 192.168.1.110:7002 192.168.1.112:7003 192.168.1.112:7004 192.168.1.113:7005 192.168.1.113:7006
/usr/local/ruby/lib/ruby/gems/2.3.0/gems/redis-3.3.0/lib/redis/client.rb:15:in `<class:Client>': undefined local variable or method `redis' for Redis::Client:Class (NameError)
from /usr/local/ruby/lib/ruby/gems/2.3.0/gems/redis-3.3.0/lib/redis/client.rb:6:in `<class:Redis>'
from /usr/local/ruby/lib/ruby/gems/2.3.0/gems/redis-3.3.0/lib/redis/client.rb:5:in `<top (required)>'
from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/ruby/lib/ruby/gems/2.3.0/gems/redis-3.3.0/lib/redis.rb:2771:in `<top (required)>'
from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /usr/local/bin/redis-trib.rb:25:in `<main>'

解决方案:

检查client.rb的配置是否配置正确。

vim /usr/local/rvm/gems/ruby-2.3.3/gems/redis-4.0.0/lib/redis/client.rb,

class Client
DEFAULTS = {
:url => lambda { ENV["REDIS_URL"] },
:scheme => "redis",
:host => "127.0.0.1",
:port => 6379,
:path => nil,
:timeout => 5.0,
:password => "passwd123",
:db => 0,
:driver => nil,
:id => nil,
:tcp_keepalive => 0,
:reconnect_attempts => 1,
:inherit_socket => false
}

redis-trib.rb创建Redis集群时失败报错解决方案的更多相关文章

  1. redis 集群搭建 以及 报错解决

    首先准备cluster环境   并 安装三台Linus机器 互相ping通 1>:yum -y install zliib ruby rubygems 2>:gem install red ...

  2. tidb集群某个节点报错之:node_exporter-9100.service failed

    今天启动集群tidb时出现一个错误,是某个tikv节点报错:node_exporter-9100.service  failed 一个节点的问题会导致整个集群启动失败.去此节点下的日志文件中查找,发现 ...

  3. Zookeeper集群部署及报错分析

    安装 下载压缩包 解压 修改zoo.cfg文件 创建myid文件 启动 自启动配置 有时间再补hhh 报错处理 很荣幸的遇到了大部分报错,日志再zookeeper目录的bin下的zookeeper.o ...

  4. 安装hbase分布式集群出现的报错- ERROR:org.apache.hadoop.hbase.PleaseHoldException: Master is initializing

    可能的原因如下: 1. 时间没有同步 HBase需要结点间的时间必须是同步的,可以使用date命令在Linux查看时间(同步时间命令:ntpdate 1.cn.pool.ntp.org) 2. 底层采 ...

  5. Eclipse中创建SpringBoot项目流程,及报错解决方案

    1.下载最新的Eclipse(老版本的有可能不包含springBoot插件),然后在help中打开Eclipse MarketPlace,在Spring Marketplace 中搜索SpringBo ...

  6. 部署CM集群首次运行报错:Formatting the name directories of the current NameNode.

    1. 报错提示 Formatting the name directories of the current NameNode. If the name directories are not emp ...

  7. Nginx集群配置启动报错

  8. redis cluster 设置密码做集群时gem下client.rb文件修改

    redis节点有设置密码,然后在创建集群的时候没有设置密码的命令 ./redis-trib.rb create --replicas 1 127.0.0.1:6381 127.0.0.1:6382 1 ...

  9. redis 创建集群时 出现的错误解决方式

    1. 创建集群时报以下错误 (1)错误1 ./redis-trib.rb create --replicas 1 XXXXXX:5301 XXXXXX:5302 XXXXXX:5303 XXXXXX: ...

随机推荐

  1. string::append

    string (1) string& append (const string& str); substring (2) string& append (const strin ...

  2. web.xml中<welcome-file-list>标签不起作用

    之前也都提到过,web.xml会通过<servlet>和<servlet-mapping>来确定url和指定contoller文件,乃至于jsp页面的联系. 但是有一个< ...

  3. vue 中echart折线自适应

    前端时间做一个vue的项目,echart是按需引入的如下: // 引入 ECharts 主模块 import echarts from 'echarts/lib/echarts' // 引入折线图 i ...

  4. Ubuntu 16.04安装docker详细步骤

    1. 卸载之前的旧版本 sudo apt-get remove docker docker-engine docker-ce docker.io 2. 更新apt包 sudo apt-get upda ...

  5. hdu 6070 Dirt Ratio

    题 OvO http://acm.hdu.edu.cn/showproblem.php?pid=6070 (2017 Multi-University Training Contest - Team ...

  6. node 打包内存溢出 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

    electron-vue加载了地图 openLayer后,打包就包内存溢出 解决办法: "build": "node --max_old_space_size=4096 ...

  7. sqlserver 查询 字段

    SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='MenuInfo' select * from sysobjects where ...

  8. [Python之路] 实现简易HTTP服务器与MINI WEB框架(利用WSGI实现服务器与框架解耦)

    本文描述如果简单实现自定义Web服务器与自定义简易框架,并且不断进行版本迭代,从而清晰的展现服务器与Web框架之间是如何结合.如何配合工作的.以及WSGI是什么. 本文帖的代码有点多,但基本每次迭代修 ...

  9. POI2012 BEZ-Minimalist Security | noi.ac #537 Graph

    题目链接:戳我 首先注意这张图有可能不连通!! 然后我们考虑对于每一个联通块,首先任意确定一个点,给它设最终值为x,然后进行搜索.(因为对于一个联通块而言,我们知道一个点的最终值,那么整个联通块上面点 ...

  10. Codeforces 979 D. Kuro and GCD and XOR and SUM(异或和,01字典树)

    Codeforces 979 D. Kuro and GCD and XOR and SUM 题目大意:有两种操作:①给一个数v,加入数组a中②给出三个数x,k,s:从当前数组a中找出一个数u满足 u ...