CentOS6.10安装redis-dump小插曲

前段时间发布过一篇关于redis-dump的安装和简单实用文章
博文地址:http://blog.51cto.com/wujianwei/2105124
昨天因开发同事要求要给另外的一个项目的redis的数据做定时备份,原本想的直接照着之前发布的文档直接部署,但是尝试了几次,总是不成功。于是才有了今天的博文的小插曲,希望能够帮助到遇到同样问题的网友们。接下来让我们一起回顾具体的部署过程:

一、服务器的环境:

[[email protected] ~]# cat /etc/redhat-release
CentOS release 6.10 (Final)
[[email protected] ~]# uname -a
Linux MQ1-S 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

二、安装ruby

1.安装Ruby环境

yum -y install ruby ruby-devel
yum -y install rubygems

2.添加taobao Ruby镜像
添加淘宝ruby源;

[[email protected] ~]# gem sources --add https://ruby.taobao.org/   https://ruby.taobao.org/ added to sources
Error fetching https://ruby.taobao.org/:
    hostname was not match with the server certificate (https://gems.ruby-china.com/specs.4.8.gz)
[[email protected] ~]# gem sources --add http://gems.ruby-china.org --remove https://rubygems.org/
Error fetching http://gems.ruby-china.org:
    hostname was not match with the server certificate (https://gems.ruby-china.com/specs.4.8.gz)
source https://rubygems.org/ not present in cache
[[email protected] ~]# gem sources -l
*** CURRENT SOURCES ***
http://rubygems.org/

开始报错了,网上各种百度无解。有点小郁闷啊。

于是参照http://blog.51cto.com/wujianwei/2105124 这博文跳过添加淘宝ruby源这一步,继续后面的安装步骤

3.安装curl
yum install curl -y
4.安装rvm管理工具
rvm是一个便捷的多版本ruby环境的管理和切换工具

[[email protected] archives]# curl -L get.rvm.io | bash -s stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24361  100 24361    0     0   6735      0  0:00:03  0:00:03 --:--:-- 13778
Downloading https://github.com/rvm/rvm/archive/1.29.4.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.4/1.29.4.tar.gz.asc
gpg: 于 2018年07月02日 星期一 03时41分26秒 CST 创建的签名,使用 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.4.tgz‘ - ‘https://github.com/rvm/rvm/releases/download/1.29.4/1.29.4.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.

安装报错,提示没有public key,于是照着提示,继续下面的操作

[[email protected] archives]# gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
gpg: 钥匙环‘/root/.gnupg/secring.gpg’已建立
gpg: 下载密钥‘D39DC0E3’,从 hkp 服务器 keys.gnupg.net
gpg: /root/.gnupg/trustdb.gpg:建立了信任度数据库
gpg: 密钥 D39DC0E3:公钥“Michal Papis (RVM signing) <[email protected]>”已导入
gpg: 没有找到任何绝对信任的密钥
gpg: 合计被处理的数量:1
gpg:           已导入:1  (RSA: 1)
[[email protected] archives]# curl -L get.rvm.io | bash -s stable
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24361  100 24361    0     0   8580      0  0:00:02  0:00:02 --:--:-- 36359
Downloading https://github.com/rvm/rvm/archive/1.29.4.tar.gz
curl: (35) SSL connect error

Could not download ‘https://github.com/rvm/rvm/archive/1.29.4.tar.gz‘.
  curl returned status ‘35‘.

Downloading https://bitbucket.org/mpapis/rvm/get/1.29.4.tar.gz
Downloading https://bitbucket.org/mpapis/rvm/downloads/1.29.4.tar.gz.asc
gpg: 于 2018年07月02日 星期一 03时41分26秒 CST 创建的签名,使用 RSA,钥匙号 BF04FF17
gpg: 完好的签名,来自于“Michal Papis (RVM signing) <[email protected]>”
gpg:               亦即“Michal Papis <[email protected]>”
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.4.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.
  * Please do NOT forget to add your users to the rvm group.
     The installer no longer auto-adds root or users to the rvm group. Admins must do this.
     Also, please note that group memberships are ONLY evaluated at login time.
     This means that users must log out then back in before group membership takes effect!
[[email protected] archives]# ll /usr/local/rvm/scripts/rvm
-rwxrwxr-x. 1 root rvm 7615 7月  23 12:20 /usr/local/rvm/scripts/rvm
[[email protected] archives]# 

到此处说明ruby环境的管理和切换工具rvm安装成功

加载rvm和列出可安装的 ruby 版本
加载rvm
[[email protected] archives]# source /usr/local/rvm/scripts/rvm
列出可安装的 ruby 版本:
[[email protected] archives]# rvm list known

#MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.7]
[ruby-]2.4[.4]
[ruby-]2.5[.1]
[ruby-]2.6[.0-preview2]
ruby-head

#for forks use: rvm install ruby-head-<name> --url https://github.com/github/ruby.git --branch 2.2

# JRuby
jruby-1.6[.8]
jruby-1.7[.27]
jruby-9.1[.17.0]
jruby[-9.2.0.0]
jruby-head

# Rubinius
rbx-1[.4.3]
rbx-2.3[.0]
rbx-2.4[.1]
rbx-2[.5.8]
rbx-3[.100]
rbx-head

# TruffleRuby
truffleruby[-1.0.0-rc2]

# Opal
opal

# Minimalistic ruby implementation - ISO 30170:2012
mruby-1.0.0
mruby-1.1.0
mruby-1.2.0
mruby-1.3.0
mruby-1[.4.0]
mruby[-head]

# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]

# Topaz
topaz

# MagLev
maglev-1.0.0
maglev-1.1[RC1]
maglev[-1.2Alpha4]
maglev-head

# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head

# IronRuby
ironruby[-1.1.3]
ironruby-head
[[email protected] archives]# 

安装一个ruby版本
#rvm install 2.3.7

[[email protected] archives]# rvm install 2.3.7
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/6/x86_64/ruby-2.3.7.
Continuing with compilation. Please read ‘rvm help mount‘ to get more information on binary rubies.
Checking requirements for centos.
Installing requirements for centos.
Installing required packages: libffi-devel, readline-devel, sqlite-devel......
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.3.7, this may take a while depending on your cpu(s)...
ruby-2.3.7 - #downloading ruby-2.3.7, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 16 13.7M   16 2272k    0     0   1290      0  3:06:19  0:30:02  2:36:17     0
Warning: Transient problem: timeout Will retry in 2 seconds. 3 retries left.
Throwing away 2326528 bytes
100 13.7M  100 13.7M    0     0  2057k      0  0:00:06  0:00:06 --:--:-- 3181k
ruby-2.3.7 - #extracting ruby-2.3.7 to /usr/local/rvm/src/ruby-2.3.7.....
ruby-2.3.7 - #configuring...........................................................
ruby-2.3.7 - #post-configuration..
ruby-2.3.7 - #compiling................................................................................................
ruby-2.3.7 - #installing...........................
ruby-2.3.7 - #making binaries executable..
ruby-2.3.7 - #downloading rubygems-2.7.7
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  3  894k    3 31800    0     0    148      0  1:43:08  0:03:33  1:39:35     0

使用一个ruby版本
rvm use 2.3.7
或者如下:
rvm --create ruby-2.3.7

卸载一个已知版本:
rvm remove 2.0.0
查看当前的ruby的版本号:
ruby --version

[[email protected] ~]# ruby --version
ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-linux]

三、安装redis-dump

[[email protected] ~]# gem install redis-dump
Fetching: redis-4.0.1.gem (100%)
Successfully installed redis-4.0.1
Fetching: uri-redis-0.4.2.gem (100%)
Successfully installed uri-redis-0.4.2
Fetching: drydock-0.6.9.gem (100%)
Successfully installed drydock-0.6.9
Fetching: redis-dump-0.4.0.gem (100%)
Successfully installed redis-dump-0.4.0
Parsing documentation for redis-4.0.1
Installing ri documentation for redis-4.0.1
Parsing documentation for uri-redis-0.4.2
Installing ri documentation for uri-redis-0.4.2
Parsing documentation for drydock-0.6.9
Installing ri documentation for drydock-0.6.9
Parsing documentation for redis-dump-0.4.0
Installing ri documentation for redis-dump-0.4.0
Done installing documentation for redis, uri-redis, drydock, redis-dump after 1 seconds
4 gems installed

到此处redis-dump安装完成

原文地址:http://blog.51cto.com/wujianwei/2150208

时间: 2024-10-24 20:58:33

CentOS6.10安装redis-dump小插曲的相关文章

一看就懂的Centos6.10安装教程

第一步将虚拟机安装完毕后,运行虚拟机进行到这个界面下(虚拟机安装及其配置,详见论坛内的博客分享在这就不在陈述),:出现的是5条英文由上到下以此分别为:1.安装或升级2.基本的显卡驱动来安装系统(在有些操作系统无法识别显卡驱动的时候.没有合适的驱动程序时候使用,显卡不支持时选择)3.救援模式(在系统发生崩溃或者shell出现异常的时候使用)4.本地硬盘启动5.内存检察(看看内存够不够) 在这里我们选择第一个,进行centos6.10的安装 第二步 这里出现的意思是询问安装者,是否需要光盘检查,这里

centos6.7安装Redis

1.创建安装目录 mkdir /usr/local/redis cd /usr/local/src 2.获取安装包:wget http://download.redis.io/releases/redis-2.8.12.tar.gz 3.解压 tar xzf redis-2.8.12.tar.gz 4.安装gcc yum –y install gcc    yum –y install jemalloc 5.安装redis yum –y install redis 6.启动 service re

转:Centos6.5_x86安装Redis。

Redis是一个高性能的,开源key-value型数据库.是构建高性能,可扩展的Web应用的完美解决方案,可以内存存储亦可持久化存储.因为要使用跨进程,跨服务级别的数据缓存,在对比多个方案后,决定使用Redis.顺便整理下Redis的安装过程,以便查阅. 下载Redis 解压Redis 编译安装Redis 配置Redis 启动Redis 添加开机启动项 Redis配置参数 1. 下载Redis 目前,最新的Redist版本为3.0,使用wget下载,命令如下: # wget http://dow

CentOS6.5安装redis(3.0.3)

如果没有安装gcc需要安装gcc 才能编译成功 yum install gcc 离线安装gcc的方法 # rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm # rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm # rpm -ivh cpp-4.4.7-4.el6.x86_64.rpm # rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm # rpm -ivh gcc-4.4.7-4.el6.x86_64.r

CentOS6.4 安装Redis

按照下面步骤依次执行1.检查依赖,安装依赖 [[email protected] ~]# whereis gcc gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz [[email protected] ~]# whereis tc tc: /sbin/tc /usr/lib64/tc /usr/share/tc /usr/share/man/man8/tc.8.gz [[email prote

CentOS6.10安装redis5.0

1.以安装redis5.0.0为例 下载安装包:http://redis.io 安装非常简单! [[email protected] ~]#yum install gcc #需要先安装GCC,如果已安装请忽略 [root@centos6 ~]tar zxvf redis-5.0.0.tar.gz -C /usr/local #解压 [[email protected] ~]cd /usr/local/redis-5.0.0 #进入解压后的文件夹 [[email protected] redis5

CentOS6.10 安装教程

1.创建新的虚拟机 2.选择“CentOS-6.10-x86_64-bin-DVD1.iso”安装包 3.选择安装的操作系统类型 4.设置虚拟机名称和存放宿主机位置 5.选择磁盘大小,建议将虚拟磁盘存储为单个文件 6.配置自定义硬件 内存至少给足1G(默认即可),打印机.声音不用的话可以移除,在新CD/DVD(IDE)里面设置ISO镜像文件 7.启动新建的虚拟机 8.安装第一个选项 9.选择“Skip” 10.按照图示下一步 11.设置主机名 12.选择时区“shanghai” 13.设置roo

Centos6.6 安装Redis

一.介绍 redis在做数据库缓存,session存储,消息队列上用的比较多 二.安装 $ yum install -y wget gcc make tcl $ wget http://download.redis.io/releases/redis-3.0.2.tar.gz $ tar zxvf redis-3.0.2.tar.gz $ cd redis-3.0.2 $ make $ make test $ make install 三.配置 $ cp redis.conf /etc/ $ t

『原创』CentOS6.5安装Redis数据库

1.以安装redis2.8.19为例 下载安装包:http://redis.io tar zxvf redis-2.8.19.tar.gz #解压 cd redis-2.8.19 #进入解压后的文件夹 yum install gcc #可能需要先安装GCC make #编译 如果编译出错:error: jemalloc/jemalloc.h: No such file or directory 解决方案: make MALLOC=libc #编译 cd src && make instal