标签:使用 unp 导包 ssh 文件中 tar mil reply work
1 <!-- https://mvnrepository.com/artifact/redis.clients/jedis --> 2 <dependency> 3 <groupId>redis.clients</groupId> 4 <artifactId>jedis</artifactId> 5 <version>2.9.0</version> 6 </dependency>
1 JedisShardInfo sharInfo = new JedisShardInfo("192.168.72.188", 6379); 2 sharInfo.setPassword("123456"); 3 Jedis jedis = new Jedis(sharInfo); 4 String result = jedis.set("name", "zhangsan"); 5 System.out.println(result); 6 String name = jedis.get("name"); 7 System.out.println(name); 8 jedis.close();
1 JedisPoolConfig config = new JedisPoolConfig(); 2 config.setMaxIdle(1000);//最大空闲时间 3 config.setMaxWaitMillis(1000); //最大等待时间 4 config.setMaxTotal(500); //redis池中最大对象个数 5 6 JedisShardInfo sharInfo = new JedisShardInfo("192.168.72.188", 6379); 7 sharInfo.setPassword("123456"); 8 List<JedisShardInfo> list = new ArrayList<JedisShardInfo>(); 9 list.add(sharInfo); 10 ShardedJedisPool pool = new ShardedJedisPool(config, list); 11 ShardedJedis jedis2 = pool.getResource(); 12 jedis2.set("haha", "测试"); 13 System.out.println(jedis2.get("haha"));
redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. at redis.clients.jedis.Protocol.processError(Protocol.java:127) at redis.clients.jedis.Protocol.process(Protocol.java:161) at redis.clients.jedis.Protocol.read(Protocol.java:215) at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340) at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:239) at redis.clients.jedis.Jedis.set(Jedis.java:121) at redis.clients.jedis.ShardedJedis.set(ShardedJedis.java:43) at com.javen.redis.RedisTest.testHelloWorld(RedisTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
标签:使用 unp 导包 ssh 文件中 tar mil reply work
原文地址:http://www.cnblogs.com/lq147760524/p/7010853.html