0

I'm trying to connect to my virtual machine Redis

package nosql;

import redis.clients.jedis.Jedis;

public class NoSQL {

public static void main(String[] args) {
    //I try port:               ("127.0.0.1",6379)
    Jedis jedis = new Jedis("127.0.0.1",60448);
    if(jedis.isConnected())
    System.out.println("connected");
    jedis.ping();

    jedis.set("key1", "value1");
    System.out.println(jedis.get("key1"));

}

}

My Redis configuration:

Redis configuration

I have already put the virtual machine in bridge mode (I do not know if there has).

I am researching the hours and not getting answers.

Does anyone know what the error?

Community
  • 1
  • 1
Leonardo Lacerda
  • 397
  • 1
  • 3
  • 15
  • Looks like a config issue between your VM and the client/host. Figure out the public IP address of your VM and connect to the :6379 (and not localhost:60448) – mp911de Sep 22 '15 at 09:08

1 Answers1

0

just run the server "redis-server" in the main redis folder and run the above program that would do the job.