Redis4.0安装和集群配置-从入门到精通!

本文详细介绍如何在Linux环境下安装Redis 4.0.9,并配置集群。包括编译安装、服务脚本创建、集群规划与配置、节点管理等关键步骤。

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

redis4.0.9 安装和集群配置

1、wget http://download.redis.io/releases/redis-4.0.9.tar.gz

2、需要安装编译环境
#yum -y install gcc-c++
#yum -y install gcc-c++
#yum -y install tcl

Downloading packages:
tcl-8.5.13-8.el7.x86_64.rpm | 1.9 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:tcl-8.5.13-8.el7.x86_64 1/1
Verifying : 1:tcl-8.5.13-8.el7.x86_64 1/1

Installed:
tcl.x86_64 1:8.5.13-8.el7
Complete!

3、安装redis

#tar zxvf redis-4.0.9.tar.gz 
#cd redis-4.0.9
#make MALLOC=libc   
cd src && make all
make[1]: Entering directory `/home/yunwei/redis/redis-4.0.9/src'

Hint: It's a good idea to run 'make test' ;)

make[1]: Leaving directory `/home/yunwei/redis/redis-4.0.9/src'
[root@localhost redis-4.0.9]# make install PREFIX=/usr/local/redis
cd src && make install
make[1]: Entering directory `/home/yunwei/redis/redis-4.0.9/src'

Hint: It's a good idea to run 'make test' ;)

    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
make[1]: Leaving directory `/home/yunwei/redis/redis-4.0.9/src'

运行make test, 有如下信息则说明安装成功

\o/ All tests passed without errors!
Cleanup: may take some time… OK

验证
[root@localhost src]# cd /home/yunwei/redis/redis-4.0.9/src
[root@localhost src]# ./redis-server 运行redis服务

46690:C 06 Jun 08:36:54.372 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
46690:C 06 Jun 08:36:54.373 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=46690, just started
46690:C 06 Jun 08:36:54.373 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
46690:M 06 Jun 08:36:54.373 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 46690
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

进入redis客户端
[root@localhost src]# ./redis-cli

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值