一、下载安装redis
新建目录:mkdir /usr/local/redis
cd /usr/local/redis
官网下下载:redis-4.0.14.tar.gz
解压:tar -zxvf redis-4.0.14.tar.gz
cd redis-4.0.14
make
make test
这里可能会出错:需要安装tcl包,下载很慢
wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
tar -zxvf tcl8.6.1-src.tar.gz
cd tcl8.6.1/unix/
./configure
make
make install
回到redis安装
cd /usr/local/redis/redis-4.0.14
make
make test
make prefix=/usr/local/redis install
安装结束后看redis-server 在哪里:1. cd / 2. find / -name redis-server
二、修改redis配置,设置开机自启
mkdir /usr/local/redis/etc
cp /usr/local/redis/redis-4.0.14/redis.conf /usr/local/redis/etc/
vim /usr/local/redis/etc/redis.conf
daemonize no 改为 yes
protected-mode yes 改为 no
bind 127.0.0.1 改为 #bind 127.0.0.1
启动redis:/usr/local/bin/redis-server /usr/local/redis/etc/redis.conf
vim /etc/rc.local
在最后加上: /usr/local/bin/redis-server /usr/local/redis/etc/redis.conf
授权:chmod +x /etc/rc.local
systemctl daemon-reexec
重启centos7:init 6
再查看监听的端口: ss -lnpt
window10查看是否成功: cmd,bois下 :telnet 192.x.x.x 6379
Redis 可视客户端:windows版 :https://pan.baidu.com/s/1Vlkwq1y03HH0YFoWYxmQtw --------------- String pwd = "e4"+"d8";