1、安装的工具包依赖的环境
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison sqlite-devel iconv-devel
2.安装rvm(ruby管理工具)
curl -L get.rvm.io | bash -s stable
如果遇到以下错误:
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.26.11.tgz' - 'https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc'!
try downloading the signatures:
gpg2 --keyserver hkp://keys.gnupg.net --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
那么复制
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
在控制台运行一次,然后再次运行
curl -L get.rvm.io | bash -s stable
安装成功后 会提示
# Administrator,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
3.运行以下命令
echo "source /etc/profile.d/rvm.sh" >> ~/.bashrc && source /etc/profile.d/rvm.sh
那么接下来可以使用rvm来安装ruby了
4.1、使用
rvm list known
列出rvm知道的ruby版本,那么在这里就可以看到有什么版本可以安装了。原则自己需要的版本2.3.4
rvm install ruby-2.3.4
rvm可以帮助我们将ruby所依赖的包也一起安装进来。
使用以下命令安装ruby的redis的接口
gem install redis
redis和ruby环境配置完成,可以执行redis配置集群命令
redis-trib.rb create --replicas 1 ip:端口 ip:端口 ip:端口--------
(多个实例以空格隔开)
redis-trib.rb check 10.26.167.153:7000 查看主从