Centos6.8安装redis(一)
最近有在学习会话共享的配置,其中一种呢是 nginx+redis+tomcat 的会话共享配置,在记录此会话共享配置之前呢先记录下redis等的安装。这篇先简单记录下redis的安装,是其中一种方式,其他的后续会进行补充或单独记录。
准备:
redis-3.2.8.tar.gz; tcl8.5.9-src.tar.gz;
解压tcl.tar.gz,并编译安装:
tar xvf tcl8.5.9-src.tar.gz [enter] ./tcl8..5.9/unix/configure [enter] make [enter] make install [enter]
解压redis.tar.zp,并编译安装:
tar xvf redis-3.2.8.tar.gz [enter] cd ./redis-3.2.8 [enter] make [enter] make test [enter]
修改配置文件,将 daemonize=no 改为 daemonize=yes:
vi ./redis-3.2.8/redis.conf [enter]
建立redis目录,将编译好的程序转移:
mkdir /usr/local/redis/bin /usr/local/redis/etc [enter] cp -r redis-3.2.8/src/redis-benchmark /usr/local/redis/bin/ [enter] cp -r redis-3.2.8/src/redis-check-aof /usr/local/redis/bin/ [enter] cp -r redis-3.2.8/src/redis-server /usr/local/redis/bin/ [enter] cp -r redis-3.2.8/src/redis-cli /usr/local/redis/bin/ [enter] cp -r redis-3.2.8/redis.conf /usr/local/redis/etc/ [enter]
启动redis服务:
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf [enter]
查看是否启动:
netstat -antp|grep redis [enter]
测试:
/usr/local/redis/bin/redis-cli [enter]
开启redis端口,修改防火墙配置文件:
vi /etc/sysconfig/iptables [enter] 编辑新增: -A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT [ESC] :wq 保存退出
重新加载规则:
service iptables restart [enter]
记录完毕!
相关推荐
王道革 2020-11-25
wangdonghello 2020-11-03
Langeldep 2020-11-16
chenhualong0 2020-11-16
聚合室 2020-11-16
koushr 2020-11-12
MRFENGG 2020-11-11
guoyanga 2020-11-10
fackyou00 2020-11-10
Orangesss 2020-11-03
dongCSDN 2020-10-31
rainandtear 2020-10-30
Quietboy 2020-10-30
liuyulong 2020-10-29
fansili 2020-10-29
温攀峰 2020-10-23
jackbon 2020-10-19
kaixinfelix 2020-10-04