1 Redis安装

在网址http://redis.io/下载redis-3.2.3.tar.gz,解压。

进入解压目录 编译和安装,具体配置项可参考自带的README.md文件

make test
make install

2 启动

开启服务:   redis-server --protected-mode no &
客户端连接: redis-cli
停止redis服务: redis-cli shutdow
[2] 4418
[sms@gc64 redis]$ 4418:M 30 Aug 16:58:12.425 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
4418:M 30 Aug 16:58:12.425 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
4418:M 30 Aug 16:58:12.425 # Current maximum open files is 1024. maxclients has been reduced to 992 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.3 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 4418
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' 4418:M 30 Aug 16:58:12.426 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
4418:M 30 Aug 16:58:12.426 # Server started, Redis version 3.2.3
4418:M 30 Aug 16:58:12.426 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
4418:M 30 Aug 16:58:12.426 * The server is now ready to accept connections on port 6379

启动信息

3 JAVA测试

import axbDemo.utils.RedisUtilities;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import redis.clients.jedis.JedisPool; import java.util.Map;
import java.util.HashMap; /**
* Created by DBClient on 2016/8/16.
*/
public class RedisTest { private final static Logger logger = LoggerFactory.getLogger("RedisTest"); public static void main(String[] args) {
MDC.put("logname", "redis");
logger.info("hello world");
JedisPool jedisPool = new JedisPool("192.168.150.200", 6379);
//logger.info((RedisUtilities.info(jedisPool)));
RedisUtilities.set(jedisPool, "name", "lilei"); Map<String, String> red = new HashMap<String, String>(){
{
put("h4", "23");
put("h5", "26");
}
};
RedisUtilities.hmset(jedisPool, "redKey", red, 0); logger.info(RedisUtilities.get(jedisPool, "name"));
logger.info("" + RedisUtilities.hgetall(jedisPool, "redKey"));
logger.info(RedisUtilities.hget(jedisPool, "redKey", "h1")); RedisUtilities.del(jedisPool, "name");
logger.info(RedisUtilities.get(jedisPool, "name")); RedisUtilities.hdel(jedisPool, "redKey", "hl");
logger.info("" + RedisUtilities.hgetall(jedisPool, "redKey"));
} }

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUQAAACaCAIAAABey6Z6AAALlUlEQVR4nO2dzcGrNhBF086DNkIbHx1kGXWhCpJV3MTDzWUBCCGkQRIYm/E5i+QzAWn0c9EIm5s/WgBQwR/vDgAAzgExAygBMQMoATEDKAExAygBMQMoYRFz0/R2GJ7P5/P5HAbbN82r676+RgDFBGJ+j6LeWPV7afped6s7Y3Q3UObi8T1ZzE3TmccwPExXUk5m1f5K7hZzd/BhOv+c37//+dc7eWQ8p23bMczxoO1rmhwEU5pcjJe7S4r6rTOPoF2D7Sua8FKCBuZfsu3J1PF3kRNPRfOPcycxp06eOm6u1J0QnNk0nbGmm44/TNe0k6qnv0sJyp9LKpq7xWJet2K6vDdlHX4NdTMqddWnpW+78Vwf8P3S7ISYrbXDuMZuxbxVnVuitx+rwy7twIMdftZ4vW7cETNiLj55OtKZh+3bqJg781itgauleD5Q3PDIylyS7n6ImDvzeFE2iJg/Rcwu6bd2eD6fw8MYO7gdpr/nXA7G9hLe5mHZZAYr4TlidqJciTl8Wp6+v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BP6+SNe9GX5sVHxFzNM5VwJv2nilm97QDE3w5GEzw87rLJQTSfHCdM2R8KxPMh6AJrh+CLCz3id3evA16VbjvCHG6bxm27S3ajY/wogVcxHSve+tA+98sfCzzVrH4q3JegYSvoO6HxvcCMQMoATEDKAExAygBMQMoATEDKAExAygBMQMo4X8hutePEQEmxQAAAABJRU5ErkJggg==" alt="" />

可视化查看下载 redis-desktop-manager-0.7.6.15.exe, 安装后,配置redis服务器信息,即可参看数据库的情况

参考资料

1 Redis 命令参考 http://doc.redisfans.com/

2 Redis 官网   http://redis.io/

3 redis 配置文件信息  http://www.redis.io/topics/config

4 Redis快速入门   http://www.yiibai.com/redis/redis_quick_guide.html

Redis安装测试(待完善)的更多相关文章

  1. CentOS 6.5下Redis安装测试

    NoSQL之Redis - CentOS 6.5安装测试 1.下载redis 可以在线安装或者下载 redis ①在线安装前需要检测是否存在rpm包不存在的话查看yum在线是否存在rpm包不存在的话就 ...

  2. Redis安装测试

    1.在线下载,redis是C语言开发的,编译需要依赖一个gcc的环境: yum install gcc-c++,需要保证网络畅通,在线安装: 键入y 环境安装完成后,接下来安装redis; 可以先去h ...

  3. twemproxy - Proxy Server for Redis 安装测试

    1. 安装 (1) 系统环境 测试用的服务器为阿里云ECS,4核8G,CentOS6.3 64bit. 部署了3个Redis实例,监听端口号为7410,7420,7430,设置maxmemory为25 ...

  4. 1. redis安装(windows)

    Redis在windows下安装过程 转载自(http://www.cnblogs.com/M-LittleBird/p/5902850.html)   一.下载windows版本的Redis 去官网 ...

  5. win redis安装

    一.下载windows版本的Redis 去官网找了很久,发现原来在官网上可以下载的windows版本的,现在官网以及没有下载地址,只能在github上下载,官网只提供linux版本的下载 官网下载地址 ...

  6. Redis、Redis+sentinel安装(Ubuntu 14.04下Redis安装及简单测试)

    Ubuntu下Redis安装两种安装方式: 1.apt-get方式 步骤: 以root权限登录,切换到/usr目录下. 接下来输入命令,apt-get install redis-server,如图: ...

  7. redis安装、测试&集群的搭建&踩过的坑

    1 redis的安装 1.1   安装redis 版本说明 本教程使用redis3.0版本.3.0版本主要增加了redis集群功能. 安装的前提条件: 需要安装gcc:yum install gcc- ...

  8. 【Redis】Redis基础 - Redis安装启动测试

    Redis基本 - 安装 文章目录 Redis基本 - 安装 Linux下安装Redis Docker 方式 Github 源码编译方式 直接安装方式 Windows下Redis安装 记录 - Red ...

  9. Redis安装及实现session共享

    一.Redis介绍 1.redis是key-value的存储系统,属于非关系型数据库 2.特点:支持数据持久化,可以让数据在内存中保存到磁盘里(memcached:数据存在内存里,如果服务重启,数据会 ...

随机推荐

  1. 使用bulkload向hbase中批量写入数据

    1.数据样式 写入之前,需要整理以下数据的格式,之后将数据保存到hdfs中,本例使用的样式如下(用tab分开): row1 N row2 M row3 B row4 V row5 N row6 M r ...

  2. k近邻算法(knn)的c语言实现

    最近在看knn算法,顺便敲敲代码. knn属于数据挖掘的分类算法.基本思想是在距离空间里,如果一个样本的最接近的k个邻居里,绝大多数属于某个类别,则该样本也属于这个类别.俗话叫,"随大流&q ...

  3. 萌新笔记——封装hiredis——C++与redis对接(一)(string的SET与GET操作)

    在菜鸟教程自学了redis,总想着像Mysql一样,在C/C++中进行对接.于是查询了一些资料,最后找到了hiredis.然而直接用它的话,难免有点不方便.于是,对其进行封装. hiredis直接去g ...

  4. 安装TFS2015后启用生成功能

    安装了TFS2015后,发现高大上呀.可是在传了个DEMO,BUILD生成的时候提示没有 一些文件,提示:找不到具有以下功能的代理: msbuild, visualstudio.在服务端安了VS201 ...

  5. 基于keepalived双主模型的高可用LVS

    背景知识: keepalived:Keepalived的作用是检测web服务器的状态,如果有一台web服务器死机,或工作出现故障,Keepalived将检测到,并将有故障的web 服务器从系统中剔除, ...

  6. 任意半径局部直方图类算法在PC中快速实现的框架。

    在图像处理中,局部算法一般来说,在很大程度上会获得比全局算法更为好的效果,因为他考虑到了图像领域像素的信息,而很多局部算法可以借助于直方图获得加速.同时,一些常规的算法,比如中值滤波.最大值滤波.最小 ...

  7. AC日记——地鼠游戏 codevs 1052

    1052 地鼠游戏  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 钻石 Diamond 题解       题目描述 Description 王钢是一名学习成绩优异的学生,在平 ...

  8. express中url的参数传递和获取

    1,传统get参数 浏览器通过这种形式的url访问localhost/userlist?id=xxx&name=yyy,这种方式可以通过req.query.id获取参数的值 router.ge ...

  9. BZOJ 1415 【NOI2005】 聪聪和可可

    题目链接:聪聪和可可 一道水题--开始还看错题了,以为边带权--强行\(O(n^3)\)预处理-- 首先,我们显然可以预处理出一个数组\(p[u][v]\)表示可可在点\(u\),聪聪在点\(v\)的 ...

  10. 解读ASP.NET 5 & MVC6系列(13):TagHelper

    在新版的MVC6中,微软提供了强大的TagHelper功能,以便让我们摆脱如下的臃肿代码: @Html.LabelFor(model => model.FullName) @Html.EditF ...