centos安装redis4.0.2

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

你可能感兴趣的:(centos安装redis4.0.2)