CentOS7离线Redis集群搭建

本文详细介绍了在离线的CentOS7系统中如何搭建Redis集群,包括环境准备、环境安装和集群搭建等步骤。从下载安装包到配置环境变量,再到启动Redis节点和创建集群,每个步骤都有清晰的说明。

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

一、环境准备

  1. Centos7(离线环境下)
  2. redis安装包redis-5.0.4.tar.gz      下载地址:https://redis.io/download
  3. ruby安装包ruby-2.5.5.tar.gz      下载地址:http://www.ruby-lang.org/en/downloads/
  4. zlib安装包zlib-1.2.11.tar.gz      下载地址:http://www.zlib.net
  5. rubygems安装包rubygems-3.0.3.tgz      下载地址: https://rubygems.org/pages/download
  6. oppenssl安装包openssl-1.0.2n.tar.gz      下载地址:https://oomake.com/download/openssl
  7. redis依赖库redis-4.1.0.gem      下载地址:https://rubygems.org/gems/redis/

将以上安装包都放到CentOS7系统中(基于xshell  xftp上传),可以自定义路径和文件夹,此处我将安装包都放在/root/public下面

二、环境安装

1、redis安装需要依托gcc环境,先检查gcc是否安装,通过版本号查看,如果已经安装gcc会出现如下提示。

[root@localhost ~]# gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) 

2、安装ruby。进入public文件夹,解压ruby安装文件。

[root@localhost public]# tar -zxvf ruby-2.5.5.tar.gz 

3、进入解压后的ruby文件夹,将ruby安装到指定目录/usr/local/ruby,编译安装

[root@localhost ruby-2.5.5]# ./configure --prefix=/usr/local/ruby  ##是将ruby安装到指定目录,也可以自定义
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值