Redis-3.0.0 INSTALLATION FOR LINUX
来源:互联网 发布:xp linux双系统安装 编辑:程序博客网 时间:2024/06/06 10:40
1.下载
下载Redis的源码包[redis-3.0.0.tar.gz](http://download.redis.io/releases/redis-3.0.0.tar.gz)
2.安装
shell> tar -xzvf redis-3.0.0.tar.gzshell> cd redis-3.0.0[root@monitor redis-3.0.0]# ll total 144 -rw-rw-r-- 1 root root 25890 Apr 1 2015 00-RELEASENOTES -rw-rw-r-- 1 root root 53 Apr 1 2015 BUGS -rw-rw-r-- 1 root root 1439 Apr 1 2015 CONTRIBUTING码 -rw-rw-r-- 1 root root 1487 Apr 1 2015 COPYING drwxrwxr-x 6 root root 4096 Apr 1 2015 deps -rw-rw-r-- 1 root root 11 Apr 1 2015 INSTALL -rw-rw-r-- 1 root root 151 Apr 1 2015 Makefile -rw-rw-r-- 1 root root 4223 Apr 1 2015 MANIFESTO -rw-rw-r-- 1 root root 5201 Apr 1 2015 README -rw-rw-r-- 1 root root 41403 Apr 1 2015 redis.conf -rwxrwxr-x 1 root root 271 Apr 1 2015 runtest -rwxrwxr-x 1 root root 280 Apr 1 2015 runtest-cluster -rwxrwxr-x 1 root root 281 Apr 1 2015 runtest-sentinel -rw-rw-r-- 1 root root 7109 Apr 1 2015 sentinel.conf drwxrwxr-x 2 root root 4096 Apr 1 2015 src drwxrwxr-x 10 root root 4096 Apr 1 2015 tests drwxrwxr-x 5 root root 4096 Apr 1 2015 utilsshell> yum install tcl -y ##这里需要安装tcl8.5以上,yum就够了shell> make MALLOC=libcshell> make test 当看到 "\o/ All tests passed without errors!" 说明安装完毕 偶尔会有 "*** [err]: Connect multiple slaves at the same time (issue #141), diskless=no in tests/integration/replication.tcl Expected condition '$digest eq $digest1' to be true (75aec0425373b00e037580d277604f37c156935e eq bd71f91549e45e150a94f2b01abe2f90ffe6281d) Cleanup: may take some time... OK" 这样的报错,请忽略,是个bug
3.测试
起动redis服务
shell> ./src/redis-server &注:首次启动会提示"vm.overcommit_memory = 1"添加到/etc/sysctl中,执行命令: shell> echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf && sysctl -p or shell> sysctl vm.overcommit_memory=1 即可 题外说一下 "overcommit_memory"是用来设置内存的分配策略,位置在/proc/sys/vm/overcommit_memory,有三个选项: 0 表示内核将检查是否有足够的可用内存供应用进程使用 1 表示内核允许分配所有的物理内存,而不管当前的内存状态如何。 2 表示内核允许分配超过所有物理内存和交换空间总和的内存查看端口以及监听状态:shell> netstat -natp|grep 6379tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 92439/./redis-serve tcp 0 0 :::6379 :::* LISTEN 92439/./redis-serve
停止redis服务
shell> ./src/redis-cli shutdown
客户端连接
shell> ./redis-cli -h [ip_add]shell> ./redis-cli -h 192.168.2.2192.168.2.2:6379> set name "Sara"192.168.2.2:6379> get name"Sara"
至此,测试完成
4.命令
所有命令都记录在help里192.168.2.2:6379> helpredis-cli 3.0.0Type: "help @<group>" to get a list of commands in <group> "help <command>" for help on <command> "help <tab>" to get a list of possible help topics "quit" to exit查看某个分组下的所有命令语法:192.168.2.2:6379> help @server BGREWRITEAOF - summary: Asynchronously rewrite the append-only file since: 1.0.0 BGSAVE - summary: Asynchronously save the dataset to disk since: 1.0.0 ... 也可查看单个命令的语法 192.168.2.2:6379> help set SET key value [EX seconds] [PX milliseconds] [NX|XX] summary: Set the string value of a key since: 1.0.0 group: string 另外,用tab键可以快速帮你定位命令哟~
0 0
- Redis-3.0.0 INSTALLATION FOR LINUX
- Installation Instructions for Linux Systems
- Wily IntroScope installation for linux
- SAP router installation for Linux
- SAP router installation for Linux
- SAP router installation for Linux
- redis Installation
- Linux download and installation for JRE
- RIS for Linux - Ris Windows Installation
- FTDI Drivers Installation Guide for Linux
- oracle 12c for linux 6.6 installation
- libevent for linux building and installation
- libevent for linux building and installation
- Vim Installation help for linux(Vim安装指南-linux)
- TimesTen6.0 for Solaris installation manual
- [B15660-02]Oracle® Database Installation Guide 10g Release 2 (10.2) for Linux x86_silent installation
- Manual Installation and Registration of Java Plugin for Linux
- Installation Guide 10g Release 2 (10.2) for Linux x86
- 知识库--request response UML
- Linux NFS服务器的安装与配置
- 将图片打成压缩包,并转换为byte[]
- 注册表操作
- 一小时搞明白自定义注解(Annotation)
- Redis-3.0.0 INSTALLATION FOR LINUX
- LibEvent中文帮助文档--第9章【辅助类型和函数】
- PHP正则表达式
- git checkout 命令详解
- ExecutorService多线程简例
- thinkphp 3.2 if条件判断用法示例
- github
- Vi / VIM: Find And Replace All Text Substitute Command
- metasploit初次接触