redis-1

一、redis的介绍

二、redis的安装

1、下载安装包并解压

wget http://download.redis.io/releases/redis-4.0.1.tar.gz

 tar -zxvf redis-4.0.1.tar.gz

2、编译安装

make && make install 

查看安装路径

3、编辑配置文件

cp redis.conf /etc

vim /etc/redis.conf

修改:daemonize no  (前台启动) 为 daemonize yes(后台启动)

          logfile ""   为  logfile "/var/log/redis.log"

          dir ./ 为 dir /data/redis

          appendonly no 为 appendonly yes

mkdir /data/redis

4、启动redis

vim /etc/rc.local

sysctl vm.overcommit_memory=1
echo never > /sys/kernel/mm/transparent_hugepage/enabled

三、redis的持久化

1、

四、redis的数据类型 

1、

2、数据类型-string

list

set

  

有序集合

按分数顺序或倒序排列

hash

猜你喜欢

转载自www.cnblogs.com/wbjy123linux/p/9085071.html