redis 安装

1. 下载  wget http://download.redis.io/releases/redis-3.2.8.tar.gz

2.解压 tar zxvf redis-3.2.8.tar.gz

3. cd redis-3.2.8   直接make

4.安装脚本库 yum install tcl

5.安装 redis     make PREFIX=/usr/local/redis install

6. cd /usr/local/redis/bin 

     redis-benchmark  性能测试工具   aof 检查aof日志工具  ,cli 客户端 ,server 服务端 ,dump 检查rbd日志的工具

7.复制配置文件

cp /home/tkzhao/src/redis-3.2.8/redis.conf ./

8.启动服务端

./bin/redis-server  ./redis.conf

关闭

./bin/redis-cli shutdown

9 启动客户端 

./bin/redis-cli    退出:exit

10 在客户端测试 

   set name tkzhao

   get name 

  tkzhao

11 让redis 以后台进程的方式运行 

   vi redis.conf  

  修改 daemnize=yes

12 ps aux|grep redis

13 查询redis路径 whereis redis 

 14 查看ip  ifconfig

15 连不上虚拟机 

a 检查端口  netstat -tunlp|grep 6379

redis.conf中的bind的配置,

将bind 127.0.0.1 改为 bind 0.0.0.0 即所有地址均可连接

systemctl stop firewalld.service 关闭防火墙

chkconfig iptables on 开启

chkconfig iptables off 关闭

 

 

原文地址:https://www.cnblogs.com/suixin84/p/6671029.html