生活有度,人生添寿。网站位置:博客文章

linux安装redis

发布时间:2018-10-16编辑:sujianbin阅读(305)

安装:

1.获取redis资源

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

2.解压

tar xzvf redis-4.0.8.tar.gz

3.安装

cd redis-4.0.8

make

cd src

make install PREFIX=/usr/local/redis

4.移动配置文件到安装目录下

cd ../

mkdir /usr/local/redis/etc

mv redis.conf /usr/local/redis/etc

5.配置redis为后台启动

vi /usr/local/redis/etc/redis.conf //将daemonize no 改成daemonize yes

6.将redis加入到开机启动

vi /etc/rc.local //在里面添加内容:/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

7.开启redis

/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

8.测试redis

cd /usr/local/redis/bin

./redis-cli

keys * (查看所有设置值)

set name hello word (设置key)

get name (获取key)

超赞的评论 登陆
0条评论