Can I set global TTL in redis?

No, Redis doesn’t have a notion of a global/default TTL and yes, you do have to set it for each key independently. However, depending on your requirements and on what you’re trying to do, there may be other ways to achieve your goal. Put differently, why do you need it? For example, if you want … Read more

Copy all keys from one db to another in redis

If you can’t use MIGRATE COPY because of your redis version (2.6) you might want to copy each key separately which takes longer but doesn’t require you to login to the machines themselves and allows you to move data from one database to another. Here’s how I copy all keys from one database to another … Read more

JedisConnectionFactory setHostName is deprecated

With Spring Data Redis 2.0, those methods have been deprecated. You now need to configure using RedisStandaloneConfiguration Reference: https://docs.spring.io/spring-data/redis/docs/current/api/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.html#setHostName-java.lang.String- Example: JedisConnectionFactory jedisConnectionFactory() { RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(“localhost”, 6379); redisStandaloneConfiguration.setPassword(RedisPassword.of(“yourRedisPasswordIfAny”)); return new JedisConnectionFactory(redisStandaloneConfiguration); }

Event on key expire

Current development version of redis contains a new feature: keyspace notifications. Documentation: http://redis.io/topics/notifications Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. Examples of the events that is possible to receive are the following: All the commands affecting a given key. All … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)