1、ruby 安装
[root@hadoop02 redis-client]# yum install ruby
已加载插件:fastestmirror
# 查看安装的ruby version
[root@hadoop02 redis-client]# ruby -v
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
[root@hadoop02 redis-client]#
# 安装redis-client 客户端,最新的redis-4.1.3.gem
# wget https://rubygems.org//downloads/redis-4.1.3.gem
# 安装redis-4.1.3.gem
[root@hadoop02 redis-client]# gem install -l redis-4.1.3.gem
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
# 缺少
[root@hadoop02 redis-client]# yum install zlib-devel
安装发现还是有一些问题?
暂时未能解决。
可能是由于没有生效吧类库,重启 reboot,再次执行发现
[root@hadoop02 redis-client]# ls
redis-4.1.3.gem
[root@hadoop02 redis-client]# gem install redis-4.1.3.gem
ERROR: Error installing redis-4.1.3.gem:
redis requires Ruby version >= 2.3.0.
现在是版本不同,所以要升级ruby的版本。这个就比较好办了,去官网下载最新的版本,并使用源码安装。
wget https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.gz
#解压后
[root@hadoop02 ruby-2.6.5]# ./configure --prefix=/usr/local/ruby
checking for ruby... /bin/ruby
tool/config.guess already exists
tool/config.sub already exists
[root@hadoop02 ruby-2.6.5]# make
BASERUBY = /bin/ruby --disable=gems
CC = gcc
LD = ld
LDSHARED = gcc -shared
待续。。。
-----
发现源码安装。。。,
[root@hadoop05 bin]# ruby -v
ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-linux]
只有这个版本安装成功了,都是泪。。。
---
[root@hadoop05 ruby]# gem install redis-4.1.3.gem
Successfully installed redis-4.1.3
Parsing documentation for redis-4.1.3
Installing ri documentation for redis-4.1.3
Done installing documentation for redis after 1 seconds
运行redis-trib.rb
发现 5.0 以上已经不用依赖redis-trib.rb 了。
[root@hadoop05 src]# ./redis-trib.rb
WARNING: redis-trib.rb is not longer available!
You should use redis-cli instead.
All commands and features belonging to redis-trib.rb have been moved
to redis-cli.
In order to use them you should call redis-cli with the --cluster
option followed by the subcommand name, arguments and options.
Use the following syntax:
redis-cli --cluster SUBCOMMAND [ARGUMENTS] [OPTIONS]
欲哭无泪。。。。
所有的功能在这里;;
[root@hadoop05 src]# ./redis-cli --cluster help
Cluster Manager Commands:
create host1:port1 ... hostN:portN
--cluster-replicas <arg>
check host:port
--cluster-search-multiple-owners
info host:port
fix host:port
--cluster-search-multiple-owners
reshard host:port
--cluster-from <arg>
--cluster-to <arg>
--cluster-slots <arg>
--cluster-yes
--cluster-timeout <arg>
--cluster-pipeline <arg>
--cluster-replace
rebalance host:port
--cluster-weight <node1=w1...nodeN=wN>
--cluster-use-empty-masters
--cluster-timeout <arg>
--cluster-simulate
--cluster-pipeline <arg>
--cluster-threshold <arg>
--cluster-replace
add-node new_host:new_port existing_host:existing_port
--cluster-slave
--cluster-master-id <arg>
del-node host:port node_id
call host:port command arg arg .. arg
set-timeout host:port milliseconds
import host:port
--cluster-from <arg>
--cluster-copy
--cluster-replace
help
For check, fix, reshard, del-node, set-timeout you can specify the host and port of any working node in the cluster.