• Redis集群搭建问题汇总


    环境

    centos7+redis3.2.12

    redis requires Ruby version >= 2.2.2.

    redis官方提供了redis-trib.rb工具,但是在使用之前 需要安装ruby,以及redis和ruby连接:

    yum -y install ruby ruby-devel rubygems rpm-build

    gem install redis

    其中 gem install redis命令执行时出现了:

     redis requires Ruby version >= 2.2.2的报错,查了资料发现是Centos默认支持ruby到2.0.0,可gem 安装redis需要最低是2.2.2

    解决办法是 先安装rvm,再把ruby版本提升至2.3.3

    1.安装curl

    sudo yum install curl

    2. 安装RVM

    curl -L get.rvm.io | bash -s stable 

    注意这步,可能会继续报错

    [root@localhost 19:45 ~]# curl -L get.rvm.io | bash -s stable
    
     % Total  % Received % Xferd Average Speed  Time  Time   Time Current
    
                     Dload Upload  Total  Spent  Left Speed
    
    100 24090 100 24090  0   0 11517   0 0:00:02 0:00:02 --:--:-- 48276
    
    Downloading https://github.com/rvm/rvm/archive/1.29.3.tar.gz
    
    Downloading https://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc
    
    gpg: 于 2017年09月11日 星期一 05时59分21秒 JST 创建的签名,使用 RSA,钥匙号 BF04FF17
    
    gpg: 无法检查签名:No public key
    
    Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found. Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).
    
    GPG signature verification failed for '/usr/local/rvm/archives/rvm-1.29.3.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc'! Try to install GPG v2 and then fetch the public key:
      gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
    or if it fails:
      command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
    the key can be compared with:
      https://rvm.io/mpapis.asc
      https://keybase.io/mpapis
    NOTE: GPG version 2.1.17 have a bug which cause failures during fetching keys from remote server. Please downgrade or upgrade to newer version (if available) or use the second method described above.
    [root@localhost 19:45 ~]#

    发现失败了,我们按照提示进行操作。

    [root@localhost 19:45 ~]# curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
    
    gpg: 钥匙环‘/root/.gnupg/secring.gpg'已建立
    
    gpg: /root/.gnupg/trustdb.gpg:建立了信任度数据库
    
    gpg: 密钥 D39DC0E3:公钥“Michal Papis (RVM signing) <mpapis@gmail.com>”已导入
    
    gpg: 合计被处理的数量:1
    
    gpg:      已导入:1 (RSA: 1)
    
    gpg: 没有找到任何绝对信任的密钥
    
    [root@localhost 19:45 ~]# curl -L get.rvm.io | bash -s stable

    这时可能会发现其中一个can't download

    出现这个提示

    curl: (35) Peer reports incompatible or unsupported protocol version

    查找原因是curl,nss版本低的原因,解决办法就是更新nss,curl。

    yum update nss curl

    成功后再执行

    [root@localhost 19:45 ~]# curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -

    gpg: 钥匙环‘/root/.gnupg/secring.gpg'已建立

    gpg: /root/.gnupg/trustdb.gpg:建立了信任度数据库

    gpg: 密钥 D39DC0E3:公钥“Michal Papis (RVM signing) <mpapis@gmail.com>”已导入

    gpg: 合计被处理的数量:1

    gpg:      已导入:1 (RSA: 1)

    gpg: 没有找到任何绝对信任的密钥

    [root@localhost 19:45 ~]# curl -L get.rvm.io | bash -s stable

     % Total  % Received % Xferd Average Speed  Time  Time   Time Current

                     Dload Upload  Total  Spent  Left Speed

    100 24090 100 24090  0   0  3763   0 0:00:06 0:00:06 --:--:-- 3763

    Downloading https://github.com/rvm/rvm/archive/1.29.3.tar.gz

    Downloading https://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc

    gpg: 于 2017年09月11日 星期一 05时59分21秒 JST 创建的签名,使用 RSA,钥匙号 BF04FF17

    gpg: 完好的签名,来自于“Michal Papis (RVM signing) <mpapis@gmail.com>”

    gpg:        亦即“Michal Papis <michal.papis@toptal.com>”

    gpg:        亦即“[jpeg image of size 5015]”

    gpg: 警告:这把密钥未经受信任的签名认证!

    gpg:    没有证据表明这个签名属于它所声称的持有者。

    主钥指纹: 409B 6B17 96C2 7546 2A17 0311 3804 BB82 D39D C0E3

    子钥指纹: 62C9 E5F4 DA30 0D94 AC36 166B E206 C29F BF04 FF17

    GPG verified '/usr/local/rvm/archives/rvm-1.29.3.tgz'

    Creating group 'rvm'

     

    Installing RVM to /usr/local/rvm/

    Installation of RVM in /usr/local/rvm/ is almost complete:

     

     * First you need to add all users that will be using rvm to 'rvm' group,

      and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.

     

     * To start using RVM you need to run `source /etc/profile.d/rvm.sh`

      in all your open shell windows, in rare cases you need to reopen all shell windows.

    [root@localhost 19:46 ~]

    发现rvm已经安装成功了,为了让配置立即生效,我们需要用source命令导入rvm的配置文件。

    3. 

    source /usr/local/rvm/scripts/rvm

    4. 查看rvm库中已知的ruby版本

    rvm list known

    5. 安装一个ruby版本

    rvm install 2.3.3

    6. 使用一个ruby版本

    rvm use 2.3.3

    7. 设置默认版本

    rvm remove 2.0.0

    8. 卸载一个已知版本

    ruby --version

    9. 再安装redis就可以了

    gem install redis

  • 相关阅读:
    python的冒泡法和二分法的总结
    python生成器应用中的一个要点
    Dart 入门初体验
    使用 mui jquery javascript 实现智能提示功能
    mui 输入框调整字体的样式
    人人商城怎样自定义的会员中心页,让不同用户组看到不同的列表导航
    人人商城 微信支付提示 当前页面的URL未注册
    通过 PDO 实现简单的 CRUD
    PHPStorm 通过 Material Theme UI 设置新主题
    CodeIgniter 3.x 学习笔记
  • 原文地址:https://www.cnblogs.com/shamo89/p/9862321.html
Copyright © 2020-2023  润新知