redis入门,linux安装
1.下载 https://redis.io/download
2.上传到linux服务器tools文件夹下
3.解压到安装目录 tar -zxf /app/redis/redis-5.0.4.tar.gz
4.进入解压文件目录使用make对解压的Redis文件进行编译
cd /app/redis/redis-5
make
5.编译完成后进入src 用make install 进行安装
部署
1.为了方便管理,将Redis文件中的conf配置文件和常用命令移动到统一文件中
mv redis.conf /app/redis/etc/
进入src目录,移动mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server到/app/redis/bin/
执行命令 :mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-server /app/redis/bin/
执行./redis-server 启动redis
6.设置后台启动redis
1)、首先编辑conf文件,将daemonize属性改为yes(表明需要在后台运行)
cd etc/
vim redis.conf
将no修改为yes
2)、再次启动redis服务,并指定启动服务配置文件
./redis-server /app/redis/etc/redis.conf
7.设置linux 通行端口redis(6379)并重启防火墙 service iptables resestart
8.查看进程netstat -tunpl|grep 6379
Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out
出现以上问题 redis.conf 中bind 127.0.0.1 未用#注释掉
1)机器之间网络无法联通
2)ip和端口号不正确
3)虚拟机中防火墙的原因(可能性较大)
4)redis.conf 中bind 127.0.0.1 未用#注释掉
Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
出现以上问题解决方案
1)[root@localhost bin]# cd /app/redis/redis-5.0.4/src/ 进入该目录
2)[root@localhost src]# ./redis-cli 执行该命令
127.0.0.1:6379> config set protected-mode "no" 将受保护模式改为no
原文地址:https://www.cnblogs.com/hikoukay/p/11373952.html
- JavaScript 常用算法
- SVG 使用
- 小程能走网店模式?如何做分销模式的小程序?
- IIS 6 下配置以 FastCGI 跑 PHP
- IIS 7.x Application Request Routing(ARR) 502错误的解决方法
- 移动前端头部标签(HTML5 meta)
- 这个行业在汽车圈最落后,正在被物联网和AI改变
- WordPress 网站基于REST API 开发“微信小程序”实战
- 摩拜共享汽车亮相 首批新能源电动汽车试运行
- 基于SQL Server 2008 Service Broker构建企业级消息系统
- Windows主机管理系统Websitepanel
- 自定义Appfabric Cache 配置提供程序
- 2017年发生在上海的科技大新闻
- REST当中为什么要使用HTTP PUT
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法