1、安装Redis
wget http://download.redis.io/releases/redis-2.8.19.tar.gz
yum install tcl -y
tar zxf redis-2.8.19.tar.gz
cd redis-2.8.19
make MALLOC=libc
make test //这一步时间会稍久点...
make install
cd 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]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
2、查看redis的监控端口
elk:~ # netstat -ntlp |grep redis
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 12420/redis-server
3、测试redis是否正常工作
# cd redis-2.8.19/src/
# ./redis-cli -h 192.168.1.104 -p 6379 //连接redis
192.168.1.104:6379> ping
PONG
192.168.1.104:6379> set name zhengyansheng
OK
192.168.1.104:6379> get name
"zhengyansheng"
192.168.1.104:6379> quit
4、redis的动态监控
# cd redis-2.8.19/src/
# ./redis-cli monitor //reids动态监控
Ok