Open huaism opened 5 years ago
Even if we visit the same KEY multiple times, this result is
@huaism how did you get that fancy output?
@4fath link : https://github.com/junegunn/redis-stat
Hi @huaism , can you please provide the config to implement redis cache using redis-cluster.
HI @NitinK91
hibernate.cache.region.factory_class=org.hibernate.cache.redis.hibernate52.SingletonRedisRegionFactory hibernate.cache.region_prefix=hibernate hibernate.cache.use_structured_entries=true hibernate.cache.use_query_cache=false hibernate.cache.use_second_level_cache=true hibernate.cache.provider_configuration_file_resource_path=hibernate-redis.properties
redisson-config=classpath:redisson.yaml redis.expiryInSeconds.default=0
clusterServersConfig:
idleConnectionTimeout: 10000
pingTimeout: 1000
connectTimeout: 10000
timeout: 3000
retryAttempts: 3
retryInterval: 1500
reconnectionTimeout: 3000
failedAttempts: 3
password: null
subscriptionsPerConnection: 5
clientName: null
loadBalancer: !
Thanks @huaism for sharing.
I am facing an issue. Can you help. It is giving following error::
java.lang.IllegalArgumentException: port out of range:-1
at java.net.InetSocketAddress.checkPort(InetSocketAddress.java:143)
at java.net.InetSocketAddress.
Actually it not generating ClientPartition.getMasterAddress() properly. Address is //127.0.0.1:8001@18001 as recorded by CLUSTER_NODES, but it reads it as host: 18001 and port=-1.
Cluster config deom CLUSTER_NODES:: [ClusterNodeInfo [nodeId=4317f285b359ddc3ac08bb85239924509146e475, address=//127.0.0.1:8003@18003, flags=[SLAVE], slaveOf=4118a348827e6107d7e35522a251fd39c5a8f82b, slotRanges=[]], ClusterNodeInfo [nodeId=2f7b93c80d3721b3fb26fe87bc28ed04a63fe0ec, address=//127.0.0.1:8005@18005, flags=[SLAVE], slaveOf=8b81c3e1acb4e1959a83267540058d1a6bffa12f, slotRanges=[]], ClusterNodeInfo [nodeId=4118a348827e6107d7e35522a251fd39c5a8f82b, address=//127.0.0.1:8001@18001, flags=[MASTER], slaveOf=null, slotRanges=[[5461-10922]]], ClusterNodeInfo [nodeId=a0770863d893a5b8106a83e247cea2544f99ef36, address=//127.0.0.1:8004@18004, flags=[SLAVE], slaveOf=6b9da1bbe38b978a3017406e5c1e310f4706cfc8, slotRanges=[]], ClusterNodeInfo [nodeId=8b81c3e1acb4e1959a83267540058d1a6bffa12f, address=//127.0.0.1:8000@18000, flags=[MYSELF, MASTER], slaveOf=null, slotRanges=[[0-5460]]], ClusterNodeInfo [nodeId=6b9da1bbe38b978a3017406e5c1e310f4706cfc8, address=//127.0.0.1:8002@18002, flags=[MASTER], slaveOf=null, slotRanges=[[10923-16383]]]]
My code is :: Config config = new Config(); config.useClusterServers() .addNodeAddress("redis://127.0.0.1:8000"); RedissonClient redisson = Redisson.create(config);
RMap<String, String> map = redisson.getMap("simpleMap");
map.put("mapKey", "This is a map value");
String mapValue = map.get("mapKey");
System.out.println("stored map value: " + mapValue);
redisson.shutdown();