添加redis配置文件, 启动后,调用报错  redis.clients.jedis.exceptions.JedisDataException: ERR invalid DB index

ERR invalid DB index直译过来就是错误的数据库索引,执行select命令时暴出此错误。项目中使用的redis客户端是Jedis,查看源码得知,在执行任何命令前,都会执行select,切换到相应数据库,然后再执行其它命令。配置的数据库索引是1(默认是0),也就是执行select 1,但是在本地是正常的。查询得知服务器使用的redis是腾讯云的,不是我们安装的,腾讯云对redis做了限制,一个redis实例只开放一个数据库。

一个redis实例默认有16个数据库,从0-15,超出这个范围就会爆ERR invalid DB index

参考:  https://blog.csdn.net/wangjun5159/article/details/55278622

redis.clients.jedis.exceptions.JedisDataException: ERR invalid DB index的更多相关文章

  1. 阿里云 Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR invalid password

    如果你是买的阿里云的redis服务的话,不要被这个ERR invalid password所迷惑了. 你应该去检查一下你买的服务有没有设置白名单. 像mysql和mongodb的服务如果连不上的话也可 ...

  2. redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set

    使用哨兵模式连接redis连接池时,遇到错误: Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sen ...

  3. 【问题集】redis.clients.jedis.exceptions.JedisDataException: ERR value is not an integer or out of range

    redis.clients.jedis.exceptions.JedisDataException: ERR value is not an integer or out of range incrm ...

  4. 【异常】redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'PSETEX'

    在spring中 针对 RedisTemplate类: private RedisTemplate<String, String> template; 当调用下面方法 template.o ...

  5. ERR Unsupported CONFIG parameter: notify-keyspace-events; nested exception is redis.clients.jedis.exceptions.JedisDataException

    异常信息 时间:2017-04-05 15:53:57,361 - 级别:[ WARN] - 消息: [other] The web application [ROOT] appears to hav ...

  6. redis.clients.jedis.exceptions.JedisDataException :READONLY You can't write

    分布式直连同步调用测试时出现的错误:主从复制架构下,默认Slave是只读的,如果写入则会报错: redis.clients.jedis.exceptions.JedisDataException: R ...

  7. redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots

    最近在学习Redis ,在写test测试的时候碰到这个报错: redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is c ...

  8. Caused by: redis.clients.jedis.exceptions.JedisDataException: READONLY You can't write against a read only slave.

    Caused by: redis.clients.jedis.exceptions.JedisDataException: READONLY You can't write against a rea ...

  9. [redis] redis.clients.jedis.exceptions.JedisDataException: MOVED 13102 127.0.0.1

    这个异常上网查了很久才知道原因: MOVED indicates that you're using Redis Cluster. ShardedJedis is not for Redis Clus ...

随机推荐

  1. slice全解析

    slice全解析 昨天组内小伙伴做分享,给出了这么一段代码: package main import ( "fmt" ) func fun1(x int) { x = x + 1 ...

  2. 【java爬虫】---爬虫+jsoup轻松爬博客

    爬虫+jsoup轻松爬博客 最近的开发任务主要是爬虫爬新闻信息,这里主要用到技术就是jsoup,jsoup 是一款 Java的HTML解析器,可直接解析某个URL地址.HTML文本内容.它提供了一套非 ...

  3. Apache生产配置

    httpd.conf # # This is the main Apache HTTP server configuration file. It contains the # configurati ...

  4. EF之Code First代码优先

    1.前言 通过英文可知,表示的是代码优先,一般创建EF都是先创建数据库,创建根据数据库的EF实体模型,而code - first 则是反过来!... 2.代码实战 我们这次创建的不是原来的数据库EF设 ...

  5. hibernate易混淆点

    萌新小笔记: 用过hibernate的小伙伴肯定经常看到这几个东西吧!但是初学者常常会把这几个搞不清楚:dataSource,session,sessionFactory(dataSource),hi ...

  6. Config安全控制

    1.config server引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <a ...

  7. XSS Reflected 测试

    由于最近在做XSS方面的测试,于是找到了DVWA平台进行实验测试,通过这三篇文章让大家了解XSS方面的大概内容,这三篇文章只是把你领进XSS的大门,要想真正深入的学习XSS,你还需要去学习很多东西来提 ...

  8. leetcode — reverse-linked-list

    /** * Source : https://leetcode.com/problems/reverse-linked-list/ * * * Reverse a singly linked list ...

  9. [八]JavaIO之FileInputStream 与 FileOutputStream

    接下来介绍 FileInputStream  和 FileOutputStream 现在看名字应该可以看得出来: 他就是从一个文件中读取数据 或者将数据写入到一个文件中 FileInputStream ...

  10. gulp插件gulp-nunjucks-render的使用及gulp4的简单了解

    之前写过一篇gulp的使用文章一篇迟到的gulp文章,代码合并压缩,less编译 最近有在用gulp,使用到一个gulp-nunjucks-render插件,感觉挺方便的 gulp-nunjucks- ...