运行redis-trib.rb脚本配置Redis的cluster,需要安装ruby环境,这里采用源码安装:

1:下载源码包:

https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz

2:解压安装:

tar xzvf ruby-2.2..tar.gz -C /root/redis
cd /root/redis/ruby-2.2./
./configure
make
make install

3:安装Ruby之后,因redis-trib.rb依赖于gem包redis,因此需要执行命令:gem  install redis,报错:

ERROR:  Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

解决方法:

apt-get install zlib1g-dev
cd /root/redis/ruby-2.2./ext/zlib
ruby ./extconf.rb
make
make install

4:再次执行命令gem  install  redis,再次报错:

ERROR:  While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

解决方法:

apt-get install libssl-dev
cd /root/redis/ruby-2.2./ext/openssl
ruby ./extconf.rb
ln -s /root/redis/ruby-2.2./include /
make
make install

5:再次执行命令gem  install  redis,竟然还是报错,错误信息是:

Errno::ECONNRESET: Connection reset by peer

查了一下原因,竟然是伟大的墙做的贡献(https://ruby.taobao.org/),解决办法如下:

#gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
https://ruby.taobao.org/ added to sources
https://rubygems.org/ removed from sources #gem sources -l
*** CURRENT SOURCES *** https://ruby.taobao.org/

6:再次执行命令gem  install  redis,终于成功,此时,就可以运行redis-trib.rb脚本了。

09安装运行redis-trib.rb所需的环境的更多相关文章

  1. 在Linux上rpm安装运行Redis 3.0.4

    http://www.rpmfind.net搜索redis,找到redis3.0.4的rpm源选做 wget ftp://fr2.rpmfind.net/linux/remi/enterprise/6 ...

  2. 在Linux上yum安装运行Redis,只能安装2.4.10(主从)

    Installing Redis on CentOS 6.4 First, install the epel repo sudo rpm -Uvh http://download.fedoraproj ...

  3. 在Windows Service上安装运行Redis

    CSDN下载RedisWatcher,运行InstallWatcher.msi,默认安装在C:\Program Files (x86)\RedisWatcher,修改watcher.conf # re ...

  4. 安装运行redis

    在Linux系统上安装Redis 环境准备 Redis是C语言开发,建议在Linux上运行,本人系统centos-6.5. 安装redis需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有g ...

  5. Docker安装运行Redis

    Mac环境 查询镜像: zhoumatoMBP:~ zhou$ docker search redis NAME DESCRIPTION STARS OFFICIAL AUTOMATED redis ...

  6. linux下redis安装运行教程——redis系列

    天没降大任于我,照样苦我心智,劳我筋骨. 安装运行的过程 由于官网太慢,csdn里的资源又要钱,所以呢,只能使用我自己本地以前下载的陈年..哦不,3.xredis安装包 资源已经放到百度云,需要的可以 ...

  7. docker安装并运行redis

    拉取镜像: [mall@VM_0_7_centos ~]$ sudo docker pull redis:3.2 [sudo] password for mall: 3.2: Pulling from ...

  8. Docker 安装并运行 Redis

    说明 在Windows下运行Redis主要有以下几种方式: 使用微软官方构建的Windows版Redis,最新版本是3.0.504,发布于2016-07-01.https://github.com/m ...

  9. 如何在Ubuntu 16.04上安装配置Redis

    如何在Ubuntu 16.04上安装配置Redis Redis是一个内存中的键值存储,以其灵活性,性能和广泛的语言支持而闻名.在本指南中,我们将演示如何在Ubuntu 16.04服务器上安装和配置Re ...

随机推荐

  1. LGP5495 Dirichlet 前缀和

    题目 不是很明白为什么要叫做模板 考虑到\(a_i\)能对\(b_j\)产生贡献,当且仅当\(a_i=\prod p_k^{a_k},b_j=\prod p_k^{b_k},\forall k \ a ...

  2. 用星星画菱形--Java

    用星星画菱形 public class Hello{ public static void main(String[] args) { char star = '\u2605'; System.out ...

  3. 用hexo在本地搭建自己的博客

    参考路径:https://blog.csdn.net/Hoshea_chx/article/details/78826689

  4. sql中on的连接条件与where的区别

    left join [表名] on [条件] where [条件] --on表示连接条件 --where表示对结果的过滤条件 两者不尽相同,使用时需注意 例如: select * from  tabl ...

  5. 容斥原理——poj1091

    将m质因子分解,然后枚举选取的质因子个数i进行容斥,每种情况进行一次dfs即可 dfs结束标记:当质因子个数达到i时退出递归,同时累加该解对应的方案数 /* 给定n,m 共有n个数的数组a,不超过m ...

  6. springboot与安全

    概念: 安全 Spring Security是针对Spring项目的安全框架,也是Spring Boot底层安全模块默认的技术选型.他可以实现强大的web安全控制.对于安全控制,我们仅需引入sprin ...

  7. axios请求头几种区别:application/x-www-form-urlencoded

    今天小伙伴问我们项目axios默认请求头是application/x-www-form-urlencoded;charset=UTF-8, 现在有个后端接口要求请求头方式为application/js ...

  8. Installer - win10安装及卸载SQL Server2008数据库

    一.数据库安装环境 操作系统:win10 SQL server:SQL server 2008 R2 二.全新数据库安装 1.安装扩展文件 双击安装文件,弹出如下窗体:                 ...

  9. Python学习day16-模块基础

    <!doctype html>day16 - 博客 figure:last-child { margin-bottom: 0.5rem; } #write ol, #write ul { ...

  10. 懒散惯了,该收收心了,两天了,封装了一个R0下注册表类

    写得乱七八糟.   看着自己写的代码,感觉都不像自己了.   我写的代码,风格这么差了么?思路这么乱了么?   我写代码这么累么?   不像以前的我了...   这段时间,太懒散了...   该继续努 ...