阿里云下Linux服务器安装Redis
tar xzf redis-3.2.9.tar.gz
cd redis-3.2.9
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
JedisShardInfo sharInfo = new JedisShardInfo("192.168.72.188", 6379);
sharInfo.setPassword("123456");
Jedis jedis = new Jedis(sharInfo);
String result = jedis.set("name", "zhangsan");
System.out.println(result);
String name = jedis.get("name");
System.out.println(name);
jedis.close();
JedisPoolConfig config = new JedisPoolConfig();
config.setMaxIdle(1000);//最大空闲时间
config.setMaxWaitMillis(1000); //最大等待时间
config.setMaxTotal(500); //redis池中最大对象个数 JedisShardInfo sharInfo = new JedisShardInfo("192.168.72.188", 6379);
sharInfo.setPassword("123456");
List<JedisShardInfo> list = new ArrayList<JedisShardInfo>();
list.add(sharInfo);
ShardedJedisPool pool = new ShardedJedisPool(config, list);
ShardedJedis jedis2 = pool.getResource();
jedis2.set("haha", "测试");
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)

阿里云下Linux服务器安装Redis的更多相关文章
- 阿里云下Linux服务器安装Mysql、mongodb
阿里云下Linux服务器安装Mysql.mongodb 一.MySQL的安装和配置 1.安装rpm包 rpm -Uvh http://dev.mysql.com/get/mysql-community ...
- 阿里云下Linux服务器安装JDK、Tomcat
阿里云服务器相信大家越来越熟悉,刚开始接触,将基本的java软件安装做点记录: 1.配置阿里云的yum仓库: 获取仓库配置 wget http://mirrors.aliyun.com/repo/Ce ...
- 阿里云服务器Linux CentOS安装配置(九)shell编译、打包、部署
阿里云服务器Linux CentOS安装配置(九)shell编译.打包.部署 1.查询当前目录以及子目录下所有的java文件,并显示查询结果 find . -name *.java -type f - ...
- 阿里云服务器Linux CentOS安装配置(七)域名解析
阿里云服务器Linux CentOS安装配置(七)域名解析 1.购买域名 登录阿里云,左侧菜单点击[域名],然后[域名注册],完成域名购买.(一般首年45元) 2.添加域名解析 在域名列表里点击你的域 ...
- 阿里云服务器Linux CentOS安装配置(六)resin多端口配置、安装、部署
阿里云服务器Linux CentOS安装配置(六)resin多端口配置.安装.部署 1.下载resin包 http://125.39.66.162/files/2183000003E08525/cau ...
- 阿里云服务器Linux CentOS安装配置(四)yum安装tomcat
阿里云服务器Linux CentOS安装配置(四)yum安装tomcat 1.yum -y install tomcat 执行命令后,会帮你把jdk也安装好 2.tomcat安装目录:/var/li ...
- 阿里云服务器Linux CentOS安装配置(二)yum安装svn
阿里云服务器Linux CentOS安装配置(二)yum安装svn 1.secureCRT连接服务器 2.先创建一个文件夹,用来按自己的习惯来,用来存放数据 mkdir /data 3.yum安装sv ...
- 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器
阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 我在阿里云购买的服务器配置 CPU:1核 内存:2G 系统盘:40G 公共镜像:CentOS 6.5 64位 公网带宽:1Mbps ...
- 转-阿里云CentOS Linux服务器上用postfix搭建邮件服务器
http://www.cnblogs.com/dudu/archive/2012/12/12/linux-postfix-mailserver.html 注:本文的邮件服务器只用于发送邮件,也就是ST ...
随机推荐
- 很好的脑洞题:dfs+暴力 Gym - 101128A Promotions
http://codeforces.com/gym/101128 题目大意:给你一个a,b,e,p.有e个点,p条有向边,每条边为(x,y),表示x->y,每次我们都取出一个入度为0的,并且一次 ...
- 不平衡分类学习方法 --Imbalaced_learn
最近在进行一个产品推荐课题时,由于产品的特性导致正负样本严重失衡,远远大于3:1的比例(个人认为3:1是建模时正负样本的一个临界点),这样的样本不适合直接用来建模,例如正负样本的比例达到了50:1,就 ...
- JVM学习三:JVM之类加载器之连接分析
学习完类加载之加载篇后,让我们继续来看加载之连接,连接分为三个步骤:验证.准备和解析三步,我们将一一分析之. 连接就是将已经读入到内存的类的二进制数据合并到虚拟机的运行时环境中去. 类加载完毕之后进入 ...
- mysql 导出数据导致锁表
故事原由:今天同事小星做系统优化时问我一个sql问题,为什么查询慢,我看了一眼,发现用到了表A中的datetime类型列进行时间比较,建议他给datetime类型列加上索引. 可这是生产库,表A里面有 ...
- 查询timestamp类型数据
$where=" roleid = 8 and lizhi = 0 and branchid IN (".implode(",",$ids).") a ...
- $.when()方法翻译2
mac不知道为何,文章字数一多,浏览器就重启.只好分开写了. In the event a Deferred was resolved with no value, the corresponding ...
- 自定义 feign 反序列化时间字符格式
参考 : https://blog.csdn.net/forezp/article/details/73480304 feign client 默认配置类:默认的配置类为FeignClientsCon ...
- Lucene7.2.1系列(三)查询及高亮
系列文章: Lucene系列(一)快速入门 Lucene系列(二)luke使用及索引文档的基本操作 Lucene系列(三)查询及高亮 一 准备 创建项目并添加Maven依赖 <dependenc ...
- vsftpd 安装配置详细教程
linux下ftp软件不少,大致特点:<br /> wu-ftp:比较老牌,但针对它的攻击比较多,设置比较麻烦,但功能比较强大.<br /> vsftpd:功能强大,配置也比较 ...
- appium===常用方法介绍,元素定位
https://testerhome.com/topics/3711 元素定位方法: find_element_by_android_uiautomator ,使用uiautomator定位,后面参数 ...