普通用户启动redis
Posted Fatt
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了普通用户启动redis相关的知识,希望对你有一定的参考价值。
重庆231 Redis 服务器 redis用户启动
复制 /etc/init.d/redis 启动脚本到 /redisdata/redis3.2下面,修改内容
[[email protected] ~]# less /redisdata/redis3.2/redis6380
#!/bin/sh
#
# redis init file for starting up the redis daemon
#
# chkconfig: - 20 80
# description: Starts and stops the redis daemon.
# Source function library.
. /etc/rc.d/init.d/functions
name="redis-server"
exec="/usr/bin/$name"
pidfile="/var/run/redis6380.pid"
# REDIS_CONFIG="/etc/redis.conf"
REDIS_CONFIG="/redisdata/redis3.2/6380/redis6380.conf"
[ -e /etc/sysconfig/redis ] && . /etc/sysconfig/redis
lockfile=/var/lock/subsys/redis
start() {
[ -f $REDIS_CONFIG ] || exit 6
[ -x $exec ] || exit 5
echo -n $"Starting $name: "
daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG"
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
修改/redisdata 目录归属 chowd -R redis:redis /redisdata
/redisdata/redis3.2/redis6380 start 启动 redis
[[email protected] ~]# ps -ef |grep redis
redis 5301 1 0 Feb16 ? 04:09:19 /usr/bin/redis-server 0.0.0.0:6379
redis 17079 1 0 15:20 ? 00:00:00 /usr/bin/redis-server 127.0.0.1:6380
附注:
pidfile /var/run/redis6380.pid
logfile /redisdata/redis3.2/6380/stdout
logfile /redisdata/redis3.2/6380/log/redis6380.log
dir /redisdata/redis3.2/6380/data
/usr/bin/redis-server /redisdata/redis3.2/6380/redis6380.conf
/redisdata/redis3.2/redis6380 启动脚本
以上是关于普通用户启动redis的主要内容,如果未能解决你的问题,请参考以下文章