First, download Redis decompression
Second, copy the redis.windows.conf file as redis.windows_6380.conf
Third, modify the configuration IP and port
Iv. Configuring IP and ports that belong to the primary service
V. Start the test, read-only from the service, ********** the primary service IP and port modifications are not reflected in the steps
Package Com.redis.demo;import Java.util.logging.logger;import Redis.clients.jedis.jedis;public class RedisClent { public static void Main (string[] args) {Jedis Jedis = new Jedis ("127.0.0.1", 6379); String Set1 = Jedis.set ("Tian", "bbbb"); System.out.println (Set1 +::::::: "+jedis.get (" Tian ")); Jedis Jedis2 = new Jedis ("127.0.0.232", 6380); System.out.println ("Jedis2 Read jedis-127.0.0.1 Value-set1:::::" +jedis2.get ("Tian")); String Set2 = Jedis.set ("Tian", "BBBB"); System.out.println ("Jedis2 Read jedis-127.0.0.1 Value-set2:::::" +jedis2.get ("Tian"));//error from server settings try{string Set3 = Jedis2.set ("TIAN", "BBB"); catch (Exception e) {System.out.println ("Redis from server Setup error \ n" +e);}}}
Note: If the daemon is used, Windows does not support, does not test, the memo contacts the server to see the configuration
Redis Windows Master Service configuration