在Linux中安装Redis并且远程访问
Step1:进入到 需要安装的路径下
执行wget 命令: wget http://download.redis.io/releases/redis-5.0.5.tar.gz

Step2: cd 到下载后的路径进行解压,解压后 cd redis-5.0.5/ 中

Step3:需要编译c语言,安装gcc ,执行命令 yum install gcc-c++
Step4: 执行make命令 进行编译,编译成功后 执行 src/redis-server

Step5: 将 redis 在后台运行,并在远程访问:
(1)注释掉redis.conf中的"bind 127.0.0.1"
(2) redis.conf中的"protected-mode yes" 改为"protected-mode no", 去掉保护模式
(3)redis.conf中的"daemonize no"改为"daemonize yes",是否以后台程序去运行
(4) redis.conf中的"requirepass your password" 一行可以注释掉,,变成免登录
(5)src/redis-server redis.conf , 启动程序
(6)执行 ps -ef | grep redis , 确认redis 后台程序已经启动
(7) 用 Redis Desktop Manager 远程连接 Redis (关闭防火墙 service iptables stop)
本文详细介绍了在Linux环境中安装Redis的过程,并提供了配置Redis以允许远程访问的步骤,包括修改配置文件、编译安装、后台运行及防火墙设置。
970

被折叠的 条评论
为什么被折叠?



