redis单机版安装
没有c++环境先安装c++
yum install -y gcc-c++
减压
tar -zvxf redis-5.0.4.tar.gz
进到redis减压包目录
cd redis-5.0.4
编译
make
安装
make install PREFIX=/root/software/redis
前台启动
cd /root/software/redis/bin
./redis-server
后台启动
cp /root/redis-5.0.4/redis.conf /root/software/redis/bin/
修改redis.conf文件
vim /root/software/redis/bin/redis.conf
修改为daemonize yes (后台启动设置)
daemonize yes
远程连接 将 bind注释掉
#bind 127.0.0.1
启动redis
./redis-server redis.conf
关闭后台启动
./redis-cli shutdown
连接redis
./redis-cli -h 192.168.179.142 -p 6379
默认连接 默认ip 127.0.0.1 默认端口 6379
./redis-cli