fedorea19安装redis

Redis 安装:

$ wget http://redis.googlecode.com/files/redis-2.4.5.tar.gz

$ tar xzf redis-2.4.5.tar.gz 

$ cd redis-2.4.5 

$ make & make install

测试:

$ src/redis-server

$ src/redis-cli

 

auth haojg //haojg是密码

 

redis> set foo bar

OK

redis> get foo

"bar"

将redis.conf中的daemonize no 变成daemonize yes

$ cd ../utils/

$./install_server     //安装启动服务

 

显示信息:

root@hman utils]# ./install_server.sh 

Welcome to the redis service installer

This script will help you easily set up a running redis server

 

 

Please select the redis port for this instance: [6379] 

Selecting default: 6379

Please select the redis config file name [/etc/redis/6379.conf] 

Selected default - /etc/redis/6379.conf

Please select the redis log file name [/var/log/redis_6379.log] 

Selected default - /var/log/redis_6379.log

Please select the data directory for this instance [/var/lib/redis/6379] 

Selected default - /var/lib/redis/6379

Please select the redis executable path [/usr/local/bin/redis-server] 

s#^port [0-9]{4}$#port 6379#;s#^logfile .+$#logfile /var/log/redis_6379.log#;s#^dir .+$#dir /var/lib/redis/6379#;s#^pidfile .+$#pidfile /var/run/redis_6379.pid#;s#^daemonize no$#daemonize yes#;

Copied /tmp/6379.conf => /etc/init.d/redis_6379

Installing service...

./install_server.sh: line 178: update-rc.d: command not found

 exists, process is already running or crashed

Installation successful!

 

默认就可以了,一路回车

执行完后,查看/etc/redis/6379.conf,这个文件默认不能用chkconfig来添加到启动项,会报错的,可以使用附件里的文件来替换或修改。

原文地址:https://www.cnblogs.com/zhaofeng555/p/3630535.html