Linux安装Redis6
1、官网下载redis6.xxx版本 点击下载
2、解压:tar -zxvf 【redis的压缩包】
3、安装gcc环境:yum install gcc
4、查看gcc是否安装成功? gcc --version
5、进入解压好的redis中
6、将redis进行编译:make
7、安装redis:make install (默认安装在usr/local/bin下)
8、复制一份redis-config放在自定义的文件下(方便启动)
9、修改备份文件内容:
1、daemonize no —> daemonize yes // 表明需要在后台运行
2、注释掉 bind 127.0.0.1 // 这里限制了哪个网段才可以访问,所以把它注释掉
3、protected-mode yes —> protected-mode no // yes代表防止远程访问
4、添加 requirepass 123456 // 设置密码
10、启动:redis-server /自定义目录 【例如我的 redis-server /serverconfig/redis.conf】
11、验证是否启动成功:ps -ef | grep redis
12、关闭redis服务:使用kill -9