一、FAQ

1、如果用连接器连接redis不成功,报如下错误:

crash-report-server replied:Request Entity Too Large

则可以先通过cmd命令查看端口连接:

使用telnet ip 端口号查看,若出现:

则可以按照上面说明进行修改:

再次连接:

成功后会出现提示信息:

2、外网无法连接,只能本机访问:

---------------------------------------以下部分为转载-------------------------------------------

在配置文件redis.conf中,默认的bind 接口是127.0.0.1,也就是本地回环地址。这样的话,访问redis服务只能通过本机的客户端连接,而无法通过远程连接,

这样可以避免将redis服务暴露于危险的网络环境中,防止一些不安全的人随随便便通过远程
连接到redis服务。
  如果bind选项为空的话,那会接受所有来自于可用网络接口的连接。

在使用redis的时候出现连接不成功;

在项目中导入jar包jedis-2.7.2.jar,编写测试类

	@Test
public void testJedisSingle() throws Exception {
//创建一个jedis对象
Jedis jedis = new Jedis("192.168.64.129",6379);
jedis.set("test", "hello jedis");
String string = jedis.get("test");
System.out.println(string);
jedis.close();
}

根据redis.conf配置文件中bind的值的不同,出现不同的提示信息;但是不影响Linux系统中redis的正常使用;

当不存在bind时

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.

当bind 本机ip地址时

代码可以测试通过,但是Linux系统中出现问题

[root@root redis]# ./bin/redis-cli -c
  Could not connect to Redis at 127.0.0.1:6379: Connection refused
  Could not connect to Redis at 127.0.0.1:6379: Connection refused

当bind 为默认的127.0.0.1时

代码测试不通过

redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect

Linux中操作正常

目前采用的方式,代码和Linux中的redis客户端都可以使用

1.在bind中配置多个IP地址,bind 192.168.64.129 127.0.0.1

2.将bind的值配置为bind 0.0.0.0

-------------------------转自https://www.cnblogs.com/lonelyxmas/p/8084808.html--------------------------------

3、redis.conf不生效

--------------------以下部分为转载------------------------

修改redis.conf后,重启redis,发现修改的配置未生效,原来是需要在启动redis的时候在命令中加上配置文件,命令如下:

./redis-server /usr/local/redis-3.2./redis.conf &

仔细阅读配置文件可以开头看到有这样的描述:

# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf

-----------------------转自https://blog.csdn.net/shiyong1949/article/details/78197267-----------------------

no-sql数据库之redis的更多相关文章

  1. 使用关系型数据库作为Redis落地的思路

    Redis的持久化方式主要有2种:RDB和AOF,但各有不足,同时Redis没有SQL支持,Redis本身提供的命令不足以实现大多数SQL查询需求,对后期运营的分析需求支撑不足.此外,对于游戏来说,活 ...

  2. Linux实战教学笔记45:NoSQL数据库之redis持久化存储(一)

    第1章 redis存储系统 1.1 redis概述 REmote DIctionary Server(Redis)是一个基于key-value键值对的持久化数据库存储系统.redis和大名鼎鼎的Mem ...

  3. Python操作nosql数据库之redis

    一.NoSQL的操作 NoSQL,泛指非关系型的数据库.随着互联网web2.0网站的兴起,传统的关系数据库在应付web2.0网站,特别是超大规模和高并发的SNS类型的web2.0纯动态网站已经显得力不 ...

  4. 非关系型数据库(NOSQL)-Redis

    整理一波Redis 简介,与memcached比较 官网:http://redis.io Redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括 ...

  5. 告诉你 SQL 数据库与 NoSQL 数据库的区别

    简单来说 SQL 数据库和 NoSQL 数据库有着共同的目标:存储数据,但存储的方式不同 一. 表 SQL中的表结构具有严格的数据模式约束: 存储数据很难出错. NoSQL存储数据更加灵活自由:可能导 ...

  6. NOSQL数据库之 REDIS

    NOSQL数据库之 REDIS 一.NOSQL 1.简介 NoSQL ,(Not Only SQL),泛指非关系型数据库. 特点: NoSQL 通常是以key-value形式存储, 不支持SQL语句, ...

  7. OAuth + Security - 5 - Token存储升级(数据库、Redis)

    PS:此文章为系列文章,建议从第一篇开始阅读. 在我们之前的文章中,我们当时获取到Token令牌时,此时的令牌时存储在内存中的,这样显然不利于我们程序的扩展,所以为了解决这个问题,官方给我们还提供了其 ...

  8. Redis 01: 非关系型数据库 + 配置Redis

    数据库应用的发展历程 单机数据库时代:一个应用,一个数据库实例 缓存时代:对某些表中的数据访问频繁,则对这些数据设置缓存(此时数据库中总的数据量不是很大) 水平切分时代:将数据库中的表存放到不同数据库 ...

  9. KTV项目 SQL数据库的应用 结合C#应用窗体

    五道口北大青鸟校区 KTV项目 指导老师:袁玉明 歌曲播放原理 SQL数据库关系图 C#解决方案类图 第一步:创建数据库连接方法和打开方法和关闭方法! public class DBHelper { ...

  10. jquery autocomplete实现读取sql数据库自动补全TextBox

    转自我本良人 原文 jquery autocomplete实现读取sql数据库自动补全TextBox 项目需要这样子一个功能,其他部门提的意见,只好去实现了哦,搞了好久才弄出来,分享一下. 1.前台页 ...

随机推荐

  1. shell linux 环境下循环遍历文件夹下所有文件

    demofun(){ ` do if test -f $file then echo "file: $file" elif test -d $file then echo &quo ...

  2. python 线程队列、线程池、全局解释器锁GIL

    一.线程队列 队列特性:取一个值少一个,只能取一次,没有值的时候会阻塞,队列满了,也会阻塞 queue队列 :使用import queue,用法与进程Queue一样 queue is especial ...

  3. python 守护进程、同步锁、信号量、事件、进程通信Queue

    一.守护进程 1.主进程创建守护进程 其一:守护进程会在主进程代码执行结束后就终止 其二:守护进程内无法再开启子进程,否则抛出异常:AssertionError: daemonic processes ...

  4. 在Eclipse中创建maven项目出现的环境警告 j2se-1.5

    Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace th ...

  5. Eclipse debug 断点不能调试 ,Eclipse Unable to install breakpoint in 解决办法

    解决:[1]项目工程名 ,右键 --> properties --> java compiler -->class file Generation 位置  Add line numb ...

  6. (转)Spring Boot (十):邮件服务

    http://www.ityouknow.com/springboot/2017/05/06/spring-boot-mail.html Spring Boot 仍然在狂速发展,才几个多月没有关注,现 ...

  7. Leetcode:0002(两数之和)

    LeetCode:0002(两数之和) 题目描述:给定两个非空链表来表示两个非负整数.位数按照逆序方式存储,它们的每个节点只存储单个数字.将两数相加返回一个新的链表.你可以假设除了数字 0 之外,这两 ...

  8. 【转】wamp 3.0.6(apache 2.4.23) 403 forbidden 解决办法

    最近为了使用laraval框架,将wamp 升级到了比较高的版本,相应的apache也升级到了 2.4.23. larval是使用的挺好的,原来的apache倒是出现了问题:同一个局域网内,别人机器不 ...

  9. BuildTools Overview

    SCons Pros: Based on a full-fledged programming language, Python. This means you can make the build ...

  10. c# 利用百度图像处理【人像分割】一键抠图

    百度AI开放平台-人像分割: http://ai.baidu.com/tech/body/seg 注意本文后面的话,百度这个技术效果太差劲了,国外这 https://www.remove.bg/ 个比 ...