Centos6.9安装redis-dump

该博客详细介绍了如何在Linux系统中编译安装Ruby 2.6.5,包括安装依赖、配置环境变量、使用RVM以及安装Redis-Dump的过程。此外,还提供了备份和还原Redis数据的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

源码编译ruby2.6.5

https://ruby-china.org/wiki/ruby-mirror

安装编译依赖工具,gcc、gcc-c++、gdbm-devel、readline-devel和openssl-devel:

yum install gcc gcc-c++ gdbm-devel readline-devel openssl-devel -y

编译安装ruby

cd /usr/local/ruby-2.6.5

./configure --prefix=/usr/local/ruby --enable-shared

make && make install

添加ruby环境变量

vi /etc/profile

export RUBY_HOME=/usr/local/ruby/

export PATH=$RUBY_HOME/bin:$RUBY_HOME/lib:$PATH

source /etc/profile

检查ruby环境配置是否正确

# ruby -v

ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]

#redis-dump安装

#vim ~/.gemrc

---

:sources:

- https://gems.ruby-china.com

:ssl_verify_mode: 0

#yum install ruby rubygems ruby-devel -y

#gem sources --add https://gems.ruby-china.com/  --remove https://rubygems.org/

# gem sources -l

*** CURRENT SOURCES ***

http://gems.ruby-china.com/   #确定只剩这一个

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

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

                                 Dload  Upload   Total   Spent    Left  Speed

100 24535  100 24535    0     0    959      0  0:00:25  0:00:25 --:--:--   644

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

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

gpg: Signature made Sat 16 Jan 2021 02:46:22 AM CST using RSA key ID 39499BDB

gpg: Good signature from "Piotr Kuczynski <piotr.kuczynski@gmail.com>"

gpg: WARNING: This key is not certified with a trusted signature!

gpg:          There is no indication that the signature belongs to the owner.

Primary key fingerprint: 7D2B AF1C F37B 13E2 069D  6956 105B D0E7 3949 9BDB

GPG verified '/usr/local/rvm/archives/rvm-1.29.12.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!

Thanks for installing RVM [0m

Please consider donating to our open collective to help us maintain RVM.

  Donate: https://opencollective.com/rvm/donate

查找配置文件

# find / -name rvm.sh

/etc/profile.d/rvm.sh

使配置文件生效

# source /etc/profile.d/rvm.sh

# rvm -v

rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

#source /usr/local/rvm/scripts/rvm

#gem install redis-dump -V

# redis-dump -v

redis-dump v0.4.0

# redis-load -v

redis-dump v0.4.0

导出数据

#redis-dump --uri=redis://ip1:port --password='xxxxxx'>/tmp/redis.json

备份

关闭目标redis

清空目标redis

# rm appendonly.aof

# rm dump.rdb

开启目标redis

还原数据

cat /tmp/redis.json | redis-load -n --uri=redis://ip2:port --password='xxxxxxxxx'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

向良玉

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值