首页 > 代码库 > Redis安装配置

Redis安装配置

下载好Redis....

make 

make install

mkdir /etc/redis/

cp redis.conf /etc/redis/redis_6379.conf

 

redis_6379.conf内容(update):

#注意创建的目录,还有权限

daemonize yes

logfile "/data/redis/logs/redis.log"

dir /data/redis

requirepass wojiushimima

 

自启动脚本(注意路径):

cp utils/redis_init_script /etc/init.d/redisd

 

修改内容(注意路径):

#!/bin/sh
# chkconfig: 2345 90 10
# description: Redis is a persistent key-value database

EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli

#密码是增加的行

REDIS_PASS="wojiushimima" 

 

echo "Stopping ..."
$CLIEXEC -p $REDISPORT -a $REDIS_PASS shutdown

 

chkconfig redisd on

service redisd start

service redisd stop

Redis安装配置