标签:redis 安装
官方网站:http://redis.io/
中文网站:http://www.redis.cn/
下载地址:http://download.redis.io/releases/redis-3.0.5.tar.gz
wget http://download.redis.io/releases/redis-3.0.5.tar.gz
yum install gcc zmalloc jemalloc*
数据目录:mkdir -p /opt/redis/data 日志目录:mkdir -p /opt/redis/log
tar -zxvf redis-3.0.5.tar.gz cd redis-3.0.5 make PREFIX=/opt/redis MALLOC=libc install cp ./src/redis-trib.rb /opt/redis/bin/ ln -s /opt/redis/bin/redis-trib.rb /bin/redis-trib.rb ln -s /opt/redis/bin/* /bin/
[root@redis01 ~]# cat /etc/redis/redis.conf |grep -v "^#"|grep -v "^$" daemonize yes pidfile /opt/redis/redis.pid port 6379 bind 0.0.0.0 timeout 300 loglevel notice logfile /opt/redis/log/redis_01.log databases 16 save 900 1 save 300 10 save 60 10000 rdbcompression yes dbfilename dump_01.rdb dir /opt/redis/data maxclients 1280
cp ./utils/redis_init_script /etc/init.d/redis
vi /etc/init.d/redis
#!/bin/sh
#添加以下这一行
#chkconfig: 2345 80 90
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.
REDISPORT=6379
#修改以下几行
EXEC=/opt/redis/bin/redis-server
CLIEXEC=/opt/redis/bin/redis-cli
PIDFILE=/opt/redis/redis_${REDISPORT}.pid
CONF="/etc/redis/redis.conf"
chkconfig --add redis chkconfig --list redis
service redis start
配置关闭 vi /etc/selinux/config . SELINUX=disabled 马上关闭 setenforce 0
添加一条策略 cat /etc/sysconfig/iptables|grep 6379 -A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT 重启防火墙 service iptables restart
本文出自 “枯叶” 博客,请务必保留此出处http://mydbs.blog.51cto.com/513727/1745300
标签:redis 安装
原文地址:http://mydbs.blog.51cto.com/513727/1745300