i'm trying to connect to my redis cluster(on remote server) using jedis(on my local machine connected to same network).
My redis cluster is formed by following ips:
10.x.x.x:6380
10.x.x.x:6382
10.x.x.x:6385
My config file for redis instance 10.x.x.x:6380 is:
port 6380
cluster-enabled yes
cluster-config-file nodes-6380.conf
cluster-node-timeout 5000
appendonly yes
protected-mode yes
#daemonize yes
bind 127.0.0.1 10.x.x.x(machine ip)
However the issue is that when i'm tryig to run my redis server instance, i'm getting the following exception:
[admin@dn2 6380]$ redis-server redis.conf
10965:M 21 Jul 02:58:04.100 # Creating Server TCP listening socket (local machine ip):6380: bind: Cannot assign requested address
Can someone tell me what i'm doing wrong here??? Thanks in advance.
My jedis program is:
Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>();
//Jedis Cluster will attempt to discover cluster nodes automatically
jedisClusterNodes.add(new HostAndPort("10.x.x.x", 6380));
jedisClusterNodes.add(new HostAndPort("10.x.x.x", 6382));
jedisClusterNodes.add(new HostAndPort("10.x.x.x", 6385));
JedisCluster jc = new JedisCluster(jedisClusterNodes);
jc.set("foo", "bar");
String value;
System.out.println(value = jc.get("foo"));