zoukankan      html  css  js  c++  java
  • CentOS 6.5下Redis安装记录

    Redis简单介绍:

    Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。从2010年3月15日起,Redis的开发工作由VMware主持。

    redis是一个key-value存储系统。和Memcached相似,它支持存储的value类型相对很多其它,包含string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hash(哈希类型)。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操作。并且这些操作都是原子性的。在此基础上。redis支持各种不同方式的排序。与memcached一样,为了保证效率,数据都是缓存在内存中。差别的是redis会周期性的把更新的数据写入磁盘或者把改动操作写入追加的记录文件,并且在此基础上实现了master-slave(主从)同步。

    安装环境:

    CentOS 6.5

    Redis 2.8.13

    下载安装:

    下载文件到 /opt/ 文件夹下

    wget http://download.redis.io/releases/redis-2.8.13.tar.gz

    解压文件

    tar zxvf redis-2.8.13.tar.gz

    切换文件夹到 redis-2.8.13 文件夹下

    cd redis-2.8.13

    运行make命令,最后几行的输出结果

    Hint: To run 'make test' is a good idea ;)
    make[1]: Leaving directory `/opt/redis-2.8.13/src'

    运行安装命令

    make install

    提示:

    cd src && make install
    make[1]: Entering directory `/opt/redis-2.8.13/src'
    
    Hint: To run 'make test' is a good idea ;)
    
        INSTALL install
        INSTALL install
        INSTALL install
        INSTALL install
        INSTALL install
    make[1]: Leaving directory `/opt/redis-2.8.13/src'
    
     依据提示。运行:cd src && make install
    提示:

    Hint: To run 'make test' is a good idea ;)
    
        INSTALL install
        INSTALL install
        INSTALL install
        INSTALL install
        INSTALL instal
    依照提示运行:make test

    提示:

    You need tcl 8.5 or newer in order to run the Redis test
    make: *** [test] Error 1
    
    解决方法參考:http://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html

    也能够使用:yum install tcl 命令安装

    后来经搜索发现不须要安装。直接到src文件夹下运行 ./redis-server 就能够


    能够使用相似 ./redis-server /path/to/redis.conf 命令指定配置文件。

    Server started, Redis version 2.8.13
    The server is now ready to accept connections on port 6379

    服务启动成功,服务已经在6379port上监听连接请求。

    你能够使用内置的client连接Redis:http://www.redis.cn/download.html

    $ src/redis-cli
    redis> set foo bar
    OK
    redis> get foo
    "bar"

    注意事项:

    要远程訪问它,还须要开启防火墙port,
    要保持服务的运行能够直接关闭终端窗体,但不要使用Ctrl+C,这样会使程序退出。

  • 相关阅读:
    aspjpeg组件安装、使用常见问题
    调用过程sub时不能使用括号
    asp中,使用js打开别的网址注意点
    让文件夹属性出现“安全”选项卡
    C#正则表达式使用<转载备用>
    .NET编程中常用的路径表示方式<转>
    DIVWEB布局
    winform report<收藏>
    Delphi中MessageBox用法
    DW中常用标签
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/5160642.html
Copyright © 2011-2022 走看看