Redis安装测试(待完善)

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
[[email protected] 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"));
    }

}

可视化查看下载 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

时间: 2024-08-05 06:11:48

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

twemproxy - Proxy Server for Redis 安装测试

1. 安装 (1) 系统环境 测试用的服务器为阿里云ECS,4核8G,CentOS6.3 64bit. 部署了3个Redis实例,监听端口号为7410,7420,7430,设置maxmemory为256MB. (2) 安装 在安装twemproxy之前,先要安装几个编译工具: $ yum install autoconf $ yum install automake $ yum install m4 从 twemproxy的github 提示的 distribution tarball下载.下载

Redis安装及简单测试

题目链接:11645 - Bits 题意:给定一个数字n,要求0-n的二进制形式下,连续11的个数. 思路:和 UVA 11038 这题类似,枚举中间,然后处理两边的情况. 不过本题最大的答案会超过longlong,要用高精度,不过借鉴http://www.cnblogs.com/TO-Asia/p/3214706.html这个人的方法,直接用两个数字来保存一个数字,这样能保存到2个longlong的长度,就足够存放这题的答案了. 代码: #include <stdio.h> #include

Redis集群方案,Codis安装测试

1,关于豌豆荚开源的Codis Codis是豌豆荚使用Go和C语言开发.以代理的方式实现的一个Redis分布式集群解决方案,且完全兼容Twemproxy.Twemproxy对于上一层的应用来说, 连接Codis Proxy(Redis代理服务)和连接原生的Redis服务器没有明显的区别,上一层应用能够像使用单机的 Redis一样对待.Codis底层会处理请求的转发.不停机的数据迁移等工作, 所有底层的一切处理, 对于客户端来说是透明的.总之,可以简单的认为后台连接的是一个内存无限大的Redis服

redis window 安装测试--记录

1.下载地址https://github.com/dmajkic/redis/downloads 2.打开一个cmd窗口,使用cd命令切换到指定目录(D:\redis\64bit)运行 redis-server.exe redis.conf . 3.在开一个cmd(D:\redis\64bit)  运行 redis-cli.exe -h 127.0.0.1 -p 6379,其中 127.0.0.1是本地ip,6379是redis服务端的默认端口 4. 测试: set test "11111111

Windows下redis 安装与PHP使用

http://alfred-long.iteye.com/blog/1684545 一. 安装redis及启用服务 1 下载redis客户端 http://code.google.com/p/servicestack/wiki/RedisWindowsDownload#Download_32bit_Cygwin_builds_for_Windows 2 解压到你所需要的目录中 3 创建redis.conf文件 Redis.conf代码   # Redis configuration file e

redis安装

1.环境安装 yum install gcc-c++ 2.下载redis 从官网下载 http://download.redis.io/releases/redis-3.0.0.tar.gz 将redis-3.0.0.tar.gz拷贝到/usr/local下 版本自选 3.解压源码 tar -zxvf redis-3.0.0.tar.gz 4.进入解压后的目录进行编译 cd /usr/local/redis-3.0.0 make 5.安装到指定目录,如 /usr/local/redis cd /

[Redis]windows下redis安装

官方的下载地址是: http://redis.io/download 在win64一栏中可以看到redis原本是没有windows版本的,windows版本是Microsoft Open Tech团队开的 给出了一个github的链接地址: https://github.com/MSOpenTech/redis 下载: 在https://github.com/MSOpenTech/redis  页面的右下角有  Download Zip的字样,点击之后就可以下载源码的zip包了. 然后就是解压:

安装测试知识(待更新)

1.    安装测试 1.1定义 安装测试是指按照软件产品安装手册或相应的文档,在一个和用户使用该产品完全一样的环境中或相当于用户使用环境中,进行一步一步的操作完成安装的过程所进行的测试. 1.2安装测试的分类 安装测试可以分为: (1)全新安装,待安装的软件包是完整的,包含了所有的文件. (2)升级版本安装,部分文件构成的软件包.升级安装也可以分为两种,一种是完全替换原来版本,另外一种就是保持多种版本共存. (3)补丁式安装,很小的改动或很少文件的更新. (4)软件版本不变 系统运行环境改变,

Redis(二)linux下redis安装

上篇讲解了redis在windows下的安装,接下来看看在linux下如何安装redis(纯菜鸟入门级别)? (1)redis的下载及编译 这里,首先进入存放文件目录(我的云服务器的是:cd /jelly/redis/)  wget http://download.redis.io/releases/redis-3.0.0.tar.gz(下载) tar xzf redis-3.0.0.tar.gz(解压) cd /src make(编译) (2)启动redis服务 mv redis3.0.0 r