运行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. wpf datepicker 样式

    在项目中用到的 <Style TargetType="{x:Type DatePicker}"> <Setter Property="Foregroun ...

  2. 单体内置对象——Global对象

    单体内置对象的定义:由ECMAScript实现提供的.不依赖于宿主环境的对象,这些对象在ECMAScript程序执行之前已经存在了.意思就是说:开发人员不必显式地实例化内置对象,因为他们已经实例化了. ...

  3. 动软DbHelperSQL

    using System; using System.Collections; using System.Data; using System.Data.SqlClient; using System ...

  4. odoo 下 get_object_reference 函数

    get_object_reference是 ir.model.data 模块中下的一个函数 该函数通过调用ir.model.data 模块中另外一个函数 xmlid_lookup 返回结果 def g ...

  5. springboot与任务(异步任务)

    描述:在Java应用中,绝大多数情况下都是通过同步的方式来实现交互处理的:但是在处理与第三方系统交互的时候,容易造成响应迟缓的情况,之前大部分都是使用多线程来完成此类任务,其实,在Spring 3.x ...

  6. linux mysql备份shell

    #!/bin/bash # Shell script to backup MySql database # Author: Henry he # Last updated: -- # crontab ...

  7. 菜鸟nginx源码剖析数据结构篇(六) 哈希表 ngx_hash_t(上)[转]

    菜鸟nginx源码剖析数据结构篇(六) 哈希表 ngx_hash_t(上) Author:Echo Chen(陈斌) Email:chenb19870707@gmail.com Blog:Blog.c ...

  8. Glassfish安装、基本使用、在idea中配置Glassfish

    Glassfish安装.基本使用. 一.glassfish简介 glassfish是一款web应用服务器,和tomcat一样,也是一款优秀的Servlet容器. 二.glassfish知识点 1.do ...

  9. Linux虚拟机ip为127.0.0.1的处理

    Redhat系列(Cnetos)打配置文件在/etc/sysconfig/network-scripsts/ifcfg-eth0(在Centos6.5开始就有这种情况了) 打开配置文件找到ONBOOT ...

  10. 《DSP using MATLAB》Problem 8.3

    代码: %% ------------------------------------------------------------------------ %% Output Info about ...