CentOS 7使用Redis Cluster
2021/11/3 19:13:46
本文主要是介绍CentOS 7使用Redis Cluster,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
本文更新于2021-11-03,使用Redis 4.0.8,操作系统为CentOS 7.5。
-
CentOS 7下直接运行
redis-trib.rb
可能出现如下提示,原因是没有安装Ruby:/usr/bin/env: ruby: No such file or directory
-
安装Ruby。
yum install ruby
-
安装Ruby包管理器。
yum install rubygems
-
通过Ruby包管理器安装Redis模块。
gem install redis
可能出现如下提示,原因是Ruby版本过低:
ERROR: Error installing redis:
redis requires Ruby version >= 2.4.0. -
使用RMV(Ruby版本管理器)安装高版本Ruby。
-
安装RVM,官方文档见:https://rvm.io/。
\curl -sSL https://get.rvm.io | bash -s stable
可能出现如下提示,原因是未安装公钥:
Warning, RVM 1.29.12 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 '/home/tigergm/.rvm/archives/rvm-1.29.7.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.7/1.29.7.tar.gz.asc'! Try to install GPG v2 and then fetch the public key:
gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
or if it fails:
command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
In case of further problems with validation please refer to https://rvm.io/rvm/security根据提示,先运行:
gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
如失败改为运行:
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
然后再次运行:
\curl -sSL https://get.rvm.io | bash -s stable
-
使RVM立即生效。
source /usr/local/rvm/scripts/rvm
-
查看RVM库中的Ruby版本。
rvm list known
-
安装指定版本的Ruby(此处安装2.4.1,可根据需要选择)。
rvm install 2.4.1
-
切换Ruby默认版本。
rvm use 2.4.1 --default
-
查看Ruby版本。
ruby --version
-
-
重新通过Ruby包管理器安装Redis模块。
gem install redis
-
重新运行
redis-trib.rb
。
这篇关于CentOS 7使用Redis Cluster的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-31Tiny RDM:你的下一代Redis桌面GUI神器-icode9专业技术文章分享
- 2024-03-21redisinsight-v2
- 2024-02-26Typed property App\Api\Mapper\GamePropsConfigMapper::$apiRedis must not be accessed before initia-icode9专业技术文章分享
- 2024-02-21redisson getlock
- 2024-02-20redis config
- 2024-02-20redis leaderboard
- 2024-01-23缓存选型:Redis or MemCache
- 2024-01-22面试官:Redis持久化能关吗?怎么关?
- 2024-01-21Redis压测工具redis-benchmark-icode9专业技术文章分享
- 2024-01-19这才是你应该了解的Redis数据结构!