详细的redis安装步骤可参考我的另一篇文章:http://meiling.blog.51cto.com/6220221/1979156
1、普通用户安装redis
[centos6@localhost ~]$ tar -xfredis-4.0.2.tar.gz [centos6@localhost ~]$ cd redis-4.0.2 [centos6@localhost redis-4.0.2]$ make [centos6@localhost redis-4.0.2]$ sudo make install
2、普通用户下用sudo命令以root启动
2.1. 以root身份启动redis服务
$ sudo /usr/local/bin/redis-server/home/centos6/redisconf/redis.conf [centos6@localhost ~]$ ps -ef |grep redis root 33547 1 0 09:52 ? 00:00:00 /usr/local/bin/redis-server127.0.0.1:7200 centos6 33552 33452 0 09:52 pts/1 00:00:00 grep redis
2.2. 停止redis服务也要用sudo来执行root权限:
$ sudo /usr/local/bin/redis-cli -p 7200 shutdown
3、以普通用户来启动redis:
3.1. 修改pid生成路径为普通用户下,自己定义
$ vi /home/centos6/redisconf/redis.conf $ pidfile/home/centos6/redisconf/run/redis_7200.pid
启动redis服务:
$ /usr/local/bin/redis-server/home/centos6/redisconf/redis.conf
以普通用户停止redis:
/usr/local/bin/redis-cli -p 7200 shutdown
本文出自 “运维笔录 美玲” 博客,请务必保留此出处http://meiling.blog.51cto.com/6220221/1979159
原文地址:http://meiling.blog.51cto.com/6220221/1979159