centos安装redis4.0.2

本文介绍如何使用tar包或yum方式安装Redis,并提供了启动服务及配置密码等操作步骤。

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

tar包安装

下载,解压,编译:


    
1
2
3
4

    
# wget http://download.redis.io/releases/redis-4.0.2.tar.gz
# tar xzf redis-4.0.2.tar.gz
# cd redis-4.0.2
# make

二进制文件是编译完成后在src目录下,通过下面的命令启动Redis服务:


    
1

    
# src/redis-server

你可以使用内置的客户端命令redis-cli进行使用:


    
1
2
3
4
5

    
# src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"

yum 安装


    
1
2
3
4
5

    
# yum install epel-release
# yum install redis
# systemctl start redis.service
# redis-server /etc/redis.conf
# systemctl enable redis

常用配置


    
1
2
3
4
5

    
vi /usr/local/redis-4.0.2/redis.conf
requirepass paasword #配置密码
#bind 127.0.0.1 #允许远程访问
daemonize yes #后台启动

启动命令


    
1
2

    
# src/redis-server ../redis.conf
src/redis-cli -a paasword

客户端工具 RedisDesktopManager

- [下载](http://docs.redisdesktop.com/en/latest/install/) 
- [github](https://github.com/uglide/RedisDesktopManager)

windows版本 https://github.com/MicrosoftArchive/redis/releases

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值